Guides · DNS · Updated

Reverse DNS lookup: what a PTR record is and how to check one

A reverse DNS lookup starts with an IP address and returns the hostname published for it, in a PTR record. You can run one online, or with nslookup, dig or host. Mail servers depend on it more than anything else.

Run a reverse lookup

Enter an IPv4 or IPv6 address:

The result lists each hostname and whether it resolves back to the address you entered.

How it works

DNS can only look up names, so an address is first turned into a name. For IPv4 the four numbers are reversed and .in-addr.arpa is added; for IPv6 the 32 hex digits are reversed one by one under .ip6.arpa.

8.8.4.4        →  4.4.8.8.in-addr.arpa      PTR  dns.google
203.0.113.10   →  10.113.0.203.in-addr.arpa PTR  mail.example.com

The PTR record lives in a zone controlled by whoever owns the address block, which is why you can't add one in your own domain's DNS.

From the command line

# Windows, macOS and Linux
nslookup 8.8.8.8

# macOS and Linux
dig -x 8.8.8.8 +short
host 8.8.8.8

# Windows PowerShell
Resolve-DnsName 8.8.8.8

All of them send the same PTR query. dig -x builds the in-addr.arpa name for you. For other record types see DNS record types explained.

Why mail servers care: forward-confirmed reverse DNS

Anyone can write any name into a PTR record they control, so a PTR record alone proves little. The check that matters is the round trip: the address has a PTR name, and that name has an A or AAAA record pointing back at the same address. This is called forward-confirmed reverse DNS. Receiving mail servers often penalise or reject mail from addresses that fail it.

  • The PTR name should be the name your mail server announces in its greeting (its HELO or EHLO name).
  • That name needs an A (and AAAA) record with the same IP address.
  • Keep to one PTR record per address.

This is separate from SPF, DKIM and DMARC, which prove who is allowed to send for a domain. Good mail setups have both.

How to set or change a PTR record

  1. Ask who owns the address block. For a server it's your hosting provider; for a home or office line it's your internet provider.
  2. Open their control panel, which often has a "reverse DNS" field next to the server's IP, or ask their support.
  3. Create the matching A record in your own DNS first, so the name resolves to the address.
  4. Run the lookup again. Changes follow the record's TTL.

Home internet connections rarely allow custom PTR records. If you need to send mail from a fixed address, use a mail service or a hosting provider that lets you set one.

Reading the result

  • A short, meaningful name (such as mail.example.com): set deliberately.
  • A name built from the address (such as 203-0-113-10.isp.example.net): an automatic default from the provider.
  • No record: nothing is published. Normal for most home users, a problem for mail servers.

To see who owns the address and where it is, use the IP lookup. To check whether it's on a spam blocklist, use the blacklist checker.

Frequently asked questions

What is a reverse DNS lookup?

It finds the hostname recorded for an IP address, using a PTR record. A normal DNS lookup goes from name to address; a reverse lookup goes the other way.

How do I do a reverse DNS lookup on Windows, Linux or macOS?

On Windows use nslookup 203.0.113.10 or Resolve-DnsName in PowerShell. On Linux and macOS use dig -x 203.0.113.10 or host 203.0.113.10. All of them send the same PTR query.

Who can set a PTR record?

Whoever controls the IP address block, usually your internet or hosting provider. You normally set it through their control panel or by asking support, not in your own domain's DNS zone.

Do I need a PTR record for a mail server?

Yes. Many receiving servers refuse or downgrade mail from an address with no PTR record, or whose PTR name does not resolve back to the same address.

Why does my reverse lookup return a long name I do not recognise?

Providers often assign automatic names built from the address, such as 203-0-113-10.isp.example.net. They are valid, but they say nothing about who is using the address.