
A new Microsoft 365 environment uses an address like contoso.onmicrosoft.com by default. That doesn't look very professional. To send email and sign in under your own name, such as john@contoso.com, you add your domain to Microsoft 365. This article shows how to verify the domain, set up the DNS records, give users the new address and fix the typical problems.
What do you need?
- An account with the Global Administrator or Domain Name Administrator role in Microsoft 365.
- Access to your domain's DNS management at your registrar or hosting company. Not sure where the domain is hosted? Look it up with a WHOIS lookup.
- For an email migration: a plan for when you switch mail flow. Starting from scratch as a small business? Then read your own Microsoft 365 environment with your own domain first.
Add and verify the domain
- Go to admin.microsoft.com > Settings > Domains > Add domain.
- Type your domain name and select Continue.
- Verify ownership with a TXT record at your DNS provider. The value starts with
MS=msfollowed by digits. With some providers it works automatically through Domain Connect: you sign in at the provider and Microsoft adds the records itself. - Select Verify. If it fails right away, wait a while: DNS changes can take a few hours to show up everywhere.

The DNS records
After verification you choose whether Microsoft adds the records for you (with Domain Connect) or you add them yourself. The admin center then shows the exact values:
- MX: routes email to Exchange Online. Existing domains use an address ending in
mail.protection.outlook.com. Since mid-2026, new domains get a value ending inmx.microsoft. So always copy the value from the admin center rather than typing it yourself. - CNAME autodiscover: points to
autodiscover.outlook.comso Outlook finds your mailbox automatically. - TXT (SPF):
v=spf1 include:spf.protection.outlook.com -all. - Under the advanced options you'll find optional records, for example for Intune device enrollment.
Migrating email from another provider? Only change the MX record once the mailboxes are ready, otherwise new mail lands in an empty mailbox.

One SPF record per domain
Also sending mail through a newsletter service, accounting package or your website? Add them to the same SPF record, for example v=spf1 include:spf.protection.outlook.com include:mailprovider.example -all. Two separate SPF records make SPF invalid.
Give users the new address
- Set the domain as default (Set as default) so new users get it automatically.
- For existing users, change the username and email via Users > Active users > user > Manage username and email. The old address usually stays as an alias.
- For many users at once, PowerShell is easier. Read change the UserPrincipalName.
Note: after a username change, people have to sign in again in Outlook, Teams and OneDrive. Let them know in advance.
Users from on-premises Active Directory
If you sync with Entra Connect, you don't change the username in Microsoft 365 but in Active Directory. The domain must exist there as a UPN suffix first. Read add a domain as a UPN suffix.
Next: security
Enable DKIM and add a DMARC record, a TXT record on _dmarc.contoso.com. Start with v=DMARC1; p=none; rua=mailto:dmarc@contoso.com to collect reports, then move to quarantine or reject later. Your emails are less likely to land in spam and spoofing gets harder.
Common problems
- Verification fails: check that the TXT record is on the root domain (often
@) and not on a subdomain. Some providers automatically append the domain name. - The domain is already in use: a domain can only be in one Microsoft 365 organization at a time. Remove it from the other tenant first.
- The status keeps showing a problem: open the domain in the admin center. It shows which record is missing or has a wrong value.
FAQ
Can I remove the onmicrosoft.com domain?
No, it always stays. You can replace it as the default domain, though.
Does an extra domain cost money?
Not at Microsoft. You only pay for the registration at your registrar. You can use an extra domain as an alias for a second brand, for example.
Nederlandstalige versie: Je eigen domein toevoegen aan Microsoft 365