TechBuzzPro

Microsoft 365 Email: MX, SPF, & DKIM Setup

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you need to configure MX, SPF, and DKIM records for your Microsoft 365 email domain to ensure proper email delivery and prevent spoofing. These records tell the internet where to deliver your emails, and verify that your emails are genuinely sent from your domain.

What You'll Need

  • Access to your domain registrar's DNS management tools. This is where you bought your domain name (e.g., GoDaddy, Namecheap, Google Domains).
  • Your Microsoft 365 tenant administrator credentials.
  • A bit of patience - DNS changes can take time to propagate.

Step-by-Step

  1. Verify Your Domain in Microsoft 365: Before anything else, ensure your domain is verified within your Microsoft 365 admin center. Go to the "Settings" > "Domains" section. Add your domain and follow the verification steps. This usually involves adding a TXT record to your DNS settings.
  2. Set the MX Records: MX (Mail Exchanger) records tell email servers where to deliver email for your domain. You'll need to add or update these records at your domain registrar. Here are the Microsoft 365 MX records you'll typically use (labels can vary slightly by version, device or region):
    • Record 1: yourdomain.com. IN MX 15 mail.protection.outlook.com.
    • Record 2: yourdomain.com. IN MX 15 mail.mailops.microsoft.com.
    • Record 3: yourdomain.com. IN MX 15 mail.windowslive.com.
    Replace yourdomain.com with your actual domain name. The "15" is the priority; lower numbers have higher priority. You should only have these three MX records. Delete any existing MX records pointing to other email providers.
  3. Configure SPF (Sender Policy Framework): SPF records specify which mail servers are authorized to send email on behalf of your domain. This helps prevent spammers from forging your domain's email address. Create or update a TXT record with the following: yourdomain.com. IN TXT "v=spf1 include:spf.protection.outlook.com -all" Replace yourdomain.com with your domain name. The -all at the end indicates that any server *not* listed in the SPF record should reject emails. If you use third-party email marketing services, you'll need to include their SPF records as well (e.g., include:sendgrid.net).
  4. Implement DKIM (DomainKeys Identified Mail): DKIM adds a digital signature to your outgoing emails, allowing receiving servers to verify that the email was indeed sent by you and hasn't been tampered with.
    • Generate a DKIM Key in Microsoft 365: In the Microsoft 365 admin center, go to "Settings" > "Domains" and select your domain. Then, choose "DKIM." Click "+ Add a DKIM record." Choose a key length (2048 bits is recommended for better security), and Microsoft 365 will generate a public and private key.
    • Add the DKIM Record to Your DNS: You'll receive a CNAME record from Microsoft 365. This record will look something like: selector1._domainkey.yourdomain.com. IN CNAME selector1-yourdomain-com._domainkey.yourdomain-com.mail.protection.outlook.com. Replace yourdomain.com and selector1 with the values provided by Microsoft 365. You might have two DKIM records if you've enabled a second DKIM key.
    • Enable DKIM in Microsoft 365: After adding the DNS record, return to the DKIM settings in Microsoft 365 and click "Verify." It may take some time for the DNS record to propagate, so be patient.
  5. (Optional) Configure DMARC (Domain-based Message Authentication, Reporting & Conformance): DMARC builds upon SPF and DKIM, telling receiving servers what to do with emails that fail SPF and/or DKIM checks. It also allows you to receive reports about email authentication failures. Create a TXT record with the following format (adjust the policy as needed): yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com" Replace yourdomain.com with your domain name and dmarc-reports@yourdomain.com with an email address where you want to receive DMARC reports. The p=none policy means that receiving servers should *not* take any action on failing emails initially. You can later change this to p=quarantine or p=reject to instruct servers to quarantine or reject failing emails.

Common Mistakes

  • Incorrect MX Record Priority: Ensure the priority numbers are correct (typically 15 for Microsoft 365).
  • Conflicting SPF Records: Having multiple SPF records can invalidate them. Combine them into a single record.
  • Typographical Errors: Double-check all DNS records for typos. A single mistake can prevent email delivery.
  • Forgetting to Verify DKIM: Don't forget to click the "Verify" button in Microsoft 365 after adding the DKIM record to your DNS.
  • Not Allowing Propagation Time: DNS changes can take up to 48 hours to propagate fully across the internet, although it’s usually much faster.

Tips

  • Use a DNS Checker: Tools like MXToolbox or What's My DNS can help you verify that your DNS records are configured correctly and have propagated.
  • Start with a "none" DMARC Policy: Begin with a DMARC policy of "none" to monitor your email traffic before enforcing stricter policies.
  • Regularly Review DMARC Reports: Analyze your DMARC reports to identify any authentication issues and adjust your SPF and DKIM settings accordingly.
  • Keep Records Up-to-Date: If you change email providers or use additional services that send email on your behalf, update your SPF records.
  • Consider using Microsoft 365's Automated DKIM Configuration: Microsoft 365 can now automatically generate and manage DKIM keys, simplifying the process.

Troubleshooting

  • Email Not Being Delivered: Check your MX records to ensure they are pointing to Microsoft 365. Verify your SPF and DKIM records are configured correctly.
  • Emails Going to Spam: Incorrect SPF or DKIM configuration can cause emails to be flagged as spam. Review your records and DMARC policy.
  • DNS Propagation Issues: Use a DNS checker to see if your records have propagated globally. Clear your browser cache and DNS cache on your computer.
  • Microsoft 365 Service Status: Check the Microsoft 365 service status page to see if there are any known issues affecting email delivery.
  • Restart Your Computer and Router: A simple restart can sometimes resolve temporary DNS caching issues.

Frequently Asked Questions

What is the difference between SPF, DKIM, and DMARC?

SPF verifies the sending server, DKIM verifies the email's integrity, and DMARC tells receiving servers what to do with emails that fail SPF or DKIM.

How long does it take for DNS changes to propagate?

DNS changes can take up to 48 hours to propagate, but it's usually much faster (typically a few hours).

Can I have multiple SPF records?

No, you should only have one SPF record. Combine all the necessary include statements into a single record.

What does the "p=none" DMARC policy mean?

It means that receiving servers should not take any action on emails that fail SPF or DKIM checks. It's a monitoring-only policy.

Where do I manage my DNS records?

You manage your DNS records through your domain registrar's website (e.g., GoDaddy, Namecheap, Google Domains).