A mail server that does not have a matching PTR record will be rejected, greylisted, or scored heavily on spam at every major receiver — Gmail, Outlook, Yahoo, Apple, Proton all check that the IP your SMTP HELO comes from has a reverse DNS record that points back at the same hostname. The provider running your network — datacentre, cloud, or your own — controls the in-addr.arpa delegation, so the PTR can be set either with the provider’s API or, when you operate your own authoritative DNS for a delegated reverse range, in your Bind9 zone. This article covers both shapes for the engagements where we run the authoritative server ourselves.
How to verify
Confirm the current PTR situation before changing anything.
dig +short -x $(curl -s ifconfig.me)
dig +short mx1.example.com A
dig +short mx1.example.com AAAA
dig +short SOA 113.0.203.in-addr.arpa
dig @ns1.your-provider.net -t AXFR 113.0.203.in-addr.arpa # if delegated to you
host mx1.example.com 8.8.8.8
A correct setup returns the FQDN of your mail server (e.g. mx1.example.com.) from the reverse lookup, the same FQDN resolves forward to the same IP, and the SOA on the reverse zone identifies your nameserver — or your provider’s. If dig -x returns the provider default (ec2-54-x-y-z.compute.amazonaws.com) or nothing, you are not done.
What’s happening
DNS reverse lookup uses the in-addr.arpa tree for IPv4 and ip6.arpa for IPv6. The reverse of 203.0.113.42 is the PTR record at 42.113.0.203.in-addr.arpa. The reverse of 2001:db8::1 is the PTR record at 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. Either tree is owned by the registry hierarchy (ARIN, RIPE, APNIC, etc.) and delegated downward — your ISP or cloud provider gets a /24, /22, etc., and they either set the PTR on your behalf via a web form or API call, or they delegate the reverse zone to your nameservers via NS records.
The check at the receiving mail server is twofold:
- PTR present. A PTR exists for the connecting IP — without it, many receivers reject the connection outright.
- Forward-confirmed reverse DNS (FCrDNS). The PTR resolves to a name, and that name resolves forward to the same IP. A PTR of
mx1.example.comis only useful ifmx1.example.comalso has an A record pointing back at the same IP.
For mail servers, both must be true, and the PTR should match the HELO/EHLO and the myhostname in your Postfix config. Mismatches drop reputation gradually rather than blocking instantly.
The procedure
There are two paths depending on whether your provider delegates the reverse zone to you or sets the PTR on your behalf. Both end at the same verification.
Path A — Provider sets the PTR (most common)
-
Find the management interface. AWS uses the EC2 console “Request reverse DNS for EIP” form; DigitalOcean derives the PTR from the droplet’s hostname automatically; OVH has a dedicated PTR section per IP; Hetzner exposes it on the server’s IP page.
-
Set the PTR to the mail server’s exact FQDN. It must match
myhostnamein Postfix, theHELOPostfix announces, and have a forward A/AAAA record that resolves back to the same IP:# forward record published at example.com's DNS mx1.example.com. IN A 203.0.113.42 # reverse record set via provider 42.113.0.203.in-addr.arpa. IN PTR mx1.example.com. -
Wait for cache TTL to expire, then verify from outside your network with
dig +short -x 203.0.113.42.
Path B — Provider delegated the reverse zone to your Bind9
When you own a /24 or larger and the provider has delegated the reverse via NS records, you author the zone on your own Bind9. Create /etc/bind/zones/db.113.0.203.in-addr.arpa:
$TTL 86400
@ IN SOA ns1.example.com. hostmaster.example.com. (
2026060201 ; serial — YYYYMMDDnn
7200 ; refresh
3600 ; retry
1209600 ; expire
3600 ; minimum
)
IN NS ns1.example.com.
IN NS ns2.example.com.
; mail servers
42 IN PTR mx1.example.com.
43 IN PTR mx2.example.com.
; web edge
10 IN PTR edge1.example.com.
11 IN PTR edge2.example.com.
Then add the zone declaration to /etc/bind/named.conf.local:
zone "113.0.203.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.113.0.203.in-addr.arpa";
allow-transfer { 198.51.100.5; }; // ns2
notify yes;
};
Validate and reload:
sudo named-checkconf
sudo named-checkzone 113.0.203.in-addr.arpa /etc/bind/zones/db.113.0.203.in-addr.arpa
sudo rndc reload 113.0.203.in-addr.arpa
sudo rndc notify 113.0.203.in-addr.arpa
For IPv6, the zone is 0.8.b.d.0.1.0.0.2.ip6.arpa (for 2001:db8:1::/48) and PTR records use the nibble-reversed full address — see Bind9 install Ubuntu for the surrounding zone hygiene.
Verification (both paths)
dig +short -x 203.0.113.42
dig +short mx1.example.com A
# Both must produce the same FQDN/IP pair.
# From outside, confirm FCrDNS:
dig +short @8.8.8.8 -x 203.0.113.42
dig +short @8.8.8.8 mx1.example.com
# Score the deliverability:
nc -zv mxtoolbox.com 25 # then run their SMTP test from a browser
A Postfix smoke test from the mail server, with the reverse correctly set, should land in the inbox at Gmail rather than spam.
Operational notes
- The PTR FQDN should be the operational hostname (
mx1.example.com), not the marketing domain (example.com). Receivers look for purpose-built mail naming and score generic names lower. - IPv6 dual-stack mail servers need a PTR for every IPv6 they announce — most rejection events from Outlook are missing IPv6 PTRs while IPv4 is fine.
- A change to the PTR is bounded by the TTL of both the reverse zone’s SOA and any intermediate resolver cache — plan a 24-hour window before you assume the new PTR is live everywhere.
- The PTR record is the only DNS record where the value is a hostname pointer, not a free-text or address — typos that drop the trailing dot cause the zone file to silently append the zone origin (
mx1.example.com.113.0.203.in-addr.arpa.), which is invisible until youdigit. - Cloud providers that auto-generate reverse names from instance IDs (AWS, GCP) require an explicit PTR-override request — and some have a limit of one PTR per Elastic IP regardless of how many EIPs you hold.
Common pitfalls
- The forward A record is published before the reverse is set — Gmail caches the missing PTR as
<nothing>for the TTL, and the first batch of mail lands in spam even after the PTR appears. - A provider’s PTR change quietly fails because the FQDN doesn’t end with a dot in the form — verify with
diginstead of trusting the success message. - The reverse zone is missing from the secondary nameserver because
allow-transferwasn’t set or NOTIFY wasn’t received — the primary serves the right PTR but cache lookups via the secondary return SERVFAIL. - IPv6 PTRs are set on the wrong byte order (most operators reverse them by hand and miss a digit) — use
printf '%s\n' "2001:db8::1" | python3 -c 'import ipaddress,sys; print(ipaddress.ip_address(sys.stdin.read().strip()).reverse_pointer)'to generate the canonical name. - The Bind9 zone file’s serial isn’t bumped after editing PTRs, secondaries don’t pull the change, and the symptom is intermittent PTR responses depending on which nameserver the resolver hit.
Stack Harbor manages reverse DNS as a first-class artifact in every mail engagement we run — PTR set with the FQDN that matches myhostname and the forward A record, IPv6 PTRs published when the host serves dual-stack, and the change validated from outside the network before the mail edge is allowed to send. If you have a mail server that is delivering inconsistently and a reverse lookup that returns the cloud-provider default, that hygiene is part of our Managed Operations practice.