In Mac Os when you edit the /etc/hosts file either by adding a new entry or changing an existing one, the changes are not reflected immediately.
So you think:
- This is simple! All I have to do is close the Terminal and open a new one!
And then you realize it did NOT work.
Since you are a smart person, you might think:
- Well, all I have to do is log out and back in! Still simple!
Only to realize again that it did NOT work.
To make it work it is necessary to flush the DNS Cache (or restart the machine, or course). You achieve this by sending this command to Terminal:$ dscacheutil -flushcache