5

DNS resolution appears to be inconsistent across OS X for no reason I can fathom.

$ ping example
PING example.co.uk (80.94.32.224): 56 data bytes
64 bytes from 80.94.32.224: icmp_seq=0 ttl=56 time=62.077 ms

Yet:

$ nslookup example
Server:     10.20.20.1
Address:    10.20.20.1#53

** server can't find example: NXDOMAIN

http://example/ resolves in Firefox, yet:

$ dig example

fails. I am pointing at my router's default DNS (10.20.20.1, as above). Pointing to other DNS servers does not appear to alter the above behaviour.

Zypher
  • 36,995
  • 5
  • 52
  • 95
jnic
  • 153
  • 3

3 Answers3

3

Check to see if your search domain is set. I just tried it (with my search domain set); ping and nslookup work. As does Safari and Firefox.

However, dig does not by default on MacOS X 10.6 use the search domain. To do that do:

dig +search example

And that will work correctly

tegbains
  • 1,956
  • 12
  • 27
  • I'm reasonably sure there's an issue with search domains in Snow Leopard. Firefox, Chrome, and Safari all have issues with URLs like http://intranet/ post-SL-upgrade for me. SL is the only variable, and the others who've upgraded @ work report the same thing. It's consistently inconsistent, too - some domains work, some don't, and the ones that do or don't are the same on different computers. – ceejayoz Jan 23 '10 at 04:03
  • Have accepted this solution, as manually setting the search domain caused the problem to disappear. This is the case even when the manually-set domain is identical to that already being set by the router! – jnic Feb 03 '10 at 12:23
0

Did you just upgraded to snow leopard? I had very similar issues. Resolved by removing all references to saved networks in the network preferences + login/keychain databases. Basically, you have to reset your entire name resolving subsystem.

lorenzog
  • 2,719
  • 1
  • 18
  • 24
-2

The host is resolved via files or via other name service. See if it is in hosts. If not check /etc/nsswitch.conf file.

grep example.com /etc/hosts
grep hosts /etc/nsswitch.conf
Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80