Ask Different is a question and answer site for power users of Apple hardware and software. 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 edited the hosts file and added:

Later I commented out the entry:


When I ping or browse to the returning IP is still I tried to flush the dnscache, and even rebooted but that didn't work. Why does this happens?

here is the entire hosts file

###############       localhost broadcasthost
::1             localhost
fe80::1%lo0     localhost
share|improve this question
this is my hosts file And this is what happen when i ping to – navot volk Oct 9 '11 at 15:53
What happens if you enter host in Terminal? What about dig – Tom Marthenal Oct 10 '11 at 14:55

Since your /etc/hosts is not the problem, the logical conclusion is that your DNS server is responding with that IP address, or you aren't using the DNS server you expect. To verify this, paste this into

host -a

Terminal screenshot with results of above command

share|improve this answer

The hosts file deals with each entry as it comes. For example:

Will point your computer to when you connect to

You will need to comment out the one single line to stop the redirect. For example:


Will point your computer to Apple's servers. After making the changes, you can run the following to clear out your DNS cache:

dscacheutil -flushcache
share|improve this answer
@chsum: If I read the question correctly, the line is commented out but still gets the wrong IP. – patrix Oct 9 '11 at 11:24
I got that too re-reading the question (and edited the original post to be clearer). I would actually like to see the entire hosts file and also the command he used to "clear" it. – user10355 Oct 9 '11 at 11:28
this is my hosts file – navot volk Oct 10 '11 at 6:57
@navotvolk I've verified adding and uncommenting entries in the hosts file. It works without a need to clear your DNS cache. Adding a comment should restore the default IP instantly (upon save). When you edit the file, you are using sudo (e.g., sudo nano /etc/hosts), correct? I can't see anything else that would interfere with it not working. Perhaps a good lesson to not mess with your network (or files in etc) unless you absolutely know what you are doing ;) – user10355 Oct 10 '11 at 7:15
@cksum i did it a lot and everything went well. is there a chance that it stuck some where else in the DNS? i edit it with sudo etc/hosts and still no luck – navot volk Oct 10 '11 at 7:42

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.