Step 1

Add the email records

Three records let Exchange Online receive the school's mail, stop other people sending as you, and let Outlook set itself up.

15 minutesNeeds Global Administrator
What improves

School email is delivered, and others cannot send as you.

Why it matters

Without these records mail goes nowhere, or forged mail passes as genuine.

How you do it

Add the MX, SPF and autodiscover records, then turn on DKIM and DMARC.

Every name, address and value in this guide is an example. Replace them with your own.

Get the exact MX value

A domain with DNSSEC turned on gets a different mail address, ending mx.microsoft, so copy yours. The admin centre shows it under Settings › Domains › contoso.com › DNS records, or ask Microsoft Graph:

PowerShell
Install-Module Microsoft.Graph.Identity.DirectoryManagement -Scope CurrentUser
Connect-MgGraph -TenantId contoso.onmicrosoft.com -Scopes "Domain.Read.All" -NoWelcome
Get-MgDomainServiceConfigurationRecord -DomainId "contoso.com" |
  Where-Object RecordType -eq "Mx" | ForEach-Object { $_.AdditionalProperties.mailExchange }
Sign in to this app only

When Windows asks you to sign in, untick Allow my organization to manage my device and choose No, sign in to this app only. Otherwise your PC registers itself with the school's tenant.

Add the records

TypeNameValueFor
MX@contoso-com.mail.protection.outlook.com, priority 0Receiving email
TXT@v=spf1 include:spf.protection.outlook.com -allSPF: who may send as you
CNAMEautodiscoverautodiscover.outlook.comOutlook setup

Use your own MX value from step 1. If the school sends mail from another service, such as an MIS or newsletter tool, add it to the SPF record before -all. A domain can have only one SPF record.

If the domain is in Azure DNS:

Azure CLI
$rg = "rg-contoso-dns"; $z = "contoso.com"
az network dns record-set mx add-record -g $rg -z $z -n "@" -e "contoso-com.mail.protection.outlook.com" -p 0
az network dns record-set txt add-record -g $rg -z $z -n "@" -v "v=spf1 include:spf.protection.outlook.com -all"
az network dns record-set cname set-record -g $rg -z $z -n autodiscover -c autodiscover.outlook.com
Placeholders break commands

Type the real value between the quotes. A leftover <MX-TARGET> fails with "The system cannot find the file specified", because Windows reads < as "read from a file".

Done when

Check

Resolve-DnsName contoso.com -Type MX -Server 8.8.8.8 returns your Microsoft 365 address, and the admin centre shows the Exchange records as OK.

Your progress is kept in this browser only.