1

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.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0    localhost

And attempted to save it and got this error:

[ERROR WRITING private/etc/hosts: NO SUCH FILE OR DIRECTORY]

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.

1 Answer 1

5

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

1
  • WOW... that was actually it. Thank you. that was easy.
    – Murphy1976
    Commented Sep 8, 2013 at 2:27

You must log in to answer this question.