Pre-requirements
- Basic knowledge of DNS and email server configurations.
- Administrator access to your Plesk server.
- Familiarity with DNS record management and RFC guidelines for hostnames.
Introduction
Reverse DNS (rDNS) is the process of mapping an IP address to a domain name, which is the reverse of the traditional DNS lookup. rDNS is crucial for email deliverability and helps verify that the IP sending emails is associated with the correct domain name. This guide explains reverse DNS in detail and addresses common warnings like "Reverse DNS is not a valid hostname" when using tools like MXToolBox.
What is Reverse DNS (rDNS)?
Reverse DNS, or rDNS, performs the opposite of a regular DNS lookup. Instead of translating a domain name to an IP address, it maps an IP address back to a domain name. For example, when an IP address (e.g., 203.0.113.5
) is looked up via rDNS, it returns a corresponding hostname (e.g., mail.example.com
).
Why rDNS is Important for Email Servers
- Email Deliverability: Many mail servers check the rDNS records of an IP address to verify that it corresponds to a legitimate domain name. If no rDNS record is found, the email may be marked as spam.
- Anti-Spam Checks: Reverse DNS is one of the key factors mail servers use to validate email origin. Improper or missing rDNS records can trigger anti-spam filters.
- Improves Domain Reputation: Setting a correct rDNS record that matches your mail server's domain increases trustworthiness and reduces the likelihood of emails being flagged as spam.
How Reverse DNS Works
- A client performs a reverse DNS lookup by querying a PTR record for the given IP address.
- The DNS server responds with the domain name associated with the IP address.
- The domain name is then verified against the original hostname, completing the lookup process.
Linux Command to Perform rDNS Lookup
You can check the reverse DNS of an IP address using the dig
command in Linux:
# Example rDNS lookup for 203.0.113.5
dig -x 203.0.113.5
Understanding MXToolBox Warning: "Reverse DNS is Not a Valid Hostname"
If the MXToolBox checker displays the warning "Reverse DNS is not a valid hostname" for an MX record hosted on a Plesk server, the issue often stems from improper hostname configuration.
Why This Warning Occurs
The warning is triggered because the server’s hostname is configured as a second-level domain (e.g., example.com). According to RFC guidelines, a proper mail server hostname should be a third-level domain (e.g., mail.example.com or server.example.com).
- Second-Level Domain Issues: Using second-level domains as hostnames (e.g.,
example.com
) may cause rDNS to fail, leading to warnings like this one and potentially causing your outgoing emails to be marked as spam. - rDNS and RFC Compliance: RFC 5321 recommends using third-level domains as hostnames for better compliance and validation in rDNS checks.
Solution: Configure the Hostname Properly for Reverse DNS
To resolve this issue, you need to ensure that the server’s hostname is configured as a third-level domain (e.g., mail.example.com). Here's how to update the hostname in Plesk:
Steps to Set a Valid Hostname in Plesk
- Log into your Plesk control panel as an administrator.
- Go to Tools & Settings > Server Settings.
- In the Full Hostname field, change the hostname to a third-level domain name (e.g.,
mail.example.com
). - Click OK to save the changes.
Once the hostname is updated, update the corresponding PTR (reverse DNS) record with another web hosting provider or third-party DNS provider or DNS manager to match the new hostname.
Steps to Update PTR Record via CLI (Linux)
# Example command to set PTR record for mail.example.com
plesk bin dns --add example.com -ptr 203.0.113.5 mail.example.com
If your DNS is managed by another web hosting provider or third-party DNS provider, contact their support team to update the PTR record for the server’s IP address.
Verifying the Reverse DNS Configuration
Once the PTR record is updated, you can verify the configuration using tools like MXToolBox or command-line utilities.
Linux Command to Verify PTR Record
# Verify PTR record using dig
dig -x 203.0.113.5
Steps to Verify Using MXToolBox
- Go to MXToolBox.
- Enter your server’s IP address in the Reverse Lookup field.
- Click Check to see if the PTR record is properly configured and matches the hostname.
Gotchas to Avoid
- Incorrect PTR Configuration: Ensure that the PTR record points to a third-level domain name (e.g.,
mail.example.com
). Mismatches between the PTR record and the hostname can lead to email deliverability issues. - DNS Propagation Time: Changes to the PTR record may take time to propagate. Be patient and test after propagation is completed.
- rDNS for Outbound Mail: Without proper rDNS configuration, outgoing mail may be flagged as spam by recipient servers.
Reverse DNS is a critical component in ensuring email deliverability and preventing your domain from being flagged as spam. If you're seeing the "Reverse DNS is not a valid hostname" warning, it’s likely due to improper hostname configuration. By ensuring that your server hostname is a third-level domain and updating the PTR record accordingly, you can resolve this issue and improve your server’s reputation for outgoing emails.
For more detailed guidance on DNS and email server management, visit our Knowledge Base.