I'm using dnsmasq to route requests to .lh hosts to my vagrant server currently running on on Mac OSX 10.6.

scutil --dns returns the correct resolver info:

resolver #9
  domain : lh
  nameserver[0] :

But ping (and also the browser) is unable to resolve the domain:

ping root.blah.lh
ping: cannot resolve root.blah.lh: Unknown host

I added to my list of DNS servers in my network settings, and it's sitting at the top of the list, above - seems to be getting completely ignored.

sudo killall -HUP mDNSResponder and sudo dscacheutil -flushcache apparently have no effect.

How can I get .lh hosts to resolve to correctly?

(the stuff below this line is historical, and has been moved here after Alan Shutko's answer indicating that nslookup is not a useful analysis tool in this case)

nslookup is also unable to resolve the domain:

nslookup blah.lh

** server can't find blah.lh: NXDOMAIN

I also tried adding to my DNS server list in network settings (at the top), which produces a lookup on local, viz:

nslookup blah.lh

Name:   blah.lh

1 Answer 1


I'm assuming you are using Mac OS X, since you mention scutil. nslookup doesn't use the same mechanisms as the rest of the OS:

From man nslookup:


The nslookup command does not use the host name and address resolution or the DNS query routing mechanisms used by other processes running on Mac OS X. The results of name or address queries printed by nslookup may differ from those found by other processes that use the Mac OS X native name and address resolution mechanisms. The results of DNS queries may also differ from queries that use the Mac OS X DNS routing library.

  • I see the same notice in man host and dig. Do you know if there is a command line utility that does not carry this restriction?
    – AllInOne
    Commented Feb 26, 2013 at 23:08
  • dscacheutil -q host blah.lh might work. If it does, I'll update my answer. Do other commands (notably Safari) work? The command-line tools probably use /etc/resolv.conf Commented Feb 26, 2013 at 23:45
  • I am using OSX, yes - thanks, I'll update my question. Using other methods doesn't work either, ping blah.lh returns ping: cannot resolve root.blah.lh: Unknown host and attempts through the browser return a server not found message. I don't know if the dscacheutil -q host blah.lh was for me or the other guy, but when I ran it just in case it gave me a list of hosts from my /etc/hosts file.
    – hollsk
    Commented Feb 27, 2013 at 20:40

You must log in to answer this question.

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