Free trial *Internet Service Required

Configuring a custom domain name for a Windows Azure web site

When you create a web site, Windows Azure provides a friendly subdomain on the azurewebsites.net domain so your users can access your web site using a URL like http://<mysite>.azurewebsites.net. However, if you configure your web sites for shared or reserved mode, you can map your web site to your own domain name.

Note

The procedures in this task apply to Windows Azure Web Sites; for Cloud Services, see Configuring a Custom Domain Name in Windows Azure.

The steps in this task require you to configure your web sites for shared or reserved mode. Because the Web Sites feature is in preview and we are adding capacity on a measured basis, you may receive a "Not enough available reserved instance servers to satisfy this request." error. If you receive this error, you will need to try again later to perform this task.

You can use a CNAME record to point your domain name to your Windows Azure web site. You can also configure an A record to point the domain name to Windows Azure web site. The process requires that you wait for the CNAME and A records propagate before you can finally set the domain name in the management portal.

There are two ways you can configure the Domain Name Server (DNS) settings on your domain registrar to point to your Windows Azure web site:

  1. CNAME or Alias record

    With a CNAME, you map a specific domain, such as www.contoso.com or myblog.contoso.com, to the <mysite>.azurewebsites.net domain name of your Windows Azure web site.

    Using the Microsoft sample domain, contoso.com, as an example:

    • You can typically map subdomains such as www.contoso.com or MySubSite.contoso.com.
    • Typically you cannot map naked domains such as contoso.com or wildcard names such as *.contoso.com.
  2. A record

    With an A record, you map a domain (e.g., contoso.com or www.contoso.com) or a wildcard domain (e.g., *.contoso.com) to the single public IP address of a deployment within a Windows Azure web site.

    The main benefit of this approach over using CNAMEs is that you can map root domains (e.g., contoso.com) and wildcard domains (e.g., *.contoso.com), in addition to subdomains (e.g., www.contoso.com).

The task includes the following steps:

  1. Prerequisite: Configure your web sites for shared mode
  2. Prerequisite: Configure the CNAME on your domain registrar
  3. Set the domain name in management portal

You can also optionally Configure an A record for the domain name.

Configure your web sites for shared mode

Setting a CNAME record is the recommend way to map your domain name to your Windows Azure web site. Mapping a CNAME record insulates your web site from changes that could affect the underlying IP address of the site.

Setting a custom domain name on a web site is only available for the shared and reserved modes for Windows Azure web sites. Before switching a web site from the free web site mode to the shared or reserved web site mode, you must first remove spending caps in place for your Web Site subscription. For more information on shared and reserved mode pricing, see Pricing Details.

  1. In your browser, open the Management Portal.
  2. In the Web Sites tab, click the name of your site.

  3. Click the SCALE tab.

  4. In the general section, set the web site mode by clicking SHARED.

  5. Click Save.
  6. On the You are changing to a mode that may have a billing impact. Continue? (If you select RESERVED, the confirmation message will be: Are you sure you want to upgrade from Free to Reserved web site mode?) click Yes.

Note

If you receive a "Configuring scale for web site '<site name>' failed" error you can use the details button to get more information. You may receive a "Not enough available reserved instance servers to satisfy this request." error. The web sites feature is in preview and we are adding capacity on a measured basis. If you receive this error, you will need to try again later to upgrade your account.

Configure the CNAME on your domain registrar

To configure a custom domain name, you must create a CNAME record in your custom domain name's DNS table. Each registrar has a similar but slightly different method of specifying a CNAME record, but the concept is the same. Once you have configured the CNAME record, it will take some time to propagate.

  1. In your browser, open the Windows Azure Management Portal.
  2. In the Web Sites tab, locate the name of your site.
  3. Log on to your DNS registrar's web site, and go to the page for managing DNS. You might find this in a section, such as Domain Name, DNS, or Name Server Management.
  4. Now find the section for managing CNAME's. You may have to go to an advanced settings page and look for the words CNAME, Alias, or Subdomains.
  5. Finally, you must provide a subdomain alias, such as www. Then, you must provide a hostname, which is your application's azurewebsites.net domain which consists of the name you located in step two and the azurewebsites.net domain. For example using the Microsoft sample domain of contoso.com, the following CNAME record example forwards all traffic from www.contoso.com to mysite.azurewebsites.net, the DNS name of your deployed application:

     

    AliasTTLTypeValue
    www.contoso.com 86400 CNAME mysite.azurewebsites.net

     

Note

It can take some time for your CNAME to propagate through the DNS system. You cannot set the CNAME for the web site until the CNAME has propagated. You can use a service such as http://www.digwebinterface.com/ to verify that the CNAME is available.

Set the domain name in management portal

Once the CNAME or A record for domain name has propagated you must associate it with your web site.

  1. In your browser, open the Windows Azure Management Portal.
  2. In the Web Sites tab, click the name of your site.
  3. Click the CONFIGURE tab.

  4. At the bottom of the screen click MANAGE DOMAINS.

  5. In the DOMAIN NAMES text box type the domain name you have configured.

  6. Click the check mark to accept the domain name.

Windows Azure validates the existence of the hostname in the public DNS before it save changes and updates the internal Windows Azure DNS. There are few reasons we are validating the hostname before committing the save, one of the primary reasons is that by waiting until the CNAME change propagates, we can verify that the custom domain belongs to the site owner. Verification allows our router to set up the route for each hostname, and ensures that every hostname belongs to one and only one site.

Configure an A record for the domain name

To configure an A record you must configure a CNAME record used to verify the domain name. This process is the same as one used to configure a CNAME record to point at to your web site, except that you configure the CNAME record domain names that will be used for verification purposes. For example, using the Microsoft sample domain contoso.com, the hostname will be you awverify.www.contoso.com and the value will be awverify.mysite.azurewebsites.net. Once this has propagate, you can configure the A record.

  1. In your browser, open the Windows Azure Management Portal.
  2. In the Web Sites tab, click the name of your site.
  3. Click the CONFIGURE tab.

  4. At the bottom of the screen click Manage Domains.

  5. On the Manage custom domains dialog locate The IP Address to use when configuring A records and copy the IP address.

  6. Log on to your DNS registrar's web site, and go to the page for managing DNS. You might find this in a section, such as Domain Name, DNS, or Name Server Management.
  7. Configure the domain name and the IP address you copied in step 5. For example, the following DNS examples forwards all traffic from contoso.com to 172.16.48.1.

     

    AliasTTLTypeValue
    awverify.www.contoso.com 86400 CNAME awverify.mysite.azurewebsites.net
    contoso.com 7200 A 172.16.48.1

Rss Newsletter