Email Configuration: Setting Up Reverse DNS and SPF Records
23 Jan 2012 by TuxAdminThis tutorial presents a simple 2 step configuration to ensure that emails sent out from your server do not end up being flagged as spam.
1. Set RDNS
Some mail servers checks to see if emails coming from a particular IP matches the hostname of the server it is sent from. This is set by the reverse DNS (RDNS) of the IP.
Most hosting providers will allow you to set the RDNS from within the control panel. This can be SolusVM/VePortal or any other management panel for your server.
Simply login to the control panel, and set the RDNS so that the allocated IP for your server resolves to your FQDN. E.g. server1.myserver.com
2. Add SPF records to domain's DNS
SPF or sender policy framework is another requirement for most mail servers to verify the authenticity of an email. This is basically a DNS record that is queried by the mail servers to check if the sender (server) is permitted to send emails on behalf of a particular domain.
Having proper SPF records are important so that a malicious server cannot send emails that appear to come from your domain. Those emails will be instantly flagged as spam.
Simply login to your domain registrar's control panel, and add a TXT record for your domain following the line below. Remember to change the IP4 address to match your own server's IP.
v=spf1 mx ip4:111.222.333.444 -all
That SPF1 line basically tells the receiving mail server to accept the email if:-
- The sending mail server matches the the MX records of the domain. That is, the IP of the mail server is the same as the A record for MX entry.
- The sending mail server has an IP of 111.222.333.444.