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:
Mac
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
Windows
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





November 23, 2010 at 1:45 AM
I have a generic solution to the above mentioned problem for the all the operating systems including windows,linux and Mac in the below mentioned link
http://www.kuberan.me/2010/11/iphone-ios-4-2-1-update-1013-error/
November 23, 2010 at 2:11 AM
Thanks guys, after following these instructions
iPhone 4 got updated successfully.
November 23, 2010 at 2:31 AM
Thank you Dave! You saved my day. Awesome fix.
November 23, 2010 at 9:47 AM
Thanks Dave!! Brilliant!!
November 23, 2010 at 1:26 PM
THANK YOU!!
After two hours trying, it finally worked. You saved me from going to the Apple Store and deal with the “geniuses” ha!
November 23, 2010 at 5:17 PM
Thanks. Also saved me the trouble of a “Genius” visit on Thanksgiving Wednesday.
November 23, 2010 at 10:23 PM
Thank you soooo much. I actually went to Best Buy and got a new iPhone because they couldn’t do the restore there. I had a problem where when you went to save it said i wasn’t an administrator. This is fixed by running notepad as administrator. FYI.
November 24, 2010 at 1:38 AM
thanks Dave!!!!
i was frustrating before..LOL
November 24, 2010 at 8:52 AM
hi
i cannot save the file after editing in windows although im the administrator????
plss help
November 24, 2010 at 10:46 AM
Awesome! It works!! Thanks!!
November 25, 2010 at 3:55 AM
Big thanks!! My iP4 is back to life!
November 25, 2010 at 1:06 PM
Thanks Dave, My iPhone4 is back, from Spain
November 27, 2010 at 8:33 AM
thanks sooooooooo much problem resloved
November 27, 2010 at 8:58 AM
here still with this ** error
November 27, 2010 at 9:16 AM
Oh, sorry, yeah, mine iphone 4 backs !
=)
thank you from brazil !
November 30, 2010 at 5:00 PM
Worked!! Thanks Juys!
December 2, 2010 at 9:01 AM
Thanks – worked like a charm!!
December 3, 2010 at 3:45 PM
I opened up notepad, then the hosts folder, and nothing has “sc.apple.com” on it…so now what do i do?
December 3, 2010 at 8:29 PM
THANK YOU DAVE!!!
December 3, 2010 at 10:44 PM
Thanks, this worked just fine. After three hours of being stuck in an awful Apple Infinity Loop, I finally got my iPhone working again.
Very much appreciate the information.
December 5, 2010 at 9:11 AM
Dave, thank you from Singapore!!!!!
December 6, 2010 at 6:56 AM
I followed the directions, but I don’t see “gs.apple.com” anywhere.
December 7, 2010 at 2:58 AM
i cant find gs.apple.com pls help me im very much frustrated…
December 8, 2010 at 1:43 PM
Dear dave,
Thanks so MUCH!
February 2, 2011 at 5:18 PM
Error 1013 Solution:
Edit hosts file commenting all related to apple.
My one is as follows:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
#127.0.0.1 gs.apple.com
#74.208.10.249 gs.apple.com
#74.208.105.171 gs.apple.com
works perfect on iphone 4 fw 4.2.1
February 4, 2011 at 5:11 AM
Dave, you saved my day
it works perfectly
thank you from the netherlands
February 6, 2011 at 7:21 AM
Dave, you saved my day too!
Thanks!
February 11, 2011 at 5:00 AM
Totally Resolved .. thank you
February 17, 2011 at 5:40 AM
I’ve done this and nothing has changed, help??
February 23, 2011 at 6:18 AM
Thanks a lot!!!!
With this tip I’ve updated my iphone correctly!
March 7, 2011 at 9:02 PM
1st – Thank you Dave. Worked like a charm.
2nd – Why did it work? In other words, why does REM’ing out the gs.apple.com entries make the restore work? I understand that it is preventing the computer from contacting Apple, but wouldn’t that be a function that is necessary at some point in the future?
3rd – Should we be re-enabling the gs.apple.com lines after completion of the restore?
Thanks for all your help.
March 23, 2011 at 3:45 AM
Dave. One word. Legend.
March 29, 2011 at 8:29 AM
Worked great on iOS 4.3, too. Thanks!
April 1, 2011 at 7:51 PM
Thanks you for your very valuable time, work and expertise that share with us for free
God Bless You
Best Regards
Ignacio Michel
PS It worked with my iPad 2
April 6, 2011 at 8:16 AM
thank you dave!
April 13, 2011 at 9:22 PM
Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuu
i am 2hour without sleep!!!!
Thak you from bresil!!!!!!You save my life!!!