ping -a w.x.y.z
Should resolve the name from the IP address if the reverse lookup zone has been set up properly. If the reverse lookup zone does not have an entry for the record, the -a
will just ping without a name.
nslookup <ip>
Does what you’re looking for. It will tell you the server you’re querying and the result.
For example:
c:>nslookup 192.168.101.39
Server: dns1.local
Address: 192.168.101.24
Name: enigma.local
Address: 192.168.101.39
The trouble with “ping” is that it’s not strictly a name server lookup tool (like nslookup) – for instance if you ping a hostname, it can be resolved to an IP address by a number of methods: DNS lookup, host file lookup, WINS (god forbid) or NetBIOS broadcast. It can also return a potentially out-dated cached result.
The order in which the methods are tried, depends on the clients’ TCP/IP configuration and node type flag:
- B-node (1): Broadcast
- P-node (2): Peer (WINS only)
- M-node (4): Mixed (broadcast, then WINS)
- H-node (8): Hybrid (WINS, then broadcast)
To see the node type of the current computer:
C:>ipconfig /all | find "Node Type"
Node Type . . . . . . . . . . . . : Hybrid
If the resolution method is of no concern, use
ping -a w.x.y.z
or
nslookup w.x.y.z
as you please. If you need to be sure you’re querying your DNS server for the correct name, use nslookup.
See also
- Tech-FAQ: NetBIOS Node Types
- Wikipedia: NetBIOS: Node types
- Microsoft: TCP/IP and NBT configuration parameters for Windows XP (search for “NodeType”)