The iPhone dev team has not update their unlocking utility to be compatible with iOS 5.1 therefore you get the No Service error. But I believe those nerds in iPhone dev team will be updating their toy. Before the update comes to public release, there is a temporary solution for the problem. In this post will help you fix No Service on your jailbroken iOS device on iOS 5.1.
First thing first, this guide can be used to the following basebands:
You don't know what your baseband is? Then navigate to Settings > General > About > Modem Firmware.
How to fix No Service Error On iPhone 4, iPhone 3GS on iOS 5.1 with Ultrasn0w Fixer for 5.1
Step 1: Launch Cydia on your iPhone 4 or 3GS, then navigate to this path: Manage > Sources > Edit to Add the url source below: (And click Add Source)
Step 2: Once it's added, then search and install Ultrasn0w Fixer for 5.1.
Step 3: Now restart your device, then insert your sim card. Then boot tethered your jailbroken iPhone 4 or 3Gs again or else you will receive the Apple Logo and stuck with it, as we know the only available method to jailbreak iOS 5.1 is tethered jailbreak.
Congratulation you have get rid of the no service error on your jailbroken iPhone 4, 3Gs running on iOS 5.1!