Set up a custom domain in Office 365

The challenge of a personalized domain
In this article, I’ll show you how to set up a custom domain for Office 365. If you recently signed up for Microsoft 365, then you’ll want to register your domain name.
This will allow you to create login identities that use your company’s domain name. For example, Steve.Goodman@your-domain.com instead of Steve.Goodman@your-tenant.onmicrosoft.com.
It already allows your company to be on brand when communicating with others. It’s also an essential prerequisite if you plan to synchronize your on-premises Active Directory and migrate email.
If you currently host your email service elsewhere, this is a process to consider carefully. You’ll need to migrate your email before registering your DNS MX records with Office 365.
Add the domain to the tenant
To set up a custom domain, access the Microsoft 365 admin center as an administrator. You’ll find the link in the embossed menu at the top left as an Admin:

Next, expand the left menu under Settings and choose Domains (A). You will see the default domain listed. Choose Add Domain (B):

In the Add Domain Wizard, enter your company’s domain name, and then select Use this domain.

Before Microsoft 365 can confirm your domain, you need to verify that you own it. The easiest way is to use a TXT (text) DNS record. This will be listed in your DNS control panel alongside any existing TXT records. It has the format MS=ms123456789.
If you’re unsure how to add this option to your DNS provider, choose the Step-by-Step Instructions link. This link will provide a Microsoft guide specific to your DNS provider.

Once this step is completed, Microsoft 365 verifies your domain. You can choose to close the wizard at this point.
Configure DNS zone
If you want to add additional records, you will need to choose Continue to enable the relevant DNS records.
Below we will choose Continue with a plan to add specific recordings to Microsoft Teams:

On the Add DNS Records page, we’ll select Microsoft Teams and Skype for Business. This will show the specific DNS records we need to add. Just as if you have an email server, you won’t add MX records. The same is true if you’re running Skype for Business Server or Lync Server on-premises: only consider adding the records if they don’t exist.

In our example DNS control panel, the added records look like the following. These are records to support communication with Skype for Business Online federated users:

Once we have successfully registered these DNS records, we will choose Continue. This will take us to the final page of the wizard.

Your Office 365 tenant has your custom domain. If this is your first custom domain, it will be your default domain.