Azure DNS - What is DNS and How to Create Azure DNS Zone
Tags: azuredns, azurednszone, azurehosting
Published: 2021-03-16 15:52:58


#Azure DNS 

Azure DNS is one of the useful and good cloud services that Microsoft offers to its users. With Azure DNS, users especially web or Azure administrators can use it to host websites, manage DNS zones and records for your website domain’s DNS. Applications, APIs, and cloud services already hosted in the cloud, like Microsoft Azure can make use of Azure DNS for hosting. All in one place and resource group. This gives the advantage of better management of services.  

#Importance of DNS (Domain Name System)
Did you know that in every website address or URL you type on your web browser, there is public IP address and DNS (Domain Name System) behind it? 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w5wzesihyrx9vic581f.png)

I remember back in the end of 90’s – 2000’s when I was studying Computer Science in the Philippines, I was fascinated learning about the World Wide Web. It was pretty new back then, now it is the Internet that is a normal thing part of our lives and daily routine. Without it, it could have been different. 

Back in those good old days, I had to write HTML-syntax code to create web pages without an IDE, just notepads. There weren’t any fancy CSS nor Javascript frameworks neither. You had check every line of code to find where you missed some and wrote a wrong HTML syntax. In the old times, everything was simple. Simple websites, maybe looking boring, but creating one was so cool in those good old days. I wrote and published by first simple HTML web pages to be hosted at Lycos, which was pretty popular as search engine and web hosting in the late 90’s.


#The First Website was created in 1992
Tim Berners-Lee was the man I cannot forget learning about when I was studying computer science. Who is he? He is the great mind and man behind the creation of the WWW or the World Wide Web in March 1989. That was like 32 years ago! Can you imagine how our world and digitalization would be without the invention of the Internet? I was personally fascinated of it that studying and conducting a local community survey was my first thesis in college! I wish I still have those papers. 

In 1992, the first simple website on the web was created. It was plain and simple, but it marks our history and it still exists. You may visit it through this link: http://info.cern.ch/hypertext/WWW/TheProject.html

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/FirstWebsitewww.jpg)

#World Wide Web and the Internet 

>On Christmas day of 1990, Berners-Lee created the first successful communication between an HTTP client and a server. From there he designed and built the first Web browser, and the first Web page went live on August 6, 1991. While Berners-Lee is credited for the invention of the World Wide Web, he did not invent the Internet. The two are not one and the same. The Internet is a network of computer networks that spans the globe. It is the hardware and software that provides connections between multiple computers. The World Wide Web is just a service of the Internet. It's a bunch of interconnected documents and resources and their specific locations (via hyperlinks and URLs) online. - Business Insider 

#DNS or Domain Name System Explained 

{% youtube g5ND5uN5YnU %}

#Azure DNS for Cloud Hosting
If you own or administrate a domain or website, it is pretty normal that you are familiar that setting up the DNS Zone settings and records in website domains. In every website that we visit, there is a public IP address behind it which is also called DNS (Domain Name Server). In the world of internet where we are all relying on these days, DNS technology have an important role. 

>Azure DNS provides a globally distributed, high-availability name server infrastructure, which you can use to host your domain. By hosting your domains in Azure DNS, you can manage your DNS records with the same credentials, APIs, tools, billing, and support as your other Azure services. Azure DNS does not currently support purchasing of domain names. If you want to purchase a domain name, you need to use a third-party domain name registrar. The registrar typically charges a small annual fee. The domains can then be hosted in Azure DNS for management of DNS records. See Delegate a Domain to Azure DNS for details. - Microsoft Documentation for Azure DNS

#Creating a DNS Zone in Azure

A DNS zone is used to host the DNS records for a particular website domain.

For example, my website [“jonahandersson.tech”](https://jonahandersson.tech/azure-dns-how-to-create-dns-zone-and-record-set/) contains some of DNS records for my mail server and for my website. So, if I were to host my existing domain in Azure, I would need to make use of the Azure DNS service.  The service would allow me to host my DNS zone and manage my DNS records, and provides name servers. The name services are used for DNS queries.

To create a DNS Zone in Azure, you would need to be an Azure Admin or Azure User with valid subscription. Create a new resource and search for DNS Zone. Select the right Azure Subscription, Resource Group and for the Instance Details, you would need to choose and fill in the desired DNS Zone name like my example below and set up your resource location.

**Create a DNS Zone resource on Azure Portal**

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/CreateDNSZOne.png)

