Skip to main content
WebTools

Reverse DNS (PTR) records and why your mail server needs one

What reverse DNS is, why receiving mail servers check it, and how to get a correct PTR record from whoever owns your IP address.

Published

Illustration of a mail server and a globe linked by two curved arrows forming a loop, with a magnifying glass.
On this page

The short answer: reverse DNS turns an IP address back into a host name, using a PTR record. Receiving mail servers check that your sending server's IP address has a PTR record, and that the name it gives points back to the same IP address. Gmail requires this for all senders. You can't set the PTR record in your own domain's DNS: it's set by whoever owns the IP address, usually your hosting company or internet provider, so you ask them to do it.

This guide explains how reverse DNS works, why mail servers care, and how to check and fix it.

Forward and reverse DNS

Normal, or forward, DNS answers "what is the address of mail.example.com?" with an A record (IPv4) or AAAA record (IPv6).

Reverse DNS answers the opposite question: "what is the name of 192.0.2.25?" The answer is a PTR record, stored in a special part of DNS that's organised by IP address rather than by domain name. For IPv4 the address is reversed and placed under in-addr.arpa:

25.2.0.192.in-addr.arpa.  PTR  mail.example.com.

IPv6 works the same way under ip6.arpa, with each hexadecimal digit of the address reversed.

Diagram: the IP address 192.0.2.25 has a PTR record giving mail.example.com, and mail.example.com has an A record giving 192.0.2.25 again. The two arrows form a loop labelled forward-confirmed reverse DNS.
Forward-confirmed reverse DNS: the PTR name points back to the same address.

Why mail servers check it

Anyone who controls an IP address can make its PTR record say anything. So receivers don't trust the PTR name on its own. They do a second, forward lookup on that name and check that it leads back to the same address. This is called forward-confirmed reverse DNS (FCrDNS).

The DNS operations guidance in RFC 1912 has long advised that PTR and A records should match. A server that passes this check is more likely to be a properly managed mail server. Home broadband connections, hijacked devices and short-lived cloud servers often have no PTR record, or a generic one like host-192-0-2-25.isp.example.

Google's email sender guidelines say all senders must have valid forward and reverse DNS records for their sending IP addresses. Mail that fails is often rejected with an error that begins 550-5.7.25. Many other providers also reject or downgrade mail from servers without reverse DNS.

Try it now

Reverse DNS

Find the PTR host name for an IPv4 or IPv6 address, and check that the name points back to the same address (forward-confirmed reverse DNS).

Open the tool: Reverse DNS

How to check your mail server's reverse DNS

  1. Find the IP address your mail leaves from. Look at the headers of a message you've sent to an external mailbox: the first Received: line added by the receiving server shows the connecting IP address. Or check your MX records, if the same server sends and receives.
  2. Look up the PTR record for that IP address with the Reverse DNS tool. It shows the name and whether that name points back to the same address.
  3. Check the name makes sense. Ideally it's a name in your own domain, such as mail.yourdomain.com, and matches the name your server announces when it connects (the HELO or EHLO name).

Try it now

MX Lookup

Find which mail servers receive email for a domain: MX records in priority order, each host's IPv4 and IPv6 addresses, null MX and common mistakes.

Open the tool: MX Lookup

How to fix a missing or wrong PTR record

Because PTR records belong to the owner of the IP address, the fix depends on who that is.

Hosting company, VPS or cloud provider

Most let you set reverse DNS yourself in their control panel, often under the server's network or IP settings, labelled "reverse DNS" or "rDNS". Some need a support ticket. Cloud providers sometimes require you to unblock outgoing mail first.

Business broadband or leased line

Ask your internet provider. Many will set a PTR record for a static IP address on request. Dynamic home connections usually can't have custom reverse DNS, and most receivers won't accept mail sent directly from them anyway.

The order to do things in

  1. Choose the host name, for example mail.yourdomain.com.
  2. Create the A record (and AAAA record if you send over IPv6) for that name in your own DNS, pointing to the server's IP address.
  3. Ask the IP owner to set the PTR record for the address to that name.
  4. Set your mail server's HELO/EHLO name to the same host name.
  5. Check again with the Reverse DNS tool once the change has spread through DNS.

What a good PTR name looks like

PTR nameGood for mail?Why
mail.yourdomain.comYesYour own domain, points back to the same IP, matches HELO.
server123.host.exampleUsually worksValid and forward-confirmed, but doesn't identify you. Fine for some receivers.
192-0-2-25.dynamic.isp.exampleNoLooks like a home or dynamic connection. Often treated as spam.
No PTR recordNoMany receivers reject the connection outright.

Reverse DNS and your other records

Reverse DNS is one of several checks a receiver makes. Make sure the same IP address is also covered by your SPF record, that mail is signed with DKIM, and that your domain has a DMARC record. A correct PTR record on its own won't get mail delivered if SPF and DKIM fail.

It's also worth checking who owns your sending IP address and where it is. The IP Lookup tool shows the network, organisation and approximate location. If it's not the provider you expected, mail may be leaving from a different server than you think.

Reading a reverse DNS bounce

When a receiver rejects mail because of reverse DNS, the bounce message usually says so. Gmail's message starts with 550-5.7.25 and mentions that the sending IP address doesn't have a PTR record, or that the PTR record doesn't match. Other providers use wording such as "client host rejected: cannot find your hostname" or "reverse DNS lookup failed".

The bounce normally includes the IP address that connected. That is the address to look up, and it isn't always the one you expect: a server with several addresses, or one that has started sending over IPv6, may be using a different one. Check that exact address with the Reverse DNS tool, then follow the fix steps above.

Common questions

Can I add a PTR record in my domain's DNS?

No. PTR records live in a part of DNS controlled by whoever holds the IP address block. Adding a PTR-type record to your own domain's zone has no effect on reverse lookups. Ask your host or provider instead.

Can one IP address have several PTR records?

It's technically possible, but it causes problems: receivers may pick any of them, and some reject the connection if the answer isn't clear. Use one PTR record per sending address.

Does my website's server need reverse DNS?

Only if it sends email directly, for example contact-form messages or password resets. Many websites send through an email service instead, which handles reverse DNS for its own servers. Web browsers don't check reverse DNS.

How long does a PTR change take?

Once the provider has made it, the change appears when cached answers expire, often within an hour. Some providers apply changes in batches, so allow a day before chasing.

Checklist

  • You know every IP address, IPv4 and IPv6, that your mail is sent from.
  • Each one has a PTR record with a sensible, specific host name.
  • That host name has an A or AAAA record pointing back to the same address.
  • Your mail server's HELO/EHLO name matches.
  • The IP address is in your SPF record, and DKIM and DMARC are set up.
  • Reverse DNS

    Find the PTR host name for an IPv4 or IPv6 address, and check that the name points back to the same address (forward-confirmed reverse DNS).

  • MX Lookup

    Find which mail servers receive email for a domain: MX records in priority order, each host's IPv4 and IPv6 addresses, null MX and common mistakes.

  • IP Lookup

    Look up an IPv4 or IPv6 address: the network (ASN) and organisation it belongs to, its approximate country, reverse DNS and the address type.