DNS name resolution not working consistently with ssh

I've been having an annoying problem on my OS X 10.6.2 box, where ssh name resolution does not work.

nslookup will always resolve correctly, but ping does not. Is it that ssh does not use DNS on OS X?

I can add a host (that is already configured in DNS) to my /etc/hosts file and ssh (or ping) will work, if I then comment that entry out, ssh and/or ping will stop working.

Here is my resolv.conf file.

#
search lab.steinhouse.com
nameserver 10.32.6.20
nameserver 10.32.6.21

Here is some output from nslookup and ping:

tsmacpro:etc toddstein$ nslookup labvma01
Server: 10.32.6.20
Address: 10.32.6.20#53

Name: labvma01.lab.steinhouse.com
Address: 10.32.6.29

tsmacpro:etc toddstein$ ping labvma01
ping: cannot resolve labvma01: Unknown host
tsmacpro:etc toddstein$

Mac Pro, Mac OS X (10.6.2)

Posted on Mar 10, 2010 9:20 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 7, 2010 9:02 AM

I have had a similar problem, where after several days of uptime, my local name resolution stops working. My primary and secondary name servers (running on Linux) are onsite. I have a tertiary DNS server offsite, which my MacBook Pro does resolve names (read: external names resolve, local names do not).

By using Wireshark, I was able to see that only the tertiary DNS server was being queried.

I believe there is a problem in 10.6.2 mDNSResponder.

I have found that if I restart mDNSResponder (sudo kill <pid of mDNSResponder>) my local name resolution is restored.

I hope this helps,

Craig...
6 replies
Question marked as Top-ranking reply

Apr 7, 2010 9:02 AM in response to Todd Stein

I have had a similar problem, where after several days of uptime, my local name resolution stops working. My primary and secondary name servers (running on Linux) are onsite. I have a tertiary DNS server offsite, which my MacBook Pro does resolve names (read: external names resolve, local names do not).

By using Wireshark, I was able to see that only the tertiary DNS server was being queried.

I believe there is a problem in 10.6.2 mDNSResponder.

I have found that if I restart mDNSResponder (sudo kill <pid of mDNSResponder>) my local name resolution is restored.

I hope this helps,

Craig...

Mar 10, 2010 4:36 PM in response to Todd Stein

Mac OS X does not use DNS the same way a BIND-compiled utility like nslookup does, so the answers you receive from nslookup may be different from those the OS obtains.

There is also an issue where the Mac OS X resolver (mDNSResponder) may "switch" the order of hosts it uses for DNS service where utilities like nslookup and those compiled with BIND honor them.

So in your example:

nameserver 10.32.6.20
nameserver 10.32.6.21


I suspect that the DNS server at 10.32.6.20 can resolve your host but the one at 10.32.6.21, for whatever reason, cannot.

Mar 11, 2010 5:12 AM in response to Dogcow-Moof

So the second DNS server (10.32.6.21) is a "secondary" server that is synced with the first. I did just recently clean-up any un-removed PTR table entires etc and knew that the particular nodes labvma01, labvma02, labvam03 were in both DNS servers... However, I decided to show you the nslookup output and sure enough the secondary was empty... It is a windows box, so I applied a little microsoft troubleshooting and gave it a good three finger salute. Now all the records are in sync again and the symptoms are gone...

I'm not certain that the problem is solved, because this has happened before. I'll begin to monitor my dns better and watch for this in the future...

thanks for the help

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

DNS name resolution not working consistently with ssh

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.