Reverse DNS lookup in Windows, Linux & macOS

Quick answer

A reverse DNS lookup turns an IP address back into its hostname (the PTR record). You can do it from any terminal in a few seconds. Here are the exact commands for each operating system — and a no-install option.

The no-install way

If you just want the answer without opening a terminal, paste the IP into our Reverse DNS tool — it returns the PTR hostname for any IPv4 address instantly. For checking many IPs at once, the Bulk IP Audit tool resolves reverse DNS across a whole list.

Windows (Command Prompt or PowerShell)

Use nslookup followed by the IP:

nslookup 8.8.8.8

It returns the hostname under the “Name” field. PowerShell users can also run Resolve-DnsName 8.8.8.8 for the same result with cleaner output.

Linux

The modern tool is dig with the -x flag, which does the reverse lookup for you:

dig -x 8.8.8.8 +short

The +short trims the output to just the hostname. The older host 8.8.8.8 and nslookup 8.8.8.8 also work on most distributions.

macOS

macOS ships with the same tools as Linux. Open Terminal and use either:

dig -x 8.8.8.8 +short
host 8.8.8.8

What “no PTR record” means

If a lookup returns nothing or an NXDOMAIN, the IP simply has no PTR record assigned. That’s normal for many residential IPs but a problem for a mail server — see what a PTR record is and why it matters.

Related: Reverse DNS tool · Tracing reverse mapping with nslookup and dig -x

0 IPs logged or stored
2 stacks shown (v4 & v6)
8+ diagnostic tools
lookups, always free