Exercise - Create a DNS zone and an A record by using Azure DNS
In the previous unit, we described setting up and configuring the wideworldimports.com domain to point to your Azure hosting on Azure DNS.
In this unit, you'll:
- Set up an Azure DNS and create a public DNS zone.
- Create an A record.
- Verify that the A record resolves to an IP address.
Create a DNS zone in Azure DNS
Before you can host the wideworldimports.com domain on your servers, you need to create a DNS zone. The DNS zone holds all the configuration records associated with your domain.
To create your DNS zone:
Sign in to the Azure portal with the account you used to activate the sandbox.
On the Azure home page, under Azure services, select Create a resource. The Create a resource pane appears.
In the Search services and marketplace search box, search for and select DNS zone by Microsoft. The DNS zone pane appears.
The Create DNS zone pane appears.
On the Basics tab, enter the following values for each setting.
Setting Value Project details Subscription Concierge subscription Resource group From the dropdown list, select [sandbox resource group] Instance details Name The name needs to be unique in the sandbox. Use
wideworldimportsXXXX.comwhere you replace the Xs with letters or numbers.
Select Review + create.
After validation passes, select Create. It will take a few minutes to create the DNS zone.
When deployment is complete, select Go to resource. Your DNS zone pane appears.
By default, the NS and SOA record sets are automatically created and automatically deleted whenever a DNS zone is created or deleted. The NS record set defines the Azure DNS namespaces and contains the four Azure DNS records. You use all four records when you update the registrar.
The SOA record represents your domain, and is used when other DNS servers are searching for your domain.
Make a note of the NS record values. You'll need them in the next section.
Create a DNS record
Now that the DNS zone exists, you need to create the necessary records to support the domain.
The primary record set to create is the A record. The A record set is used to point traffic from a logical domain name to the hosting server's IP address. An A record set can have multiple records. In a record set, the domain name remains constant, while the IP addresses differ.
On the DNS zone pane for wideworldimportsXXXX.com, in the top menu bar, select + Record set.
The Add record set pane appears.
Enter the following values for each setting.
Setting Value Description Name www The host name that you want to resolve to an IP address. Type A The A record is the most commonly used. If you're using IPv6, select the AAAA type. Alias record set No This can only be applied to A, AAAA, and CNAME record types. TTL 1 The time-to-live, which specifies the period of time each DNS server caches the resolution before it's purged. TTL unit Hours This value can be seconds, minutes, hours, days, or weeks. Here, you're selecting hours. IP Address 10.10.10.10 The IP address the record name resolves to. In a real-world scenario, you would enter the public IP address for your web server.
Select OK to add the record to your zone.
Note that it's possible to have more than one IP address set up for your web server. In that case, you'd add all the associated IP addresses as records in the A record set. After it's created, you can update the record set with additional IP addresses.
Verify your global Azure DNS
In a real-world scenario, after you create the public DNS zone, you'll update the NS records of the domain-name registrar to delegate the domain to Azure.
Even though we don't have a registered domain, it's still possible to verify that the DNS zone works as expected, by using the
Use nslookup to verify the configuration
Here's how to use
nslookup to verify the DNS zone configuration.
Use Cloud Shell to run the following command. Replace the DNS zone name with the zone you created, and replace
<name server address>with one of the NS values you copied after you created the DNS zone.
nslookup www.wideworldimportsXXXX.com <name server address>
The command should look something like the following:
nslookup www.wideworldimportsXXXX.com ns1-04.azure-dns.com
You should see that your host name
www.wideworldimportsXXXX.comresolves to 10.10.10.10.
You have successfully set up a DNS zone and created an A record.
Need help? See our troubleshooting guide or provide specific feedback by reporting an issue.