ping -a sometimes returns host name and sometimes returns FQDN. Why? Does this mean DNS is corrupt somehow?
ping
is not a name resolution tool. It's an ICMP tool that has some DNS wonkery tacked on. When using ping
as a name resolution troubleshooting tool on a Windows machine you're going to be batted around between responses from NetBIOS, potentially WINS, the hosts file, resolver cache, and (if you're lucky) a DNS server. Your mileage may vary, contents may settle during shipping, product sold by weight not volume, and photo enlarged to show texture.
The preferable method, and indeed the authoritative troubleshooting method for DNS resolution on Windows, would be to use nslookup
to perform reverse lookups. For example, nslookup 172.28.45.5
. You can explicitly set the server that you're querying against, and also scope your return record types down to only PTR records.
If you use nslookup
to perform reverse queries from the same server and you get mixed responses, then something is wrong with DNS in a bad way. If for some reason you really, really want ping -a
to be consistent, then you'll want to flush your resolver cache (ipconfig /flushdns
), disable NetBIOS entirely (feels good, man), make sure nothing is in your hosts file, and then engage in somber prayer before each ping -a
because I still wouldn't trust it 100%.
nslookup
is good and wants to be your friend.