I'm having an issue which recurs every few days, whereby ping cannot resolve a hostname on my LAN (but nslookup is able to). This is on OSX 10.9.2 (latest).

The machine in this case is called 'solo', although it can occur with other hostnames at different times. There have been no changes to my network infrastructure, and I know from experience that it will fix itself after a period of time (although what occurs to fix it is unclear).

I understand ping will refer to local resources before finally making a dns request, but I have nothing in /etc/hosts and I've flushed my local dns cache (aswell as the server cache)

Can anyone explain this phenomenon?

ping cant resolve 'solo'

[carpii@imac:~]$ ping solo
ping: cannot resolve solo: Unknown host

flush local dns cache for good measure

[carpii@imac:~]$ flushdns````

ping 'creek' which is my dns server

[carpii@imac:~]$ ping creek
PING creek.carpnet ( 56 data bytes
64 bytes from icmp_seq=0 ttl=128 time=2.640 ms
64 bytes from icmp_seq=1 ttl=128 time=2.702 ms

nslookup CAN resolve solo, and using correct dns server

[carpii@imac:~]$ nslookup solo
Name:   solo.carpnet

ping 'solo' by ip

[carpii@imac:~]$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=6.294 ms
64 bytes from icmp_seq=1 ttl=64 time=2.801 ms

but still i cant ping by hostname

[carpii@imac:~]$ ping solo
ping: cannot resolve solo: Unknown host

even with dns suffix

[carpii@imac:~]$ ping solo.carpnet
ping: cannot resolve solo.carpnet: Unknown host

ping another LAN machine served by same dns server

[carpii@imac:~]$ ping nelson
PING nelson.carpnet ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=6.297 ms
64 bytes from icmp_seq=1 ttl=64 time=2.712 ms

[update: can ssh into another lan host, and able to resolve solo from there]

[carpii@imac:~]$ ssh node@node
/www/nodechat> ping solo
PING solo.carpnet ( 56(84) bytes of data.
64 bytes from solo.carpnet ( icmp_seq=1 ttl=64 time=2.02 ms

closed as off-topic by MDMarra, EEAA, Jacob, Scott Pack, Katherine Villyard Mar 23 '14 at 17:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – MDMarra, Jacob, Scott Pack
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Is the client configured to use only as its DNS server, or does it also have other DNS servers? Also, what does the flushdns command do (it's not standard on OS X)? – Gordon Davisson Mar 23 '14 at 17:06
  • Thanks, you helped me look into this further as I had been focusing purely on the dns server config. It turns out it was my DHCP server at fault, which was telling client to use a secondary DNS of – carpii Mar 24 '14 at 23:50
  • 2
    No idea what is causing this but I always do a sudo ifconfig en0 down && sudo ifconfig en0 up – null Sep 9 '14 at 17:47
  • Try ping solo.local – inspectorG4dget Jun 9 '17 at 4:36