I have a Windows machine called abcd for example and it uses DHCP to receive an IP address ( for example)

When I perform ping -a sometimes I receive abcd as the hostname. Sometimes I receive the FQDN, for example abcd.xxx.yyy.com, which is the preferred and accurate way.

Why do I receive the hostname sometimes, and the FQDN other times? Is this a sign of DNS being corrupt in some way?

  • Is the zone your host is in a Active Directory hosted zone? – Wesley Dec 11 '13 at 5:52
  • Also, will you get the same sketchy results if you use nslookup multiple times? How many DNS servers are in your environment? – Wesley Dec 11 '13 at 6:01

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 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.