**The DNS Zone shows the DNS information like name services and records after its creation**

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/JonahsDNSZone-2048x1125.png)

#Creating A-Record and DNS Record Sets

When the DNS zone was created, some DNS record sets are also necessary to be added.  Especially the first and primary record set for the DNS, A-record.

A-record is the primary record to be create first.  

So what is A-record? 

A-record is the record contains the pairing between the IP address and the domain name. It can have more than one entries usually known as record sets. In record sets, the domain name remains constant, while the IP addresses are different. [Learn more about DNS Record and Aliases](https://docs.microsoft.com/en-us/azure/dns/dns-alias?WT.mc_id=AZ-MVP-5004251).

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/AddRecordSetinDNSZone-2048x1001.png)

#Verifying Azure DNS Zone Configuration
In my example above, I do not have the real domain like www.wideworldimportsjonahandersson.com yet, but I could create the DNS Zone in Azure to start with as a demo and learning example. 

In practical and real life situation,  you would need to update the NS (Name Server) records of the domain-name registrar, to delegate the domain to Azure after you created a DNS Record. 

So, even without any registered domain name officially registered yet, it is possible to if you did your Azure DNS configuration correctly.  One of the ways to verify it is using the NSLookup tool directly using the command line tool in the cloud like Azure CLI on Azure Portal. 

Using the nslookup command below with your DNS Zone name and one of your Name Servers, you will be able to verify if your configuration for the Azure DNS zone was correct. You should be getting back the IP address you set up when you started. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crnidazyr9n280ejuuot.PNG)

#Adding Alias Record Set for Public IP
After adding the A-record, you would also need to add an Alias record for your public IP. This is necessary so that you can access your DNS over the Internet on any web browser. 

Assuming that you have an existing application hosted already in Azure with an Azure Virtual Machine with NICs , VNet, an assigned public IP adress, you can associate that public IP address in your new Alias record set in your DNS Zone settings. 

To add a new record set, click add Record Set + and complete the necessary information like the example below. 

**Create another record set for public IP with Alias Type Resource** 

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/AliasRecordDNS.png)

**Check your existing Public IP address for your application hosted in a VM (Example)**
![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/PublicIPadd.png)

**Access the application using the DNS IP Address that was set as a DNS alias**

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/CopyIpaddress.png)

![Alt Text](https://azcdnendpointjonahanderssontech.azureedge.net/wp-content/uploads/TestWebsiteDNSIP.png)

#Learning Resources
* [What is Azure DNS?](https://docs.microsoft.com/en-us/azure/dns/dns-overview?WT.mc_id=AZ-MVP-5004251)
* [Azure DNS Documentation by Microsoft]( https://docs.microsoft.com/en-us/azure/dns?WT.mc_id=AZ-MVP-5004251)
* Azure DNS YouTube Video by Intellipat – [Azure DNS | What is DNS Server | How DNS Server works](https://www.youtube.com/watch?v=SpFmpIvtFbM)


I hope you learned something and interested to learn more.
If you like this article, please re-share the knowledge!

Feel free to leave feedback and ask questions.

-----------------------------

**About Author:** 
*Jonah Andersson is a Filipina-Swedish Software Developer who codes full stack system development in C# .NET/NET Core. She currently works as a Software Developer Consultant at Forefront Consulting in Sweden. Jonah is passionate about continuous learning, developing and sharing knowledge about Microsoft Azure cloud technologies. She one of the #AzureHeroes in Sweden. A woman who codes in tech who enjoys writing, advocating gender equality in the tech industry through mentorship and by being role model on her spare time.*

Follow me [Twitter](https://twitter.com/cjkodare), connect via my [LinkedIn](https://linkedin.com/in/jonahandersson) and visit my [website](https://jonahandersson.tech/)


----------
**NOTE: This article was originally and first published on my website** [https://jonahandersson.tech](https://jonahandersson.tech/azure-dns-how-to-create-dns-zone-and-record-set?WT.mc_id=AZ-MVP-5004251)