How to Configure DNS for Mailserver

Why might you need this guide?

Many mail servers are configured to reject mail if it is received from a sending server with inconsistent DNS. This is because the majority of SPAM mail comes from malware on infected computers. As the compromised machines were not meant to be used as mail servers, DNS will not have been created on the IP the malware sends from. Therefore, to minimise the possibility of the recipient's mail server rejecting mail from your server out of hand, it's important to ensure that your DNS is consistent.

DNS Setup

To lower the chance of your mail being rejected, three things need to be set up:

  1. DNS A record pointing at the mail server IP i.e. mail.mydomain.co.uk 84600 IN A 212.23.3.142
    See: Managing Domain DNS Records
  1. Reverse DNS record (PTR) set on the IP pointing back to the A record, i.e. 212.23.3.142 PTR mail.mydomain.co.uk.
    See: Changing a rdns record
  1. The fully qualified domain name used for the HELO should equal the domain used in the above A record.
    This is set on the sending server itself.
    For Microsoft Exchange 2016 and 2019 it is configured in the following location:
    Mail flow -> Send connector
Carbon Neutral
Phone | Zen Internet
Zen Internet - Home SalesSales
01706 902573
Phone | Zen Internet
Zen Internet - Customer EnquiriesCustomer Enquiries
01706 902001