Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

You must log in to answer this question.

Browse other questions tagged .