Migrate an active DNS name to Azure App Service
This article shows you how to migrate an active DNS name to Azure App Service without any downtime.
When you migrate a live site and its DNS domain name to App Service, that DNS name is already serving live traffic. You can avoid downtime in DNS resolution during the migration by binding the active DNS name to your App Service app preemptively.
If you're not worried about downtime in DNS resolution, see Map an existing custom DNS name to Azure Web Apps.
To complete this how-to:
Bind the domain name preemptively
When you bind a custom domain preemptively, you accomplish both of the following before making any changes to your DNS records:
- Verify domain ownership
- Enable the domain name for your app
When you finally migrate your custom DNS name from the old site to the App Service app, there will be no downtime in DNS resolution.
Access DNS records with domain provider
You can use Azure DNS to configure a custom DNS name for your Azure Web Apps. For more information, see Use Azure DNS to provide custom domain settings for an Azure service.
Sign in to the website of your domain provider.
Find the page for managing DNS records. Every domain provider has its own DNS records interface, so consult the provider's documentation. Look for areas of the site labeled Domain Name, DNS, or Name Server Management.
Often, you can find the DNS records page by viewing your account information, and then looking for a link such as My domains. Go to that page and then look for a link that is named something like Zone file, DNS Records, or Advanced configuration.
The following screenshot is an example of a DNS records page:
In the example screenshot, you select Add to create a record. Some providers have different links to add different record types. Again, consult the provider's documentation.
For certain providers, such as GoDaddy, changes to DNS records don't become effective until you select a separate Save Changes link.
Create domain verification record
To verify domain ownership, Add a TXT record. The TXT record maps from awverify.<subdomain> to <appname>.azurewebsites.net.
The TXT record you need depends on the DNS record you want to migrate. For examples, see the following table (
@ typically represents the root domain):
|DNS record example||TXT Host||TXT Value|
In your DNS records page, note the record type of the DNS name you want to migrate. App Service supports mappings from CNAME and A records.
Enable the domain for your app
In the Azure portal, in the left navigation of the app page, select Custom domains.
In the Custom domains page, select the + icon next to Add hostname.
Type the fully qualified domain name that you added the TXT record for, such as
www.contoso.com. For a wildcard domain (like *.contoso.com), you can use any DNS name that matches the wildcard domain.
The Add hostname button is activated.
Make sure that Hostname record type is set to the DNS record type you want to migrate.
Select Add hostname.
It might take some time for the new hostname to be reflected in the app's Custom domains page. Try refreshing the browser to update the data.
Your custom DNS name is now enabled in your Azure app.
Remap the active DNS name
The only thing left to do is remapping your active DNS record to point to App Service. Right now, it still points to your old site.
Copy the app's IP address (A record only)
If you are remapping a CNAME record, skip this section.
To remap an A record, you need the App Service app's external IP address, which is shown in the Custom domains page.
Close the Add hostname page by selecting X in the upper-right corner.
In the Custom domains page, copy the app's IP address.
Update the DNS record
Back in the DNS records page of your domain provider, select the DNS record to remap.
contoso.com root domain example, remap the A or CNAME record like the examples in the following table:
|FQDN example||Record type||Host||Value|
||IP address from Copy the app's IP address|
Save your settings.
DNS queries should start resolving to your App Service app immediately after DNS propagation happens.
Learn how to bind a custom SSL certificate to App Service.