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 noticed that OS X has two hosts files: /private/etc/hosts and /etc/hosts. What is the difference between them?

I was attempting to modify my iMac's hosts file in Terminal and tried the usual sudo nano /private/etc/hosts, but that brought up an empty page. I thought the hosts file was simply empty. I added the entries I wanted to block and when I tried to Ctrl+O or Ctrl+X, I got the error "No file exists".

After some researching, I tried using sudo nano /etc/hosts and it brought up what looks like the hosts file (the same entries as I have on my MBP running the same OS when I run sudo nano /private/etc/hosts).

Is there a difference in the file in /private/etc/hosts and /etc/hosts? Does that mean I have a problem with my iMac's hosts file?

share|improve this question
1  
/etc is symlinked to /private/etc (open Terminal and type l -l /etc) so I'm also confused with what you report. Are you sure you edited /private/etc/hosts and not /private/etc/host (which is what you get with tab expansion and doesn't exist)? –  jaume Feb 20 '13 at 13:50

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.