Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've looked through the internet and even saw a similair posted question, but didn't really give the answer I was looking for, so I'll see if I can get any better luck.

I recently had to modify my host file and add an IP and urls to it for some hosting migration I was performing. Well the migration has completed and I went back to change my host file back, I simply highlighted the text I entered earlier, hit delete, then Control-O then Control-X.

I soon saw that I was having errors when browsing on the internet and through it may have to do with my host file. I went back to find the complete file empty. I entered in the basic:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##   localhost broadcasthost
::1             localhost
fe80::1%lo0    localhost

And attempted to save it and got this error:


Everytime I try to save a new version, it simply says that I cannot since the file cannot be found. Can anyone advise me on what I should do to restore my host file to the way it was. I swear I'll never tinker around in here ever again.

share|improve this question

migrated from Sep 8 '13 at 8:21

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

It should be /private/etc/hosts. You're missing the / at the beginning.

share|improve this answer
WOW... that was actually it. Thank you. that was easy. – Murphy1976 Sep 8 '13 at 2:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.