How to configure custom domain for Azure Active Directory.

Spi3er
5 min readDec 6, 2020

Hey,

This article is about how you can configure your custom domain to Azure AD so that you can use your own domain for your business purpose etc..

Requirements

  1. Your domain
  2. Premium License (P1 or P2)
  3. Brain

So let’s solve the 1st requirement i.e you need your own domain.

  1. Go to www.freenom.com [Domain registrar]
  2. Register for an account
  3. Go to https://my.freenom.com/domains.php
  4. Enter a domain you want but remember to use the TLD such as .tk .ml because they are free of cost and you don’t need to pay a penny.
  5. So enter a domain like AzureFun.tk
Choosing Domain

6.Click on Checkout and click on Continue

7.You should see the page as below :

Checkout

8.Tick box the Terms and conditions and click on Complete order.

9.Now go to https://my.freenom.com/clientarea.php?action=domains to see the domain you have just bought for free.

So you now successfully have your own domain.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Now let’s solve the Second requirement i.e License for Azure AD.

→If you do not have a premium license , you will for sure get an error while you add a custom domain so you need to have a Azure Tenant with a subscription attached to it and then you need to go to licenses in the Tenant as below :

License

You can see that I already have a Premium P2 license so I can configure my custom domain now , but if you do not have one then click on. “Try/Buy” and click on activate free trial and you will be able to use P2 License.

So let’s dive into the main issue:

Configuring Custom domain for Azure AD

  1. Go to your Azure AD by using search bar.
  2. Now click on “Custom domain names” on the bar of the left side
Custom domain

3.Click on Add custom domain which is on the top.

Entering custom domain name

4.Enter your custom domain name what you made in freenom , in my case it is “azurefun.tk” (Enter without quotations).

5.Click on Add domain and you will see the below.

TXT record

6.Click on MX i.e MX is a DNS record basically used to verify the ownership of our domain.

7.So you should see this when you click on “MX”

MX record

8.Now copy all those details in a notepad i.e the hostname , destination , TTL and Priority. You need to enter all of these details in your Azure DNS Zone. Keep this tab open for now.

9.Now add a new tab in google chrome and go to search bar of Azure and enter Dns Zones.

10.Click on it and click on Add and choose a Resource group and enter Name as “azurefun.tk” , in your case it should be your domain name which u bought for free in freenom.

DNS Zone

11.Click on Review+Create and Go to the Dns Zone created.

12.Click on +Record Set and add the details which you have copied before i.e the MX record details.

Adding MX record to DNS Zone

13.Click on Ok after you enter the details .Now you have successfully added the MX record to the DNS zone of azurefun.tk in Azure.

14.Now since we have added the MX record in Azure DNS Zone , we need to now copy the DNS Servers of Azure and paste them in “Nameservers” settings of Freenom domain.

15.So go to the your DNS Zone again in Azure and you should see the nameservers as below:

Azure DNS

16.Go to Freenom now and go to your domain and copy each Azure Nameservers and paste them in your freenom domain Nameserver settings.

Managing domain in Freenom

17.Click on Management tools and you should see Nameservers.

18.Click on use custom nameservers and you should see this:

Nameservers in Freenom

19.Click on Change Nameservers and you will see the changes are saved.

20.Now go to the tab which you left at the start i.e the verify domain tab

Verify domain now

21.Click on Verify now and you should see this.

Done

22.We have successfully added our custom domain to Azure AD now . To verify it you can go to Users in Azure AD and click on Create New User and you should see it as below:

Checking it

23.So now we have clearly seen that we can create new users with the custom domain we have added just now.

So that concludes this article , good luck with trying this out.

Stay tuned for more interesting articles!

--

--

Spi3er

Just a geek playing around with cloud and security.