How to Add DNS Record for Email Domain

This article explains the mail-related DNS records needed for an email domain and how to add them. The required records are an A record for webmail, plus SPF, MX, PTR, DMARC, and DKIM records, which authenticate outgoing mail, route incoming mail, verify the sender, and protect against spoofing and spam. Add the A, MX, and SPF records through your hosting control panel, request a PTR record from your provider, and generate the DKIM key from your mail server before adding the DKIM and DMARC records.

1. DNS A Record: WebMail URL

2. SPF Record

  • Some major email providers, like Hotmail and AOL, now require a special type of DNS record called an SPF (Sender Policy Framework) record. This record helps prevent spammers from sending emails that look like they come from your domain.

  • You can find clear instructions on how to format your SPF record at SPF Syntax Table. Keep in mind that the domain owner may have specific rules for what to include in this record.

  • More details here: SPF in Simple Terms

3. MX Record

MX Records (Mail Exchange Records) are an essential part of email delivery. They tell the internet which server should receive emails for your domain.

  1. Priority: This number decides the order in which mail servers are used. Emails are sent first to the server with the lowest priority number. If you have multiple servers, set a lower number for your main mail server and a higher number for backup servers.
  2. Record field: Usually, you can leave this as "@" to indicate the root domain.
  3. Address field: This is the mail server's address. It's better to use a domain name instead of an IP address. Typically, you first create an A record called "mail" pointing to your mail server's IP, and then use mail.yourdomain.com here.
  4. Example MX records:
    Priority: 10 | Record: @ | Address: mail.domain.com
    Priority: 20 | Record: @ | Address: mail2.domain.com

This setup ensures that emails are properly routed to your main and backup mail servers.

4. PTR Record

PTR records resolve IP addresses into hostnames. By setting up a PTR record, the receiving server can do a reverse DNS lookup to verify the sender.

5. DMARC Record

DMARC (Domain-based Message Authentication, Reporting & Conformance) is a modern way to protect your email. It works with two other records, SPF and DKIM, to make sure that emails sent from your domain are genuine. DMARC also helps block fake or fraudulent emails that try to look like they came from you.

Learn more: DMARC in Simple Terms

6. DKIM Record

Mail signing protocols, such as DomainKeys and DKIM signing, verify the authenticity of a message and can be used to protect users from phishing schemes or spam attacks.

Add SPF, MX, DKIM, DMARC, PTR Record

1. Add DNS A record for mail, MX record, SPF records

2. Add PTR Record

Please refer to How to Configure rDNS to add PTR record for email server. Please use a valid email domain name as the value of PTR record.

3. Add DKIM & DMARC

The DKIM key is generated from the email server.

Conclusion

Properly setting up DNS records is crucial for ensuring your email server works reliably and securely. Adding the correct PTR record, along with MX, SPF, DKIM, and DMARC records, helps verify that your emails are legitimate, improves delivery rates, and protects your domain from spam and phishing attacks.

Following these steps for email server setup will ensure smooth email communication and safeguard your domain reputation.

Keywords:

DNS records setup, PTR record configuration, Email server configuration, MX record setup, SPF DKIM DMARC setup, Email authentication, Secure email server, Domain email setup, Reverse DNS for email, Email deliverability tips

Last Updated:   11/13/2026
Outline