Skip to content
RIPE NCC member · Local Internet RegistryCall us on 020 3318 3449sales@hosting-telecom.uk

PTR records: reverse DNS

Domains and DNS3 min read

What a PTR record is and why a mail server needs one, how to check it with dig and nslookup, and how to get a PTR record for your server’s IP address.

Contents

An ordinary DNS record answers the question “what IP address does this name have?”: mail.example.co.uk → 203.0.113.10. A PTR record works the other way round: “what name does this IP address have?”: 203.0.113.10 → mail.example.co.uk. It is also known as a reverse record or rDNS.

Why you need one

Above all, for email. Mail providers look at the PTR record of the address a message came from. If there is no record, or it contains a generic name such as 203-0-113-10.provider.net, the message is more likely to end up in spam or to be rejected altogether. Gmail requires a PTR record from everyone who sends it email.

The name from the PTR record is also visible in traceroute, in server logs and when an IP address is looked up — it makes it clearer whose address it is.

How to check

dig -x 203.0.113.10 +short

On Windows, use nslookup 203.0.113.10. The answer will contain a name, for example mail.example.co.uk. An empty answer or NXDOMAIN means there is no record.

A correct PTR record passes a “there and back” check: the name in it points, through an A record, to the same address.

$ dig +short mail.example.co.uk A
203.0.113.10

Mail servers check exactly this match. If the name leads to a different address, or nowhere, it is almost as bad for them as having no record at all.

Why you cannot add it to your domain’s DNS

A PTR record is not stored in your domain’s zone, but in the reverse zone of the IP address — one that looks like 10.113.0.203.in-addr.arpa. That zone belongs to whoever the addresses are allocated to. So you cannot add a PTR record in your domain’s DNS editor: only the owner of the IP addresses — your provider or host — can change it.

A PTR record for your server’s IP address with us

For the IP address of a cloud server, we set the PTR record on request. Contact us through the contact form with the server’s IP address and the name you want to set, for example mail.example.co.uk.

Before you make the request, create an A record for that name pointing to the server’s IP address — otherwise the record will not pass the “there and back” check. Add it in your domain’s DNS zone. If your domain is on our hosting, you can do this in cPanel (DNS records in cPanel).

For a mail server, use the same name that it announces when it sends email (HELO): in Postfix, this is myhostname.

On our hosting you do not need to do anything: we have set up the PTR records for the hosting servers ourselves.

If you have your own IP addresses

If you have your own address block, you can delegate the reverse zone to your own DNS servers and change PTR records yourself. If you do not have your own addresses but need them, get in touch through the contact form and we can discuss IPv4 and IPv6 addresses and help with the setup.

Didn’t find the answer? Ask our support team — we’ll help.

Choose which cookies we may use. You can change your mind at any time with the “Cookie settings” link at the bottom of every page.

Necessary

Always active

They keep the site secure and remember your cookie choice. They don’t identify you.

Google Analytics counts visits and shows which pages people find useful, so we can improve the site. Which cookies