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!

link|improve this question
1  
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
Apologies, I'm a dev unfamiliar with much of the sysadmin terminology ;-) – alastairs Jul 15 '09 at 17:10
feedback

8 Answers

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

Should resolve the name from the IP address.

link|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
feedback
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
link|improve this answer
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
feedback

nslookup -type=ptr 10.1.x.x

link|improve this answer
feedback

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

link|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
feedback

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
link|improve this answer
feedback

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.

link|improve this answer
feedback

Use nslookup like this:

nslookup -type=PTR  127.0.0.1
link|improve this answer
feedback

Wanted to make this a comment on Peter's accepted post but can't, due to too few points. Apologies if this break some written or unwritten rule.

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

Microsoft online documentation does not specify what methods the ping command uses for name-to-IP resolution and vice versa.

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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