In this article, I will share my personal experience in fixing the PTR record error and resolving Gmail rejection on a CyberPanel Cloud VPS. If you’re a VPS server owner and you encounter issues with Gmail rejecting your emails, it may be due to a lack of PTR record setup. Follow the steps below to resolve this problem and ensure successful email delivery.
Step 1: Verify PTR Record using MX Toolbox
- Visit the MX Toolbox website.
- Enter your VPS server’s IPv4 address and click on “Check.”
- You should receive a domain name associated with your IP address, such as “magiskzip.com.”
- If the Reverse DNS (PTR Record) is correct, proceed to the next steps. If you are the owner of the VPS, you can easily set up the PTR record if not Reverse DNS correct simply put your domain name in the reverse DNS field.
Step 2: Bypass CDN Proxy for Mail Server
If you’re using a CDN like Cloudflare, it’s important to bypass the CDN proxy for your mail server. For example, use the IP address (IPv4) instead of the domain name (DNS) for your mail server, such as mail.magiskzip.com.
Step 3: Configure Correct MX and SPF Records
Ensure that you have set up the correct MX and SPF (Sender Policy Framework) records for your domain. This helps in validating the authenticity of your emails and prevents them from being marked as spam.
Additional Step: AAA Record for IPv6
If your VPS cloud server provider has provided you with an IPv6 address, you can add an AAA record to your DNS. Include the IPv6 address in your DNS records using the format “magiskzip.com” 000:0000:0000:000::0. This step is necessary only if you are facing issues specifically related to IPv6.
Troubleshooting Tip
If you have followed all the steps above and are still encountering the following error message: “gmail-smtp-in.l.google.com[2404:6800:4003:c06::1b] said: 550-5.7.25 [2a02:4780:8:6:2:f4c4:b639:8d75] The IP address sending this message 550-5.7.25 does not have a PTR record setup, or the corresponding forward DNS 550-5.7.25 entry does not point to the sending IP. As a policy, Gmail does not 550-5.7.25 accept messages from IPs with missing PTR records,” try disabling IPv6 in Postfix. Follow the steps below:
Disabling IPv6 in Postfix
- Open PuTTy as the root user.
- Copy and paste the following command:
postconf -e inet_protocols=ipv4
systemctl restart postfix
This will disable IPv6 in Postfix and restart the mail service.
Conclusion
By following the steps outlined in this article, you can fix the PTR record error and resolve Gmail rejection on your CyberPanel Cloud VPS. Remember to verify your PTR record, bypass CDN proxy for your mail server, configure the correct MX and SPF records, and disable IPv6 if necessary. These methods have been tested based on my personal experience and have proven to be effective. Enjoy seamless email delivery and improved communication on your VPS server.