Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a built-in command line tool that will do reverse DNS look-ups in Windows? I.e., something like <toolname> w.x.y.z => mycomputername

I've tried:

  • nslookup: seems to be forward look-up only.
  • host: doesn't exist
  • dig: also doesn't exist.

I found "What's the reverse DNS command line utility?" via a search, but this is specifically looking for a *nix utility, not a Windows one.

Thanks a lot!

share|improve this question
2  
This is a bit of paradoxical question. You cant have a "built-in command line tool", you either have a "built-in command" OR a "command line utility", you can have both at the same time also but for sure, ping nslookup, dig and host are all command-line tool's which are not built-in. Unless your using busybox as your shell, but then for that matter the entire system is built in ;) – RandomNickName42 Jul 15 '09 at 15:12
1  
Apologies, I'm a dev unfamiliar with much of the sysadmin terminology ;-) – alastairs Jul 15 '09 at 17:10

8 Answers

up vote 51 down vote accepted
ping -a w.x.y.z

Should resolve the name from the IP address.

share|improve this answer
This worked better than nslookup as the conflicting machine is on another domain. Thanks a lot! – alastairs Jul 15 '09 at 14:53
Worked like a charm – Jacques Oct 8 '12 at 8:23
This doesn't work for me, maybe because I'm on the same domain. – Kev Apr 16 at 13:44
in nslookup you can also try: set type=PTR <enter> w.x.y.z <enter> – Peter May 10 at 16:18
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
share|improve this answer
1  
This was failing with a message "<DC> can't find w.x.y.z: Non-existent domain" and I couldn't work out why. I tried @Peter's answer, and found the conflicting machine was on another domain. – alastairs Jul 15 '09 at 14:52

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

share|improve this answer

nslookup -type=ptr 10.1.x.x

share|improve this answer

nslookup will do reverse DNS on windows just as it can do it on linux.

Of course, there isn't a reverse entry for every ip address

share|improve this answer
Good point that not all hosts will have a PTR record created for them – Rowland Shaw Jul 16 '09 at 7:51
Note that nslookup on Linux, BSD, and Windows do different things and are different programs. – Good Person Dec 27 '12 at 18:35

Use nslookup like this:

nslookup -type=PTR  127.0.0.1
share|improve this answer

nslookup will do reverse lookups in Windows.

C:\>nslookup star.slashdot.org

Server:  my-dns-server
Address:  10.242.0.1

Name:    star.slashdot.org
Address:  216.34.181.48

C:\>nslookup 216.34.181.48

Server:  my-dns-server
Address:  10.242.0.1

Name:    star.slashdot.org
Address:  216.34.181.48
share|improve this answer

You can use the standard NSLOOKUP command:

nslookup 123.123.123.123

In order to get a result there has to be a PTR record registered for the IP address in question.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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