1

For some reason my system will not resolve hosts added to /etc/hosts. If I add an entry:

127.0.0.1 somename.dev

It won't resolve. If I add this, however:

127.0.0.1 somename.dev
::1 somename.dev

...it will resolve. Any idea why this is the case? It never was before, but I just reinstalled by system and now its doing this.

Note: I'm using Lion (10.7.5).

3
  • I added a general answer since it's not clear what exactly the host resolution process you are testing - but perhaps you just needed a little background on why OS X is different than other Unix in this regard.
    – bmike
    Feb 4, 2013 at 18:44
  • 1
    I'm using MAMP PRO which modifies the host file. It used to work great until I reinstall Lion. IDK why it suddenly stopped working.
    – user1750
    Feb 4, 2013 at 21:15
  • OK - now that makes sense. I don't know what changed, but I do know, I've stopped messing with DNS and just use xip.io to resolve addresses. It's not perfect for your case, since localhost is a level deeper than picking on IP address on the subnet, but as testing progresses, having other devices get to my development server kills this problem by solving the "other devices" need to connect to my test web server.
    – bmike
    Feb 4, 2013 at 21:21

1 Answer 1

1

You've answered your question by showing that whatever unknown dns resolving you are doing needs both IPv6 and IPv4 entries.

Since OS X has API and a bit more directory services layered on top of the normal DNS system (i.e. it doesn't simply use /etc/hosts like many unix systems), even calls you think might simply check the hosts file for an IPv4 address can and will fail if they don't specify IPv4 only or are using Bonjour/ZeroConf to do address resolution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .