Cydia SHSH Server
To use the server to restore to a firmware no longer being signed by Apple (e.g. 4.0.1), you must first jailbreak and use Cydia's "Make your life easier" option. Then add the following line to /etc/hosts (Mac OS X/Linux via posixninja's idevicerestore) or C:\Windows\System32\drivers\etc\hosts (Windows XP+):
Note: On Windows, make sure you open hosts as Administrator. Then go along with the restore process. If the restore fails after "Verifying iPhone restore with Apple" with iTunes error 3194 or something similar, you have not set it up correctly or saurik's server doesn't have your SHSH for that version.
How it works
Basically, it uses the hosts file to redirect the Apple firmware server to saurik's. His server has a ECID SHSH database, just like apple's. When an older firmware request is sent to apple, it will deny the SHSH request and error out. When it's requested at saurik's, if you've saved it, it finds the SHSH and continues with the restore.