Tutorial: Configure an alias record to support apex domain names with Traffic Manager
You can create an alias record for your domain name apex to reference an Azure Traffic Manager profile. An example is contoso.com. Instead of using a redirecting service, you configure Azure DNS to reference a Traffic Manager profile directly from your zone.
In this tutorial, you learn how to:
- Create a host VM and network infrastructure.
- Create a Traffic Manager profile.
- Create an alias record.
- Test the alias record.
If you don’t have an Azure subscription, create a free account before you begin.
You must have a domain name available that you can host in Azure DNS to test with. You must have full control of this domain. Full control includes the ability to set the name server (NS) records for the domain.
For instructions on how to host your domain in Azure DNS, see Tutorial: Host your domain in Azure DNS.
The example domain used for this tutorial is contoso.com, but use your own domain name.
Create the network infrastructure
First, create a virtual network and a subnet to place your web servers in.
- Sign in to the Azure portal at https://portal.azure.com.
- In the upper left in the portal, select Create a resource. Enter resource group in the search box, and create a resource group named RG-DNS-Alias-TM.
- Select Create a resource > Networking > Virtual network.
- Create a virtual network named VNet-Servers. Place it in the RG-DNS-Alias-TM resource group, and name the subnet SN-Web.
Create two web server virtual machines
- Select Create a resource > Windows Server 2016 VM.
- Enter Web-01 for the name, and place the VM in the RG-DNS-Alias-TM resource group. Enter a username and a password, and select OK.
- For Size, select an SKU with 8-GB RAM.
- For Settings, select the VNet-Servers virtual network and the SN-Web subnet.
- Select Public IP address. Under Assignment, select Static, and then select OK.
- For public inbound ports, select HTTP > HTTPS > RDP (3389), and then select OK.
- On the Summary page, select Create. This procedure takes a few minutes to finish.
Repeat this procedure to create another virtual machine named Web-02.
Add a DNS label
The public IP addresses need a DNS label to work with Traffic Manager.
- In the RG-DNS-Alias-TM resource group, select the Web-01-ip public IP address.
- Under Settings, select Configuration.
- In the DNS name label text box, enter web01pip.
- Select Save.
Repeat this procedure for the Web-02-ip public IP address by using web02pip for the DNS name label.
Install IIS on both Web-01 and Web-02.
- Connect to Web-01, and sign in.
- On the Server Manager dashboard, select Add roles and features.
- Select Next three times. On the Server Roles page, select Web Server (IIS).
- Select Add Features, and select Next.
- Select Next four times. Then select Install. This procedure takes a few minutes to finish.
- When the installation finishes, select Close.
- Open a web browser. Browse to localhost to verify that the default IIS web page appears.
Repeat this procedure to install IIS on Web-02.
Create a Traffic Manager profile
- Open the RG-DNS-Alias-TM resource group, and select the Web-01-ip Public IP address. Note the IP address for later use. Repeat this step for the Web-02-ip public IP address.
- Select Create a resource > Networking > Traffic Manager profile.
- For the name, enter TM-alias-test. Place it in the RG-DNS-Alias-TM resource group.
- Select Create.
- After deployment finishes, select Go to resource.
- On the Traffic Manager profile page, under Settings, select Endpoints.
- Select Add.
- For Type, select External endpoint, and for Name, enter EP-Web01.
- In the Fully qualified domain name (FQDN) or IP text box, enter the IP address for Web-01-ip that you noted previously.
- Select the same Location as your other resources, and then select OK.
Repeat this procedure to add the Web-02 endpoint by using the IP address you noted previously for Web-02-ip.
Create an alias record
Create an alias record that points to the Traffic Manager profile.
- Select your Azure DNS zone to open the zone.
- Select Record set.
- Leave the Name text box empty to represent the domain name apex. An example is contoso.com.
- Leave the Type as an A record.
- Select the Alias Record Set check box.
- Select Choose Azure service, and select the TM-alias-test Traffic Manager profile.
Test the alias record
- From a web browser, browse to your domain name apex. An example is contoso.com. You see the IIS default web page. Close the web browser.
- Shut down the Web-01 virtual machine. Wait a few minutes for it to completely shut down.
- Open a new web browser, and browse to your domain name apex again.
- You see the IIS default web page again, because Traffic Manager handled the situation and directed traffic to Web-02.
Clean up resources
When you no longer need the resources created for this tutorial, delete the RG-DNS-Alias-TM resource group.
In this tutorial, you created an alias record to use your apex domain name to reference a Traffic Manager profile. To learn about Azure DNS and web apps, continue with the tutorial for web apps.
Send feedback about: