SPF record for Microsoft 365

If Microsoft 365 (Exchange Online, Outlook) is the only thing that sends email for your domain, publish one TXT record on the domain itself (host @) with this value:

v=spf1 include:spf.protection.outlook.com -all

Adding it

  1. Open your DNS provider. If your domain's DNS is managed by Microsoft, the Microsoft 365 admin centre adds it for you under Settings, Domains.
  2. Look for an existing TXT record that starts with v=spf1. If there is one, edit it rather than adding a second.
  3. Add or edit the TXT record on @ with the value above, then check it below.

Other tools send email too?

Add each sender's include to the same record, before the ending. With SendGrid as well, for example:

v=spf1 include:spf.protection.outlook.com include:sendgrid.net -all

Printers, scanners and on-site apps that send through your own mail server need that server's public IP as ip4: in the record.

The mistakes I see most

~all or -all?

Microsoft's own example ends in -all (hard fail). If you're not yet sure every sender is listed, start with ~all, publish DMARC with reports, and tighten once the reports are clean.

Check your SPF record

I'll follow every include, count the lookups, and tell you whether Microsoft 365 is covered.

Related