macosdnsosx-maverickshostsicann

symlinked hosts file ignored by OS X; dev domains redirect to 127.0.53.53


I'm aware that various domains are now redirected to 127.0.53.53 by ICANN to alert people to potential current/future name collisions.

However, I assumed any entries in my hosts file, for, for example, a development site running on Vagrant using a .dev domain, would still be honoured and have priority.

Currently I've a situation on a Mac (OSX 10.9.5) where most browsers (Safari 7.1.2, Firefox 35, Chrome Canary) are attempting to connect to 127.0.53.53 regardless. The only way I can get it to work is to change the TLD to something else.

Weirdly in Chrome stable 39.0.2171.95, which is my main browser, the .dev hosts file entries still load OK at present.

I've tried various things, restarting apps, restarting the VM, simplifying the hosts file / looking for errors, flushing the cache – dscacheutil -flushcache etc. Hosts entries with other TLDs (or none) still work fine.

Fixable / is there anything I've forgotten?


Solution

  • The reason was I had my /etc/hosts file symlinked (to Dropbox) and having read this answer, it turns out you must have an ordinary local file if you want to override anything that already has a valid DNS record (which ICANN's 127.0.53.53 is) – if the file is a symlink apparently it doesn't get checked first.

    Have verified that removing the symlink makes it work again. Can't explain why Chrome was different though.