// how to fix
How to set reverse DNS (PTR) at your hosting company
The PTR record of your server IP is set by your hosting company, not in your domain DNS. Here are the general steps at OVH, Hetzner, Scaleway, AWS and DigitalOcean.
What it means
Reverse DNS turns your server's IP address back into a name, such as mail.yourdomain.com. The record is called a PTR. Unlike your other DNS records, it is not managed where you bought your domain. It is managed by the company that owns the IP address: your VPS or server provider.
Why it matters
Gmail, Outlook and many other receivers reject or filter email from servers whose IP has no PTR, or a PTR that does not point back to the same IP. A default name like vps-12345.provider.example also looks less trustworthy than a name on your own domain.
How to check
Send an email from your server to your test address on the home page (/). The Reverse DNS section shows the sending IP, its PTR name and whether that name points back to the IP.
How to fix it
Step 1: create the forward record first
At your DNS provider, create an A record (and an AAAA record if you send over IPv6) for the name you want:
mail.yourdomain.com A 203.0.113.10
Most providers refuse to set a PTR for a name that does not already point to the IP, so do this first and wait until it is visible.
Step 2: set the PTR at your provider
Menus change often, so look for words like "Reverse DNS", "rDNS" or "PTR" in the settings of your server or of its IP address.
- OVH: in the control panel, open the IP section, find your server IP and edit its reverse.
- Hetzner: in the Cloud console or Robot panel, open the server or IP settings and edit the reverse DNS entry for the IPv4 and IPv6 addresses.
- Scaleway: in the console, open the instance or its flexible IP and edit the reverse DNS.
- AWS: use an Elastic IP (the default public IP cannot get a custom PTR). Reverse DNS is set on the Elastic IP. AWS also limits port 25 by default; ask them to remove the limit.
- DigitalOcean: the PTR is created from the Droplet's name. Rename the Droplet to exactly
mail.yourdomain.com. - Other providers or home connections: if there is no field, open a support ticket asking for "a PTR record for IP 203.0.113.10 set to mail.yourdomain.com". Many home internet providers do not allow it at all; use a relay service in that case.
Step 3: use the same name everywhere
Configure your mail server to introduce itself with this same name. In Postfix:
myhostname = mail.yourdomain.com
Common mistakes
- Setting the PTR to the bare domain
yourdomain.comwhen it points to a website on another IP. - Forgetting IPv6: if your server sends over IPv6, that address needs its own PTR. Gmail is strict about it.
- Trying to add a PTR at Cloudflare, GoDaddy or your registrar. It will have no effect on your server IP.
Check that it is fixed
PTR changes usually appear within minutes to a few hours. Send a new test email from the home page. The Reverse DNS section should show mail.yourdomain.com and confirm it points back to the same IP.
Check that it is fixed
DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.
Related guides
- No SPF record on your domainYour domain does not say which servers may send email for it. Add one TXT record and receivers can tell your real emails from fakes.
- SPF error: too many DNS lookups (permerror)SPF allows at most 10 DNS lookups. Above that, the whole record breaks and receivers treat it as invalid. Here is how to slim it down.
- Several SPF records on one domainA domain must have only one SPF record. With two or more, SPF breaks for every email. Merge them into a single line.
- SPF fails: the sending server is not authorizedYour domain has an SPF record, but the server that sent your email is not in it. Find which service sent the email and add it.
- No DKIM signature on your emailsDKIM adds a digital signature that proves an email really comes from your domain. Turn it on in your email provider and publish its key in DNS.