Question
How To Check The Email-Related DNS Records For All The Domains On The Server?
Answer
DNS is an important component in troubleshooting email deliverability issues. There are a few DNS records that their existence and accuracy is a necessary requirement in making sure that emails sent to a specific domain are sent to the correct server and that outgoing emails from a domain are not marked as spam by the recipient mail server.
For example:
- MX
- rDNS/PTR
- SPF
- DKIM
- DMARC
The following command runs through every domain hosted on the server and checks email-related DNS records for each domain to see if they are valid.
# alias acctinfo="/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo)"
# awk -F: '{dir = split(FILENAME, parts, "/") ; print parts[5] }' /home/*/etc/*/shadow | sort -u | while read domain; do acctinfo --mail $domain | grep -Ei "(mx|spf|dkim|dmarc|ptr)" -A 3;done
If you detect a missing or misconfigured record for a specific domain and want to correct it, you need to first determine where the DNS is hosted for that domain. If DNS is not hosted on your cPanel server then you need to contact your DNS host for assistance with modifying, adding, or removing records.
Warning: Please note that the existence and accuracy of DNS records are not the only conditions for error-free email deliverability. There are still many other requirements that need to be met and constantly maintained in order to guarantee that your emails are sent to their targeted destination and received without any issues.
Additional Resources
How to find out where a domain's DNS is hosted
Checklist for Emails going to Spam
Can a new IP address have a publicly bad spam reputation?
Emails go to spam despite valid SPF/DKIM/DMARC records - IP/Domain Reputation
Comments
0 comments
Article is closed for comments.