How to Restore the Original Default hosts File in Mac OS X

w-hosts

Apparently, you are reading the right post if looking for solution to Restore the Original Default hosts File in Mac OS X. Hosts file are very important and is included onto every computer. It is too used by Mac OS to map IP addresses to the host names. Many users may choose to adjust, change, or edit the hosts file for a number of reasons. Doing so, isn’t easy and it is easily subjected to user error, and are responsible for variety of undesirable network problems alike inaccessible network locations, web sites blocked, network failures or sometimes websites are unable to load. Moreover failed iOS updates and various iTunes errors emerges like most commonly 17 and 3194 errors as the Apple servers have been blocked.

Reference:- https://discussions.apple.com/thread/3302665?tstart=0

Really, facing this erroneous situation is unavoidable but fortunately, restoring the original default /etc/hosts file back to previous is quite easy. In order to get back you just need the original untouched default file to simply overwrite on the existing damaged hosts file with some new clean version a copy of what comes default in Mac OS X. Furthermore you can read here:- How to Edit Host file On Mac OS X.

The Original Default /etc/hosts File in Mac OS X Looks alike:-

##
##
# 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

Original hosts file is the combination of code block with four default entries. So, you just need to copy and paste this over the existing hosts file and then save it as plain text to restore original Default /etc/hosts File in Mac OS X.

While searching for the solution to restore the original Default hosts File in Mac OS X I come through a forum where an Mac OS X user have an issue that his precious data gets accidentally deleted. Really, losing precious data is unavoidable but need not to  be disappointed as Mac Data Recovery is possible. 

Step to Restore an Unmodified Original Hosts File to Mac OS X

TextEdit is simple text editor that’s bundled with every Mac. You just need an administrator access to complete this task as the hosts document is system file which is in a restricted directory.

  • Open TextEdit >> Paste the code block shown above into new empty blank file
  • Select All text >> choose “Format” >> Make Plain Text>> click “OK.
  • Choose “File” >> Select “Save As”
  • Uncheck the box for “If no extension is provided use txt” (DO NOT INCLUDE A FILE EXTENSION)

restore-default-hosts-file-plain-text

  • Hit Command+Shift+G to for “Go To Folder” window>> Type in /etc/ and go.
  • Name the file ‘hosts’ and save>> Enter administrator password to write to this directory.

Reference:- http://www.igeeksblog.com/how-to-reset-restore-hosts-file-to-its-original-version-in-mac-windows/

In order to confirm the hosts file saved properly or not>> Go to the Terminal app >> type the following:

cat /etc/hosts

After running the command you will get the report like:

If it doesn’t seem alike then you surely have done some wrong. The commonly seen reasons are:-

  • Not saving the file as plain text
  • Accidentally adding the file extension
  • Naming it incorrectly

Source:- http://osxdaily.com/2014/04/12/restore-original-hosts-file-mac/

So, to fix double check it..If still the problem persist then it may be that you haven’t overwritten the file properly. In that case, you need to flush DNS cache or just reboot the Mac so that it can take the effects. So, it all solution to restore the original default hosts file in Mac OS X.

How to Restore the Original Default hosts File in Mac OS X

Leave a Reply

Your email address will not be published. Required fields are marked *