6

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 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: icmp_seq=0 ttl=128 time=2.640 ms
64 bytes from 192.168.1.2: icmp_seq=1 ttl=128 time=2.702 ms

nslookup CAN resolve solo, and using correct dns server

[carpii@imac:~]$ nslookup solo
Server:     192.168.1.2
Address:    192.168.1.2#53
Name:   solo.carpnet
Address: 192.168.1.79

ping 'solo' by ip

[carpii@imac:~]$ ping 192.168.1.79
PING 192.168.1.79 (192.168.1.79): 56 data bytes
64 bytes from 192.168.1.79: icmp_seq=0 ttl=64 time=6.294 ms
64 bytes from 192.168.1.79: 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 (192.168.1.66): 56 data bytes
64 bytes from 192.168.1.66: icmp_seq=0 ttl=64 time=6.297 ms
64 bytes from 192.168.1.66: 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 (192.168.1.79) 56(84) bytes of data.
64 bytes from solo.carpnet (192.168.1.79): icmp_seq=1 ttl=64 time=2.02 ms
5
  • 1
    Is the client configured to use only 192.168.1.2 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)? Mar 23, 2014 at 17:06
  • 1
    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 8.8.8.8
    – carpii
    Mar 24, 2014 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, 2014 at 17:47
  • Try ping solo.local Jun 9, 2017 at 4:36
  • @carpii Six years later and I had the exact same issue. Added 8.8.8.8 as secondary DNS, but the clients used it as primary though.
    – andreas
    Oct 8, 2020 at 18:40

0

Browse other questions tagged .