Emails can not be sent or received by the mail server due to incorrect DNS records
Symptoms
Emails can not be sent or received by the mail server in ispmanager 6.
Causes
- Missing MX records for the domain;
- A-record for the mail domain has an incorrect value;
- No PTR record is specified for the mail server IP address;
- Missing TXT records with DKIM and DMARC for the domain.
Solution
Missing MX records for the domain
Make sure that the domain MX records are created and point to the correct mail server address.
Typically, MX records point to the mail subdomain. For example, for a domain.com domain, the MX record would point to mail.domain.com.
Use the dig utility to check DNS records. For example, to check the A-record for the domain.com domain on Google DNS servers, execute the following command:
dig MX domain.com @8.8.8.8 +short
If records exist on the DNS server, they will be displayed in the output:
10 mail1.domain.com.
20 mail2.domain.com.
On Windows, you can use the**** nslookup utility to check DNS records.
A-record for the mail domain has an incorrect value
Make sure the A record for your email domain points to the correct IP address.
Use the dig utility to check DNS records. For example, to check the A-record for the mail.domain.com domain on Google DNS servers, execute the following command:
dig A domain.com @8.8.8.8 +short
If the record exists on the DNS server, it will be displayed in the output as an IP address which should match the IP address of the mail server.
No PTR record is specified for the mail server IP address
The PTR record for the mail server IP address must match the server name (hostname).
The PTR record is created on the side of the IP address owner. Often the IP address owner is the hosting provider.
To find out the name of your server, use the hostname command. If you are using the ispmanager 6 panel, you can also see the server name in the System settings.
Use the dig utility to check DNS records. For example, to check the PTR record for the 172.31.97.58 IP address on Google DNS servers, execute the following command:
dig -x 172.31.97.58 @8.8.8.8 +short
If the record exists, the command output will display the server name at its end, which is specified in the record:
58.97.31.172.in-addr.arpa 3600 IN PTR example.com
Missing TXT records with DKIM and DMARC for the domain
A DMARC record defines a policy to protect a mail domain from spam and phishing emails.
A DKIM record is a key which is used to identify the sender. It also helps in protecting against spam and phishing.
In the ispmanager 6 panel, to create both records, simply enable the relevant options in the mail domain settings in the Mail section.
To enable DKIM, OpenDKIM must be installed in the Software configuration - Mail server section.
Once the options are enabled, the related DNS records for the domain will be generated in the DNS management:
_dmarc.domain.com- DMARC record name;dkim._domainkey.domain.com- DKIM record name.
Remember that if your domain is managed on a third-party DNS server, such as a registrar, it is required to add records on that DNS server.
Test the functionality of your mailbox with Mail-Tester!