Using Azure DNS to implement custom domain settings

  1. Home
  2. Using Azure DNS to implement custom domain settings

Return to AZ-104 Tutorial

On this page, about custom domain and how Azure DNS provides DNS for a custom domain for any of your Azure resources that maintain custom domains or that have a fully equipped domain name (FQDN). So, let’s begin.

Prerequisites for custom domain

Only if the Azure AD admin was setup for Azure SQL Database, SQL Managed Instance, or Azure Synapse is Azure AD authentication available. Existing Azure Active Directory users established earlier inside SQL Server will no longer be able to login to the database using their Azure Active Directory credentials if the Azure Active Directory admin is removed from the server.

In the same vein, you can configure a vanity or custom domain for Azure Function Apps, Public IP addresses, App Service (Web Apps), Blob Storage, and Azure CDN.

Azure Function App

  • In order to configure a custom domain for Azure function apps, create a record called CNAME.
  • Now navigate to Function App and select the function app. Click Platform features, then Custom domains under Networking.
function app blade

Note: This address is used as the alias for the DNS record produced and can be seen on the Custom domains blade.

custom domain blade
  • Navigate to your DNS Zone and click + Record set. To generate a record set, fill out the following information on the Add record set blade and click OK.
PropertyValueDescription
NamemyfunctionappThis value along with the domain name label is the FQDN for the custom domain name.
TypeCNAMEUse a CNAME record is using an alias.
TTL11 is used for 1 hour
TTL unitHoursHours are used as the time measurement
Aliasadatumfunction.azurewebsites.netThe DNS name you are creating the alias for, in this example it is the adatumfunction.azurewebsites.net DNS name provided by default to the function app.
  • Go back to your function app, select Platform features, and below Networking click Custom domains, then under Custom Hostnames click + Add hostname.
  • Select the CNAME record in the hostname text box on the Add hostname blade and click Validate. To add the alias, click Add hostname.
function apps add host name blade

Public IP address

  • To configure a custom domain for services, use load Balancer, Cloud Service, Resource Manager VMs, and, Classic VMs.
  • Now, go to Networking > Public IP address, pick the Public IP resource and click Configuration. Notate the IP address shown.
public ip blade
  • Move to your DNS Zone and click + Record set. Fill out the following information on the Add record set blade and click OK to create it.
PropertyValueDescription
NamemywebserverThis value along with the domain name label is the FQDN for the custom domain name.
TypeAUse an A record as the resource is an IP address.
TTL11 is used for 1 hour
TTL unitHoursHours are used as the time measurement
IP Address<your ip address>The public IP address.
create an A record
  • Once the A record is created, run nslookup to verify the record resolves.
public ip dns lookup

App Service (Web Apps)

The below-mentioned steps will take you through configuring a custom domain for an app service web app.

  • Visit the App Service and select the resource you are configuring a custom domain name, and click Custom domains.
    • On the Custom domains blade, take note of the current url; this URL will be used as the alias for the DNS record you just established.
custom domains blade
  • Move to your DNS Zone and click + Record set. Fill out the following information on the Add record set blade and click OK to create it.
PropertyValueDescription
NamemywebserverThis value along with the domain name label is the FQDN for the custom domain name.
TypeCNAMEUse a CNAME record is using an alias. If the resource used an IP address, an A record would be used.
TTL11 is used for 1 hour
TTL unitHoursHours are used as the time measurement
Aliaswebserver.azurewebsites.netThe DNS name you are creating the alias for, in this example it is the webserver.azurewebsites.net DNS name provided by default to the web app.
custom domain create a CNAME record
  • Navigate back to the app service that is configured for the custom domain name. Click Custom domains, then click Hostnames. To add the CNAME record you created, click + Add hostname.
figure 1
  • After the completion of the process, run nslookup to validate name resolution is working.
custom domain

Blob storage

The asverify method is used to configure a CNAME record for a blob storage account in the steps below. There is no downtime using this strategy.

  • Go to Storage > Storage Accounts, click your storage account, and select Custom domain.
blob storage custom domain
  • Visit the DNS Zone and click + Record set. After this, fill out the following information on the Add record set blade and click OK to create it.
PropertyValueDescription
Nameasverify.mystorageaccountThis value along with the domain name label is the FQDN for the custom domain name.
TypeCNAMEUse a CNAME record is using an alias.
TTL11 is used for 1 hour
TTL unitHoursHours are used as the time measurement
Aliasasverify.adatumfunctiona9ed.blob.core.windows.netThe DNS name you are creating the alias for, in this example it is the asverify.adatumfunctiona9ed.blob.core.windows.net DNS name provided by default to the storage account.
  • Move back to the storage account by clicking Storage > Storage Accounts, pick the storage account and click Custom domain. Now, type in the alias you created without the asverify prefix in the text box, check to Use indirect CNAME validation and click Save. Once this step is complete, return to your DNS zone and create a CNAME record without the asverify prefix. After that point, you are safe to delete the CNAME record with the cdnverify prefix.
blob storage custom domain

Azure custom domain

The cdnverify method is used to configure a CNAME record for a CDN endpoint in the steps below. There is no downtime using this strategy.

Practice Test for AZ-104
  • Navigate to Networking > CDN Profiles, select your CDN profile.
  • Select the endpoint you are working with and click + Custom domain. Note the Endpoint hostname as this value is the record that the CNAME record points to.
CDN custom domain
  • Visit your DNS Zone and click + Record set. After that, fill out the following information on the Add record set blade and click OK to create it.
PropertyValueDescription
Namecdnverify.mycdnendpointThis value along with the domain name label is the FQDN for the custom domain name.
TypeCNAMEUse a CNAME record is using an alias.
TTL11 is used for 1 hour
TTL unitHoursHours are used as the time measurement
Aliascdnverify.adatumcdnendpoint.azureedge.netThe DNS name you are creating the alias for, in this example it is the cdnverify.adatumcdnendpoint.azureedge.net DNS name provided by default to the storage account.
  • Move back to your CDN endpoint by clicking Networking > CDN Profiles, and select your CDN profile. Click + Custom domain and enter your CNAME record alias without the cdnverify prefix and click Add.
  • After completion, return to your DNS zone and create a CNAME record without the cdnverify prefix. After that point, you are safe to delete the CNAME record with the cdnverify prefix. 

Reference: Microsoft Documentation

Return to AZ-104 Tutorial

Menu