Importing DNS records into Azure DNS Zone
Importing DNS records into Azure DNS Zone Spanish version: https://madsblog.net/2023/08/27/importar-registros-dns-a-azure-dns-zone/ In this article, we will import DNS records from a DNS Zone hosted on GoDaddy into a zone created in Azure D

Spanish version: https://madsblog.net/2023/08/27/importar-registros-dns-a-azure-dns-zone/
In this article, we will import DNS records from a DNS Zone hosted on GoDaddy into a zone created in Azure DNS.
Prerequisites:
Before starting:
- We must have our DNS Zone created in Azure.
- Very important! Find out who the Domain Registrar and DNS provider are for our Domain.
- We must have access credentials for the DNS provider. Without this access, this procedure will not be possible.
What is a Domain Registrar?
A domain registrar is a company or entity authorized to sell and register domain names for end-users. When you purchase a domain name, you are doing business with a domain registrar. Registrars work with central bodies called registries that manage a specific TLD (such as .com, .org, .net). When you register a domain, the registrar communicates with the corresponding registry to ensure the domain is available and registers it on your behalf.
What is a DNS Provider?
A DNS provider is an entity or service that maintains the infrastructure of DNS servers and responds to queries to resolve domain names into IP addresses. While all domain registrars offer DNS services as part of their basic package, not all DNS services are linked to a registrar. Many companies specialize exclusively in providing DNS services, especially for high-traffic websites or applications with specific name resolution needs. In your domain settings, you can configure the name servers (NameServers) to point to a specific DNS provider. This determines who responds to queries when someone tries to access your website or sends an email to your domain.
Export DNS file
But… what is a DNS File?
Essentially, it’s a file formatted in a specific way that contains the description of the DNS records hosted in the Zone. Within this file, we will find a description of the zone records based on RFC standards. They look like this:

In this scenario, we will export the DNS file from Madsblog.net, whose DNS provider is GoDaddy. If your DNS provider is different, you must look up the provider’s documentation on how to download the DNS file:
- Log into GoDaddy.
- Access the DNS Zone of our domain.

- Click on more actions and select “Export Zone File”.

This will save a TXT file with the domain name.

Install Azure CLI
Now we need to import the DNS file to our zone. For this, we don’t have a built-in tool from the Azure Portal. We must do it from the Azure CLI:
- Download the installer https://aka.ms/installazurecliwindowsx64.
- Verify it’s installed by running az –version in Cmd.

Log in to Azure via CLI
We need to log in to our Azure tenant and subscription. For this, enter the following commands in Azure CLI:
- az login

- az account list –output table

- az account set –subscription <SubscriptionId>

- az network dns zone list –output table

Import our DNS file to our zone in Azure DNS
Now we’ll import all the records from our DNS file to our new DNS zone in Azure. To do this, execute the following command:
az network dns zone import -g <resource group> -n <zone name> -f <zone file name>

You can verify that our DNS Zone in Azure is now updated with the new records.

Change NameServers in Domain Registrar
Important note: the Zone’s NameServers are changed to those of Azure. To change the DNS hosting of the zone on the internet to point to our new Azure zone, it’s necessary to change the NameServers in our Domain Registrar.

For this, log in with our domain registrar credentials and modify the NS specifying those indicated in our DNS zone. Once this is changed in our domain registrar and replicated on the internet, we can see the query activity in the metrics of our DNS Zone.


Thanks for reading. The learning continues in the next article.


