Azure DNS zones
What, Why, and How to Set Up DNS Zones in Azure!
What are Azure DNS Zones?
Azure DNS is a resource inside the Azure portal. It allows you to manage your DNS settings directly within the portal. With Azure DNS, you can host your DNS domains alongside your Azure applications, providing seamless integration and management. It supports all common DNS record types and offers high availability and performance.
Benefits using DNS zones
In my experience, the static web app was easily created with a custom domain, as the necessary records were automatically generated when I added the domain. Both www.codecraftingazure.com and codecraftingazure.com were set up, and you also receive a free SSL/TLS certificate for custom domains. Additionally, using Azure DNS zones ensures high availability and performance, simplifies DNS management, and integrates seamlessly with other Azure services.
Prerequisite
Creating the DNS Zone
You can create DNS zones in the Azure portal. When creating one, remember to match the DNS zone name with the domain.com. This ensures that your DNS settings are correctly aligned with your domain name. Additionally, Azure provides an intuitive interface to guide you through the process, making it easy to manage and configure your DNS zones.
Settings up the DNS zone
After setting up the DNS zones, you can modify the DNS settings on the domain provider’s portal. From my experience, there is a setting in the portal called Nameserver or NS settings. When you change the name server, make sure to copy the Name server 1, Name server 2, Name server 3, and Name server 4 values to ensure they match exactly what you have been provided in the Nameserver or NS settings. These values can be found in the Azure portal under the DNS zones overview tab. As you are forwarding the domain server to Azure, you don’t need to make any record changes in the DNS, and Azure automatically creates NS records in your DNS zone. This simplifies the process and ensures that your DNS settings are correctly configured.
Verifying the setup
After setting up the DNS zone, you can verify the changes simply by using nslookup from your
command prompt, terminal, or PowerShell.
Type in nslookup -type=SOA yourdomain.com
In my case, it returned:
codecraftingazure.com
primary name server = ns1-06.azure-dns.com
responsible mail addr = azuredns-hostmaster.microsoft.com
serial = 1
refresh = 3600 (1 hour)
retry = 300 (5 mins)
expire = 2419200 (28 days)
default TTL = 300 (5 mins)
If you receive a similar response, or if you navigate to the DNS zone in your Azure
portal and click on Recordsets, then look for type: SOA. The values should be
similar to what is listed here. Once verified, the setup is complete. You can now control your
record sets in the portal, and from my experience, some resources automatically adjust the records
needed.