Azure DNS

Azure DNS

ยท

5 min read

Azure DNS is a hosting service for DNS domains that provides name resolution by using Microsoft Azure infrastructure. By hosting your domains in Azure, you can manage your DNS records by using the same credentials, APIs, tools, and billing as your other Azure services.

You can't use Azure DNS to buy a domain name. For an annual fee, you can buy a domain name by using App Service domains or a third-party domain name registrar like GoDaddy. Your domains then can be hosted in Azure DNS for record management.

Image by Microsoft Learn

Domain Names

The Domain Name System is a hierarchy of domains. The hierarchy starts from the 'root' domain, whose name is simply '.'. Below this comes top-level domains, such as 'com', 'net', 'org', 'uk' or 'jp'. Below the top-level domains are second-level domains, such as 'org.uk' or 'co.jp'. The domains in the DNS hierarchy are globally distributed, and hosted by DNS name servers around the world.

A domain name registrar is an organization that allows you to purchase a domain name, such as teckbakers.com. Purchasing a domain name gives you the right to control the DNS hierarchy under that name, for example allowing you to direct the name www.teckbakers.com to your company website. The registrar may host the domain on its name servers on your behalf, or allow you to specify alternative name servers.

Azure DNS currently doesn't support purchasing 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 the management of DNS records.

DNS zones

A DNS zone is used to host the DNS records for a particular domain. To start hosting your domain in Azure DNS, you need to create a DNS zone for that domain name. Each DNS record for your domain is then created inside this DNS zone.

For example, the domain 'teckbakers.com' may contain several DNS records, such as 'mail.teckbakers.com' (for a mail server) and 'www.teckbakers.com' (for a website).

When creating a DNS zone in Azure DNS:

  • The name of the zone must be unique within the resource group, and the zone must not exist already. Otherwise, the operation fails.

  • The same zone name can be reused in a different resource group or a different Azure subscription.

  • Where multiple zones share the same name, each instance is assigned different name server addresses. Only one set of addresses can be configured with the domain name registrar.

DNS records

Record Names

In Azure DNS, records are specified by using relative names. A fully qualified domain name (FQDN) includes the zone name, whereas a relative name does not. For example, the relative record named www in the zone teckbakers.com gives the fully qualified record name www.teckbakers.com.

Record Types

Each DNS record has a name and a type. Records are organized into various types according to the data they contain. The most common type is an 'A' record, which maps a name to an IPv4 address. Another common type is an 'MX' record, which maps a name to a mail server. Azure DNS supports all common DNS record types: A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, and TXT.

Record Sets

Sometimes you need to create more than one DNS record with a given name and type. For example, suppose the 'www.teckbakers.com' website is hosted on two different IP addresses. The website requires two different A records, one for each IP address. Here is an example of a record set:

www.teckbakers.com        3600    IN    A    134.178.185.46
www.teckbakers.com        3600    IN    A    134.178.188.221

Time-to-live

The time to live, or TTL, specifies how long each record is cached by clients. In the above example, the TTL is 3600 seconds or 1 hour.

Practical

Now let's create a DNS zone where all the DNS entries or records will be stored.

Login into your Azure Portal and create a Resource Group named DNSPractical.

Now create a DNS zone (you need to just search for the required service on the azure portal and click on create) shown below and keep other tabs and settings untouched.

Now let's create a DNS record and put it to the test.

Create DNS entries or records for your domain inside the DNS zone. Create a new address record or 'A' record to resolve a hostname to an IPv4 address.

To create an 'A' record:

On the Add record set page, type or select the following values:

For this quickstart example, type 10.10.10.10. This value is the IP address the record name resolves to. In a real-world scenario, you would enter the public IP address for your web server.

Test the name resolution

Go to the Overview tab of the DNS zone and copy one of the Name Servers. Name servers translate the domain name into an IP address.

Now open your command prompt and paste the following command

nslookup www.teckbakers.com <name server name>

nslookup is a network administration command-line tool for querying the Domain Name System to obtain the mapping between the domain name and IP address or other DNS records.

Instead of <name server name> paste the Name Server 1.

You should see something like the following screen:

The hostname teckbakers.com resolves to 10.10.10.10, just as you configured it. This result verifies that name resolution is working correctly.

Don't forget to clean resources, you can delete the resource group, it deletes all the resources we created inside that group.

That's all for this blog and stay tuned for more computing services tutorials and more such tech. Make sure to subscribe to our newsletter.

Thank you for Reading:)

#Happy Reading!๐Ÿ‘

If you have any doubts or suggestions please comment down below - Gayatri Barhate

ย