To add custom domain name and wanted to get rid of the initial domain name provided by Microsoft ie. <domainname>.Onmicrosoft.com, and wanted to use your own custom domain to be listed in Azure AD then you should add custom domain name. Hence, changing to something like [email protected] without having onmicrosoft.com.

For demonstration purpose, I will be guiding you to show how to get rid of Microsoft provided UPN to my own ending with my customdomain. I will be using my own customdomain which I already have purchased with the name endpointgeek.com
Example For user “testuser”, it will change  from [email protected] to [email protected]

Benefit of having Custom domain name

  1. Once you have Azure Active Directory, and you try to create new user ID under Azure AD tenant, you will see that username is appended with some custom name you used while registering the domain by adding .onmicrosoft.com in the end, which doesn’t look professional.

Just see in my case, I have registered a domain with name manishtrial, and now when I try to create user, it shows my user’s User Principal Name (UPN) as [email protected]

New user
  • Another benefit is, if you have on premises Active Directory, and if you are planning to sync on premises AD users to Azure AD for the use of Hybrid Azure AD join, the current users & new users created will start showing a custom domain name (@endpointgeek.com) rather than ending with @manishtrial.onmicrosoft.com

Preparing yourself before performing steps

You must own the custom domain with any domain registrar such as Godaddy, Bluehost, hostgater etc. Hence, you need to register the domain and have to purchase it with any domain registrar.

Add custom domain

Sign in to Azure portal, navigate to Azure Active Directory. Scroll down on left pane to see Custom domain names, click on it, to open another blade and then click on Add custom domain. Provide the Custom domain name (I provided endpointgeek.com) and click on Add domain.

Add custom domain names

You will get the following details to verify:
Record type TXT
Alias or host name: @
Destination or points to address: MS=xxxxxxxxx
TTL: 3600

custom domain name txt

Don’t click on Verify right away, we need this DNS information to be provided under domain registrar with whom custom domain is registered. Or else you will get error:

Could not find the DNS record for this domain. DNS changes may take up to 72 hours to propagate. Please try again later.

Could not find the DNS Record

Navigate to Bluehost portal or any other portal where your domain name is registered. I am demonstrating about a specific domain registrar, the location may be different while browsing with others.

Click on Domains, under My Domains click Manage drop down menu and select DNS.

AddCustomDomain 03

Scroll down until you see TXT section, click on Add Record.

DNS txt Add Record

Provide Host Record as @, TXT Value as MS=ms86524431 (this is unique value for each verification for custom domain) and finally TTL as 1 day (as 3600 sec = 1 day). Click on Save.

AddCustomDomain 05

We can see the entries are added and listed.

AddCustomDomain 06

I have seen cases where it just takes just couple of hours to propagate the changes rather than waiting for 72 hours, I was quite luck that replication happened within 25-30 mins.

Let’s navigate back to Azure portal Custom domain names section. We will be seeing the custom domain name as Unverified status. Click on it to verify.

Custom domain name status unverified

This time Verify domain name succeeded with message Verification succeeded!. Click on Make Primary to make this custom domain as primary.

Note: We might see Failure to verify domain name again as it can take upto 72 hours, hence the only key at this moment is to verify if you have provided correct details under Domain registrar and just wait and relax.

Custom domain name make primary

Under “Custom domain names”, we can see our domain name showing as Verified.

Custom Domain name Status Verified

Let’s try creating new user, now we can see the UPN of the user is [email protected] while creating it. We can see the results before adding custom domain and after adding custom domain below:

New userAddCustomDomain 11