Some users have reported an issue in which iTunes displays error 1013 when attempting to update iPhones to iOS 4.2. When this error occurs, the iPhone may repeatedly enter recovery mode, getting stuck in a recovery loop.
Try a different computer. If you have access to a second computer with iTunes, try updating to iOS 4.2.1 on it.
Restore instead of update. Backup your iPhone, then perform a restore process instead of using the check for update function. This may allow the iPhone to successfully receive the iOS 4.0.1 update, after which sync processes should occur at normal speed.
Edit hosts file. Failing the above, try these somewhat tedious processes suggested by Apple Discussions poster C. Castillo:
1. Go to your “Applications” folder
2. Go to your “Utilities” folder
3. Launch “Terminal”
4. Type “sudo nano /etc/hosts” (without quotes) and hit return
5. Enter your password
6. Use the down arrow key to find the “gs.apple.com” entries. Once the cursor is in front, make sure you comment out the line(s) by entering “#” (no quotes) in front of the text
7. Save the file by pressing CONTROL+O on the keyboard
8. Exit the nano editor by pressing CONTROL+X on the keyboard
9. Restore your iDevice
10. Come back and thank Dave
1. Go to Start > Programs > Accessories > Notepad
2. Go to File > open
3. Navigate to c:\windows\system32\drivers\etc\
4. Select the “hosts” file and click “open”
5. Delete any line that has “sc.apple.com”
6. Go to File > Save
7. Restore your iPhone