Email 6 min read

Gmail 550 5.7.25 Error: Fix Your Mail Server's PTR Record

Gmail will not accept mail from an IP address whose reverse DNS is missing or does not match. The fix is two DNS records and one hostname setting.

By BashPilot Team
BashEmail Email spam protection Keep outbound mail clean and off blacklists, automatically. Explore BashEmail

A Gmail 550 5.7.25 bounce tells you the IP address sending your mail has no usable PTR record, which is the reverse DNS entry that maps an address back to a hostname. Nothing is wrong with your message or your domain. Gmail simply refuses to talk to a server that cannot say who it is, and the fix is a short checklist you can finish in an afternoon, apart from waiting for DNS.

Check what the internet sees

Do three lookups from any machine, using your server's public IP. The first is the reverse lookup, the second is the forward lookup of whatever name it returned, and the third repeats that for IPv6 if your server uses it.

reverse, then forward, for IPv4 and IPv6
dig -x 203.0.113.25 +short
dig +short A mail.example.com
dig +short AAAA mail.example.com

Google's sender guidelines describe what has to be true. The IP must have a PTR record that resolves to a hostname, the same hostname must have an A record for IPv4 or an AAAA record for IPv6 resolving to that IP, and the sending IP must match the IP of the hostname named in the PTR. Read your three results against that.

What you seeWhat it means
The reverse lookup returns nothingNo PTR exists. Ask whoever owns the IP to create one
It returns a generic provider name such as an address-based hostnameA PTR exists but does not name your mail host. It may pass a basic check and still look wrong to receivers
It returns mail.example.com but that name has no A record or points at a different IPThe forward record is missing or wrong. Create or correct it
IPv4 is correct but the server connects to Gmail over IPv6Add a PTR and an AAAA for the IPv6 address, or stop sending over IPv6

Set the PTR and the matching forward record

You cannot create a PTR in your normal DNS zone, because the reverse zone for an address belongs to the organization that was assigned it. At most hosting providers this is a field called reverse DNS or rDNS in the control panel for that server. If there is no field, open a support ticket asking them to set the PTR for your IP to your mail hostname.

Then make the forward record match. In your domain's DNS, create an A record for that hostname pointing to the same IP. If the hostname sits behind a proxying DNS service, set that one record to DNS only. A proxied record would answer with the proxy's address instead of your server's, and the forward lookup would stop matching.

Make the server introduce itself with the same name

When your server connects to Gmail it announces a hostname in its HELO or EHLO greeting. Many receivers compare that name with the PTR, and it is sensible practice to make them identical. See what yours says.

what the server announces
postconf myhostname smtp_helo_name
printf 'QUIT\r\n' | nc -w 5 mail.example.com 25

For Postfix, smtp_helo_name defaults to $myhostname, so setting myhostname to the PTR name fixes both. On a cPanel server running Exim, per-domain HELO names and outgoing IPs come from /etc/mailhelo and /etc/mailips, and they only take effect when the matching options are enabled in WHM's Exim Configuration Manager. If you give domains dedicated IPs, every one of those addresses needs its own PTR and its own matching hostname.

Postfix: set the hostname and reload
sudo postconf -e 'myhostname = mail.example.com'
sudo systemctl reload postfix

Retest with a real message

Send a message to a Gmail address you control, open it, and use Show original. The authentication results at the top list whether SPF, DKIM and DMARC passed. Reverse DNS is not shown there directly, but a message that arrives is the proof that Gmail accepted the connection. If it still bounces, read the full text of the rejection, because Gmail includes a link and the specific reason.

While you are there, check the other requirements in Google's guidelines. Every sender must authenticate with SPF or DKIM, senders above 5,000 messages a day to Gmail accounts must also use DMARC, and mail should be sent over a TLS connection. Google also asks senders to keep the spam rate reported in Postmaster Tools below 0.10% and never reach 0.30%. If your bounce changes from 5.7.25 to a different code after the PTR fix, work through Postfix Rejecting Mail? Fix SPF, DKIM and DMARC Failures next.

If it still fails

  • IPv6 mismatch. Look at the connection in your mail log. If Gmail was reached over IPv6, fix that address or disable IPv6 for outbound mail.
  • A blocklisted IP. A good PTR does not help an address that is on a blocklist. The steps in Plesk Server Blacklisted? How to Get Your IP Delisted apply to any mail server.
  • A shared IP with several domains. One address has one PTR. Use a single mail hostname for the server's HELO and make sure SPF and DKIM are correct for each sending domain.
  • Recently changed provider or IP. A fresh address has no reputation yet. Send low volumes of real mail first and let it build.

A PTR is a DNS and provider setting, so BashEmail does not manage it. What it covers is the part that decides whether your reputation survives once the records are right: it filters incoming spam, watches outgoing mail per account with sending limits, and shows blocklist status with the delisting path. It runs on your existing cPanel, Plesk, DirectAdmin or Ubuntu server with no MX or DNS change.

Share LinkedIn X
Questions

Frequently asked questions

What does Gmail error 550 5.7.25 mean?

It means the IP address sending the message does not have a valid PTR record. Google requires that a sending IP has a PTR record resolving to a hostname, and that the same hostname has an A or AAAA record resolving back to the same IP. Missing or mismatched reverse DNS is the cause, not the content of your message.

Who sets a PTR record, my domain registrar or my host?

Whoever controls the IP address, which is normally your hosting or server provider. A PTR lives in the reverse zone for the address, so you cannot create it in your domain's own DNS zone. Look for a reverse DNS field in the provider's control panel, or ask support to set it.

Does my HELO name have to match the PTR record?

Google's guidelines only require the PTR and forward records to match each other, but many receivers also compare the HELO name, so making them identical is sensible practice. In Postfix, `smtp_helo_name` defaults to `$myhostname`, so setting `myhostname` to the PTR hostname handles both.

Do I need a PTR for IPv6 as well?

Yes, if your server sends mail over IPv6. Gmail can connect over IPv6, and an address without its own PTR and AAAA record will be rejected even when IPv4 is perfect. Either fix IPv6 properly or configure the mail server to send over IPv4 only.

How long does a new PTR record take to work?

Anywhere from minutes to about a day, depending on the provider and cached answers. Check with `dig -x YOUR_IP +short` against a public resolver before retesting. Avoid repeated send attempts while the old answer is still cached, because repeated rejections can damage the reputation of the address.

Put your servers on autopilot.

Connect a server in about a minute. The first week is on us.