In this article, you will be learning about Azure DNS Zones, How we can create a DNS Zone in the Azure portal, some of the records sets present in Azure SNS zones along the workflow of DNS requests. Before we move on, let us understand what DNS is and why we use DNS in the real world.
What is DNS?
DNS Stands for Domain Name System and is used to resolve names (like google.com, facebook.com, etc.) to IP Addresses. To keep it simple Domain Name system is like a Telephone directory where peoples phone numbers are mapped to the individuals just that telephone directory has numbers and names of individuals, Domain Name System is the directory of the Internet which stores domain names like google.com and facebook.com and IP addresses so that the end-users can load the webpages.
Now talking about Domain Names, Domain names should be unique globally. Why do we need a Domain Name? Say, for instance, starting tomorrow if Google asks you to use an IP address instead of google.com to use their search engine. Will you like it? I personally don’t. It’s not user-friendly and difficult to remember for end-users. As an admin, if I need to change IP for some reason in the future, the IP needs to be shared with everyone all over again, which is not a right/efficient way of doing it.
Domain Names should be registered with Domain name registrars. Registrars are those companies authorized to reserve a domain name and provide services required for a domain for a fee. There are so many registrars in the market; a few of them would be GoDaddy, WordPress, Wix, etc.
What are Azure DNS Zones?
DNS Zones is a service provided by Microsoft in Azure Portal. You can map your public Domains with your Azure DNS Zones and webservers to publish your Web Apps using DNS Zones.
There are two types of DNS Zones services in Azure
- DNS Zone: This service requires internet and it resolves names over the Internet. If you would like to host a domain in Azure you will need a DNS Zone mapped to that domain which we will be looking at it in detail.
- Private DNS Zones: This service does not require internet. It is usually used at the Intranet level over Virtual Networks. You do not need a public domain
Steps to create DNS Zone
- Search for DNS Zones in Azure portal.
2. Click on Create.
3. Enter all the required details like the name for DNS Zone, resource group and then Click on Review + Create.
4. Click on Create after validation is passed.
5. Once DNS Zone is created in the Azure, you will see two records highlighted below.
- SOA: SOA stands for Start of Authority record. It holds the details of the Primary DNS server which is responsible for domain name resolution.
- NS: NS stands for Name server record. It is a combination of Primary + secondary DNS Server.
NOTE! It would help if you had a domain name created with Domain registrars to map the name servers with Domain Names. Here I have already created a domain name arunkashokan.com for testing.
Mapping Name servers created in DNS Zones with Domain Name
Now, we have the DNS zone created; you need to establish a link between your DNS zone in Azure and Domain name in your registrar. To establish the link, you need to add the name servers from the DNS Zones in the DNS Management Section of the Domain Name, hosted with the registrar. In my case, it was GoDaddy where I created the domain. Hence I am adding the screenshot of the same below.
Now, you might have a question saying, why are we adding 4 name servers? Won’t one name server suffice to process the request? Yes, it will be enough, but we are adding it to make the website highly fault-tolerant and increase availability.
Testing the Webserver
I already have a Webserver created in Azure with just an index page showing a line “Azure DNS Zones.” Below is how you see when you try to access the Webserver using an IP, but this is not how we want it; we need it with the domain name “arunkashokan.com,” which we created, and for that to happen, we need to add a record set in the DNS Zone.
Adding record set to a DNS Zone
Now that we have a domain name and DNS Zone linked, we need to add the IP of our web server in the Type A record set of your Azure DNS. Let’s look at the steps to create a recordset to add our IP address that needs to be resolved.
- Click on Create Set in the DNS Zone which was created.
2. Select Type A – Alias record to IPv4 address and enter IP of your web server that you would like to resolve and click on OK.
3. After clicking on OK record set will be created, and you should see the entry in the DNS Zone as highlighted below.
4.Now, let’s go ahead and try with the Domain name “arunkashokan.com” that we created. We should see the same output as we did with the IP address.
There You Go! You should be able to resolve your domain name with the IP address that you mapped successfully.
Workflow of Domain Name System
Now that we can browse the web page successfully let’s try to understand what happens in the background, i.e., how the domain name resolution happens for the first time. Below is the workflow with the domain name we created in this article arunkashokan.com
- User is tries to access the website named arunkashokan.com
- Request is forwarded to the Local cache of the system. When the user is trying to access the website for first time. Local cache will not have the IP Address of the website.
- If IP is not present with Local cache, request will then be forwarded to the Router DNS which will again forward it to ISP DNS and from there to the dot(.) which is called Root DNS.
- Root DNS will forward the request to TLD’s (Top Level Domain) like .com, .org, .in etc.
- TLD’s forward the request to the Domain Registrars like GoDaddy, WordPress etc. In our case it is GoDaddy which contains the name servers of our Azure DNS.
- Using name servers of our Azure DNS request will be forwarded to our Azure DNS Zone which contains the IP of Webserver in the record set we created and thereby the request is forwarded to Webserver and the user will be able to view the webpage.
That brings us to the end of this post; in the next post, we will look at the Private DNS Zones where we can create Domain names at the intranet level.