Skip to content

How to set up reverse DNS (PTR) for your mail server

Security1 min readFixes check email-reverse-dns

Reverse DNS maps a mail server's IP back to a name. Gmail and Yahoo expect every sending IP to have a PTR record whose name resolves back to the same IP.

Check your own domain

Our DMARC checker (email & DNS) tool runs this check and writes the record to add, free, in seconds.

Check your domain

What it is

Reverse DNS is the opposite of a normal lookup: it starts from an IP address and returns a host name, through a PTR record. Receiving mail servers use it to check that the server connecting to them is a real, configured mail server and not a hijacked home computer, which almost never has matching reverse DNS.

The check that matters is forward-confirmed reverse DNS: the IP's PTR record names a host, and that host's A record points back to the same IP. getReport checks this for every IP your domain controls (your own MX hosts and single addresses in your SPF record). Hosted mail providers set it up for their own servers, so their addresses are skipped. Your setup is OK when every one of your own mail IPs passes both lookups.

What a passing site looks like

  • Every mail server IP has reverse DNS that points back to itwarning · −4 ptseffort M

Reverse DNS (PTR)

Why it matters. Gmail and Yahoo require sending IPs to have valid forward and reverse DNS: a PTR record for the IP, naming a host that resolves back to that IP. Without it, mail is more likely to be rejected or filtered as spam, because botnets rarely have it.

How to fix it.
  1. Ask whoever owns the IP to set its PTR record; that is your hosting company or cloud provider (it is set in their panel, not in your own DNS zone). Use the name the server introduces itself with, such as mail.yourdomain.com.
  2. Make sure that name has an A record pointing back to the same IP, so the reverse and forward lookups agree.

Questions people ask

Who sets the PTR record for my IP address?

The owner of the IP, not the owner of the domain. PTR records live in the reverse zone of the address block, which belongs to your hosting company, cloud provider or ISP. Most VPS and cloud panels have a reverse DNS or PTR field next to the server's IP; for dedicated or office lines, ask the provider's support.

What should my mail server's PTR record say?

A name that resolves back to the same IP and matches what the server announces itself as, for example mail.example.com. Avoid generic provider names such as ip-203-0-113-7.provider.net: they pass the forward check but look like dynamic addresses to spam filters.

How do I check the PTR record of an IP?

Run dig -x 203.0.113.7 on macOS or Linux, or nslookup 203.0.113.7 on Windows, to see the name the IP points to. Then look up that name and confirm its A record returns the same IP. getReport does both steps for each of your mail server IPs at once.

Filed under Security. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.