The Original, unmodified hosts file in Mac OS X is easy to restore if need be
The hosts file is included on every computer and used by Mac OS to map IP addresses to host names. Because users may choose to adjust, transfer, or otherwise edit the hosts file for a assortment of reasons, it can be easily subjected to user error, leading to a assortment of undesirable network problems ranging from inaccessible network locations, network failures, vane sites blocked or differently unable to load, tied to failed io updates and diverse iTunes errors like the frequently encountered 17 and 3194 errors because the Apple servers have been blocked .
fortunately, restoring the original default /etc/hosts file back to normal is pretty easy, and the best way to get back the original untouched default option file is to merely overwrite the existing damage hosts file with a newfangled clean version that is a copy of what comes default in Mac OS X. An case of that has been included below for convenience, but you can retrieve it from another Mac if motivation be angstrom well. No extra entries or modifications are included in the interpretation below, which is a direct replica from that found in OS X Mavericks, making it safe to return to if you unintentionally messed up the crucial hosts document during a exchange or adaptation.

You ’ ll want to copy the text below and paste it into a plain text file, stored at the /etc/hosts way. If you ’ rhenium not certain how to do that, you can follow these instructions to learn how to edit the file the proper way from the command line and merely overwrite it with the hosts block below, or use TextEdit and save over the messed up translation, which is what we ’ ll walk through below.

The Default & Original /etc/hosts File in Mac OS X Looks Like This

Contained within the code block is the original hosts file and the four default option entries. Just replicate and paste this over an existing hosts file then save it as complain text to restore it .
##
##
# 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

Those familiar with the command telephone line shouldn ’ triiodothyronine have a trouble with this, but if you ’ re not quite sure what to do you can besides complete the process from the TextEdit app as we ’ ll identify below :

Restore an Unmodified Original Hosts File to Mac OS X

TextEdit is the simpleton text editor bundled with every Mac, you ’ ll besides need administrator access to complete this job since the hosts document is a system file in a restrict directory .

  1. Open TextEdit and paste the above code block into a new empty blank file
  2. Select All text and choose “Format > Make Plain Text” and click “OK
  3. Choose “File > Save As” and uncheck the box for “If no extension is provided use txt” – this is important, DO NOT INCLUDE A FILE EXTENSION
  4. Restore the default hosts file in Mac OS X

  5. Hit Command+Shift+G to bring up the “Go To Folder” window, now type in /etc/ and go
  6. Name the file ‘hosts’ and save, you’ll need to enter an administrator password to be able to write to this directory
  7. Restoring the original default hosts file to a Mac

nowadays to confirm the hosts file saved by rights, go to the Terminal app and type the follow :

cat /etc/hosts
That command should report the file to look like this :

If it doesn ’ metric ton look like the sample hosts file above, you did something incorrectly. The most common problems are normally not saving the file as knit text, unintentionally adding the file extension, or naming it falsely, so double-check that. If you ’ re still having problems, you may not have overwritten the file by rights .
You ’ ll credibly want to flush DNS hoard or just reboot the Mac for changes to take effect system-wide and have the hosts file restored.

This is in truth the easiest way to restore the hosts file if you have messed it up, if it has become excessively clutter with tons of entries, or somehow other rendered the hosts database completely unserviceable. You surely don ’ t need to restore an stallion macintosh from a Time Machine backup or reinstall the OS to accomplish this .

Leave a Reply

Your email address will not be published.