Emails rejected? Fix your server's reverse DNS (PTR) record
Short answer: If email sent from your own server, such as order confirmations or password resets from a VPS, is rejected or lands in spam, check its reverse DNS. The server's IP address needs a PTR record pointing to a hostname, and that hostname needs an A or AAAA record pointing back to the same IP. Google's sender guidelines ask for exactly this: valid forward and reverse DNS. You usually set the PTR record in your server or hosting provider's control panel, not at your domain registrar.
What reverse DNS is
Normal DNS turns a name into an address: mail.example.com points to 203.0.113.25. Reverse DNS does the opposite. A PTR record, stored in a special zone that belongs to whoever owns the IP address, says "203.0.113.25 is mail.example.com".
Receiving mail servers look at the IP address that connected to them and check:
- Does this IP have a PTR record at all?
- Does the hostname in that PTR record resolve back to the same IP? (This is often called forward-confirmed reverse DNS.)
- Does the hostname look like a real mail server rather than a generic, auto-generated name?
A missing or mismatched answer doesn't prove a message is spam, but it's a strong hint that the sender is a misconfigured or compromised machine. Many providers treat it as a reason to reject, delay or filter the message.
Why this catches small businesses
Reverse DNS problems usually appear when a business sends mail directly from its own server instead of through a mail service:
- A web app on a cloud server sends notifications with its built-in mail function.
- An old on-premises server or office device relays scanner emails or alerts.
- A developer sets up a mail server on a new VPS and copies the old configuration across, but not the PTR record.
- A server move changes the IP address, and the new IP keeps the hosting provider's default reverse name.
Symptoms include bounces mentioning "reverse DNS", "PTR" or "cannot resolve your address", messages delivered to some providers but not others, and spam-folder placement for perfectly ordinary emails.
What the guidelines say
Google's email sender guidelines list, among the requirements for all senders, ensuring that sending domains or IPs have valid forward and reverse DNS records, also referred to as PTR records. Other large mailbox providers have similar expectations.
The rule is old. RFC 1912, a long-standing document on common DNS errors, says every internet-reachable host should have a name, and advises making sure PTR and A records match: for every IP address, there should be a matching PTR record.
How to check yours
You need the public IP address your server sends mail from. Then:
- Look up the PTR:
dig -x 203.0.113.25 +short(ornslookup 203.0.113.25on Windows). You should see a hostname. - Look up that hostname forward:
dig mail.example.com +short. It should return the same IP. - Check what your mail server announces: the name your server uses in its SMTP greeting (the HELO or EHLO name) should ideally match the PTR hostname.
If the PTR shows something generic, such as a long name with the IP address and the hosting company's domain, the provider's default is still in place.
How to fix it
Because the PTR record lives in the IP owner's zone, you change it where the IP comes from:
- Choose a hostname for the server, such as
mail.example.comorapp1.example.com. - Create the forward record in your domain's DNS: an A record (and AAAA for IPv6) pointing that name to the server's IP.
- Set the PTR record in your hosting or cloud provider's dashboard. Many show it as "reverse DNS" on the server or IP settings page. Some set it automatically from the server's name; others require a support request.
- Configure the mail server to use the same hostname in its greeting.
- Wait for DNS to update, then test by sending to a few different mailbox providers and reading the message headers.
If you send over IPv6 as well as IPv4, each address needs its own matching PTR and forward record. A common surprise is a server that has perfect IPv4 reverse DNS but sends some mail over IPv6 with none.
Mistakes to avoid
- Several domains on one IP. A single IP can have only one sensible PTR name. Pick one hostname for the server and let all your domains use it in their sending setup.
- Pointing PTR at the bare domain. Using
example.comas the PTR name often clashes with the website's own records. A dedicated hostname is cleaner. - Forgetting test servers. Staging servers that send real emails need the same care, or should send through a mail trap instead.
Reverse DNS is only one piece
A correct PTR record removes one red flag, but mailbox providers look at much more. You'll also want SPF, DKIM and DMARC records for your domain, TLS for sending, consistent sending volumes, and a clean reputation for the IP. For most small businesses, sending through an established email service, which manages IP reputation and reverse DNS for you, is simpler and more reliable than running your own mail server.
A worked example
Consider a hypothetical Phoenix home services company whose job-booking app ran on a cloud server and sent booking confirmations directly. After moving to a new server, customers with certain email providers stopped receiving confirmations, and bounces mentioned the sender's reverse DNS. The new IP still had the cloud provider's default PTR name. The developer set reverse DNS to app.example.com in the provider's dashboard, added a matching A record, updated the mail software's hostname and saw confirmations arrive again. A few months later, they moved sending to a transactional email service anyway, to stop managing it themselves.
FAQ
Can I set a PTR record at my domain registrar?
Usually not. PTR records belong to the owner of the IP address, normally your hosting or cloud provider.
Does a website need reverse DNS?
Not for serving web pages. It matters mainly for sending email.
I use a shared mail service. Do I need to do anything?
The service handles reverse DNS for its own servers. You still need SPF, DKIM and DMARC for your domain.
How long does a PTR change take to work?
It depends on the record's time-to-live and the provider. Often minutes to a few hours.
If customers aren't receiving emails from your app, tell us how your app sends mail and we'll help track down why.