Manage custom domains in Azure websites

2014-06-23 | Toni Pohl

In addition to the many features of Microsoft Azure this platform is really cool for hosting websites, see Since we not only want to reach our websites with the out-of-the-box Microsoft domain * we can add our custom domains as well. This article shows how this works.

Update: See also Manage custom domains in Azure Websites step-by-step

First switch the Azure website to a non-free mode

For using one or more custom domains we need to switch the website to the (non free) web hosting plans Shared, Basic or Standard. You can do this in the “Scale” menu of the specific website. The screenshot shows how.


Don´t forget to save the configuration changes at the bottom. This can take some seconds to about some minute depending on the size of the website(s).

In our sample we´re working with the domain “” and use an Umbraco web in Azure for the website itstelf. The website is already up and running. After the scale up you get the “manage domains” button in the “Configure” menu.


The DNS part

Usually you don´t know from memory where the custom domain is managed. So first we need to know which is the primary DNS server. Let´s ask!

Open a command line and use

  1. nslookup
  2. set type=any

See the whole input and output in this sample:

Default Server:  UnKnown
> set type=any
Server:  UnKnown
Non-authoritative answer: internet address = nameserver = text = "v=spf1 -all"
        primary name server =
        responsible mail addr =
        serial  = 3411
        refresh = 900 (15 mins)
        retry   = 600 (10 mins)
        expire  = 3600 (1 hour)
        default TTL = 3600 (1 hour) text =
        "MS=ms89028113" nameserver = MX preference = 10, mail exchanger =

Now ensure the IP address of the primary nameserver if you are not sure who is responsible for that domain.

Server:  UnKnown
Non-authoritative answer:   internet address =

Connect to the DNS server – or if it´s managed at a provider use the DNS panel of the ISP, see below.

Manage the custom domains in the Azure website

Azure helps to configure the custom domain(s). Usually you want to add the domain with leading www. and the domain itself for opening the website. In our sample that´s and The domain provided by Azure itself automatically is

The dialog Manage custom domains checks the domain name while typing and displays a green (OK) or red (error) icon at the line end. The screenshot shows the finished configuration for our scenario.


So we need to configure our DNS zone before we can add these values as host headers in Azure.

The trick with the root domain

It´s obviously we need to follow the steps described in the dialog. The CNAME steps seem to be clear. But we need to map the root domain, too!

To map a root domain (such as to an Azure Web Site there´s workaround necessary, see Configuring a custom domain name for an Azure Web Site.

The trick is to map from “@”, or a blank entry to the virtual IP address. To create a wildcard mapping that maps all sub-domains to the virtual IP address, you will usually map from “*” to the virtual IP address. Remember that the specifics of mapping a root or wildcard vary between registrars.

If you´re self responsible for the DNS zone, f.i. in your own Windows DNS-server this is how the zone should look like – see the yellow marked entries. This configuration works.


Point the A-record (HOST) to the IP address given to you by the Azure website. In our case it´s Add a CNAME with the star “*” pointing to the FQN – our Azure website. Finally add a CNAME with the leading “www.” and point it to the Azure website as well.

With these three DNS-entries our website is available with these URLs: and (and of course with – but that´s not in our DNS zone…)

After the editing you can increment the serial number of the zone to ensure it´s transferred to the secondary (or more) DNS servers.


Now check the configuration when querying the domain with nslookup (do a DNS flush before or use an other machine). That´s it on the DNS side.


…comes the configuring part in the Azure portal as shown above in the “manage custom domains” dialog. Try to add your custom domain(s) to the Azure website.


Keep in mind that it may take some minutes up to some hours for the new DNS changes to be active.

If everything went well the custom domains should be visible in the the “Configure” page under the section “domain names” like here.


A nice feature is that the custom domain from now on is also used as Site URL in the “Dashboard” of the website.


If you want to use SSL bindings Azure automatically provides the website with the URL https://[websitename] like

To use your own custom domain with SSL encryption you need to create your own certificate, upload it and add it to the SSL bindings. Maybe stuff for another blog post… Zwinkerndes Smiley

Test the domains with your website and enjoy the worldwide availability of your Azure website with your custom domains.

Hope this article helps!

See also Manage custom domains in Azure Websites step-by-step

Categories: General, Azure, Cloud, Developer, English, Microsoft, Security, Umbraco