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.

  • 5
    This question should be edited to say that it's not really looking for a DNS-specific solution. The answers that were rejected provide that answer, but the issue was that you actually needed something that looks up NetBIOS names, not DNS. – Barmar Nov 18 '14 at 19:15

12 Answers 12

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.

  • 3
    This worked better than nslookup as the conflicting machine is on another domain. Thanks a lot! – alastairs Jul 15 '09 at 14:53
  • 4
    in nslookup you can also try: set type=PTR <enter> w.x.y.z <enter> – Peter May 10 '13 at 16:18
  • 2
    @abstrask has the most complete answer – vinnyjames Nov 18 '13 at 21:47
  • 7
    This works, but it's actually the wrong tool for the job. Ping is used to measure network latency, it performs name (or IP) lookups just as a side effect of its main purpose. – Massimo Jun 3 '14 at 17:48
  • 3
    @ Massimo - given the constraints of the original question what would you suggest instead? Ping will resolve DNS & netbios names which makes it a good first tool if you just need something quick. – Peter Jun 5 '14 at 16:56
nslookup <ip>

Does what you're looking for. It will tell you the server you're querying and the result.

For example:

Server: dns1.local

Name: enigma.local
  • 7
    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
  • 7
    It failed because nslookup only cares about DNS, while names in Windows can and will be resolved by other means if DNS isn't enough. – Massimo Jun 3 '14 at 17:50

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


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


Use NSLOOKUP with the "-type=ptr" parameter to query the IP address, syntax:

nslookup -type=ptr

Then the "in-addr.arpa" entry is also printed (even when not found), for example:

C:\Users\UserName>nslookup -type=ptr
Server:  MyDnsServerName
Address:  X.X.X.X

Non-authoritative answer:    name = google-public-dns-a.google.com

Compared to the lower fidelity response when using NSLOOKUP on an IP address without the type parameter:

Server:  MyDnsServerName
Address:  X.X.X.X

Name:    google-public-dns-a.google.com
  • 2
    If you want to use interactive nslookup, then at the nslookup prompt type "set q=ptr" and then enter the IP on the next line. If you're crazy old-school like me, then you didn't realize until just now that you no longer have to search for the IP backwards, like "". – Todd Wilcox Sep 4 '14 at 17:22
  • 4
    No need to -type=ptr or set q=ptr at all - nslookup is clever enough to regonise an IP address and do a reverse lookup instead of forward – abstrask Sep 4 '14 at 21:04
  • 1
    Actually the -type=ptr is necessary for proper reverse lookup checking because it prints a more accurate result than nslookup with just an IP address. It's much better to have the actual in-addr.arpa entry printed (also when not found) to assist with debugging or just clarify what is going on. – Tony Wall Mar 14 '18 at 10:45

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

  • 2
    Good point that not all hosts will have a PTR record created for them – Rowland Shaw Jul 16 '09 at 7:51
  • 2
    Note that nslookup on Linux, BSD, and Windows do different things and are different programs. – Good Person Dec 27 '12 at 18:35
  • 1
    If no PTR exists, you can whois the IP for more info..... prob doesnt ship with windoze either lol – nandoP Jun 3 '14 at 18:00

Use nslookup like this:

nslookup -type=PTR

You can use the standard NSLOOKUP command:


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


nslookup will do reverse lookups in Windows.

C:\>nslookup star.slashdot.org

Server:  my-dns-server

Name:    star.slashdot.org


Server:  my-dns-server

Name:    star.slashdot.org

Under Windows....

Standard ping does NOT return host name of IP address

NSLookup can be used to find this info, if DNS is setup properly

Procedure as follows:

Open DOS prompt


set type=ptr


Results will be shown with reverse DNS server address, and host name


9 answers and no one said how to reverse lookup with dig? Its the best

dig -x w.x.y.z

Also, you can add "+short" for use in bash loops, scripts, etc.... forward or reverse :)

  • 3
    No one has mentioned dig as it does not ship with Windows. The OP's question even indicates this. – jscott Jun 3 '14 at 17:39
  • 2
    dig is generally the best choice DNS troubleshooting, though. I think there is definitely some value to suggesting a better tool even though it does not ship with Windows. (Available in the Windows builds at isc.org/software/bind) – Håkan Lindqvist Jun 3 '14 at 17:53

There is yet another way. Reverse the IP address and use nslookup

nslookup -type=PTR

to resolve the address

  • 1
    You would have to do nslookup -type=PTR for it to actually work, though. – Håkan Lindqvist Oct 14 '16 at 5:56

If nslookup, dig, host does not exists, try this:

getent hosts google.de | awk '{ print $1 }'

Works e.g. on docker AWS ec2 instances (which really don't have anything installed)

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.