Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Sep 8 '13 at 8:21

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

1 Answer 1

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

 
discard

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