Three Easy Steps to Add a Custom Domain to a WAWS Site


After you create a website in Windows Azure Web Sites (WAWS), you can open a browser and see your site by going to sitename.azurewebsites.net. That’s cool, but if you own a domain name, you might want to use it instead. You can do that in WAWS (assuming you are not running in Free mode) by adding your custom domain to the Azure portal, but you have to take care of some changes at your domain registrar before you can do that.

Note: What I’ve documented here isn’t the only way to do this. You may have more complex requirements or a more complex configuration. However, what I’ve outlined here covers a large majority of our customers.

Another Note: If you are using Azure Traffic Manager, use the information located here instead of what’s in this blog post.

A domain registrar is a company that manages your domain. In order to use your custom domain with WAWS, you will need to log into your Really Techie Guydomain registrar’s system and make three changes. I’ll go into detail on these as we progress through this post, but in a nutshell, these steps are:

  1. Add an A record that points to the IP address listed in the Azure portal.
  2. Add a CNAME record called “awverify” that points to awverify.sitename.azurewebsites.net.
  3. Add a CNAME record called “www” (or modify the existing “www” CNAME) and point it to sitename.azurewebsites.net.

It’s pretty easy and you don’t have to be a super geeky tech person like the guy on the right side of this page to do all of this. Let’s go through these steps one-by-one. In the examples that follow, I’m going to redirect my custom domain SurfaceForWindowsRT.com to my WAWS site called MyCoolWAWSSite.azurewebsites.net. My domain is registered with GoDaddy. The steps are the same for other domain registrars, but the user interface will be a little bit different.

At the bottom of this post, you can see my entire DNS zone file with all of the necessary entries.

Step 1: Add an A Record

After I log into my domain at GoDaddy, I can edit my DNS Zone File. (There’s a “DNS Zone File” button that takes you to the right place on GoDaddy’s site. Your registrar’s procedure might be a little bit different.) As you can see in the image below, there’s an A record with a hostname of “@” and it points to an IP address. I need to change that IP address so that it matches the one in the Azure portal.

An A record at GoDaddy.

To find the IP address I need to use, I can log into the Azure portal, select my website, and then click on the Configure tab. If I scroll down on that page, I’ll see a green “Manage Domains” button, and when I click that, I can see the IP address that I need to use. As you can see below, the IP address I need to use for my A record is 168.62.224.13. (You will need to use the IP address displayed for your particular site.)

A Record IP Address

In the image below, you can see that I’ve changed the original A record and it’s now pointing to the IP address that the Azure portal gave me. Step 1 done!

A Record Finished

Step 2: Add an awverify CNAME Record

In order to WAWS to use my naked domain (SurfaceForWindowsRT.com), I need to add a CNAME record called awverify that points to awverify.mycoolwawssite.azurewebsites.net. In the image below, you can see that I’ve added this entry in the CNAME section of my zone file at GoDaddy.

The awverify CNAME record.

Once I’ve added this CNAME entry (along with the A record entry in step 1) and saved the changes, I can add my naked domain (without the “www” prefix) in the Manage Domains dialog in the Azure portal. One catch! You do have to wait for your changes to replicate across the Internet. In most cases, you can add your domain within a few minutes, but it might take quite a bit longer in some cases.

In the image below, I have added my naked domain to my website in the Azure portal. Notice that I get a green check meaning everything’s verified.

My naked domain has been added.

Once I add that, I can browse to http://surfaceforwindowsrt.com and it will bring up my site at http://mycoolwawssite.azurewebsites.net. (Folks who browse to http://surfaceforwindowsrt.com won’t even be aware that the site is hosted on WAWS.) However, I also want to use http://www.surfaceforwindowsrt.com, so I now have to add the second CNAME record for the “www” subdomain.

Step 3: Add a www CNAME Record

Most registrars are going to have a www CNAME already added for your domain. In those cases, you’ll want to edit the existing CNAME and point it to your WAWS URL. As you can see in the image below, my domain hosted at GoDaddy has a CNAME record for www that points to “@”. I need to edit that entry and change the “@” to point to mycoolwawssite.azurewebsites.net.

The default "www" CNAME entry.

In the image below, you can see that I’ve edited the existing www CNAME entry for my domain and it now points to mycoolwawssite.azurewebsites.net.

The edited CNAME entry.

Again, I have to save this change and allow it to propagate throughout the Internet’s DNS system before Azure will recognize it.

Step 4: Add Your Domains in Azure

Okay, I admit it. I lied a little. There’s a fourth step. After you configure all of this, you will need to add your custom domain entries to your website in the Azure portal. In step 2, I did that for the naked domain, SurfaceForWindowsRT.com. Now that I’ve added the www CNAME entry, I can add www.SurfaceForWindowsRT.com to my WAWS site in the Azure portal. The image below shows that entry.

The www subdomain is added.

As promised, here is my completed zone file at GoDaddy showing the three changes I made in order to make all of this happen. I edited out the CNAME records that don’t apply to my website in order to make it more clear.

My edited DNS zone file.

I hope that this helps to explain how you can easily add your custom domain to your WAWS site.

Comments (9)

  1. Problem with my domain says:

    I have created A Record first and the domain is not propagating, I think A record step should be done after CName has been accomplished successfully. In my case account.windowsAzure.com shows trouble that DNS is not configured, Add a CName record and than later, A record.

  2. jamesche says:

    You can add the A record and any CNAME records at the same time. There is no need to wait until one record type propagates before adding another.

    Are you still having a problem with this?

  3. Problem with directing my domain to azure says:

    My domain registrar is Domainsnext.com, it offers a limited & confusing (for me, I'm not an expert) cpanel where certain fields need to be completed. My first problem is that it needs a "Name Servers" (I have no idea what to place there). Following that; I find the "A RECORDS" field where it's divided in 2: Subdomain & IP Address. Following that comes CNAME Records field that is divided (you can add a bunch more) in 2: Subdomain & Target Host.

    I have been following every single step to the letter in my registrar & in my azure cpanel without any success.

    My registrar doesn't accept the parameters I write.

    I appreciate any help &/or advice you could give.

  4. Mark Mayes says:

    Thank you so much for this article.  I've read a few articles on this subject and without a doubt, this is the easiest to follow.  

    It took me 5 minutes to point http://www.wordlash.com to my Azure website.

    Thank you

  5. David says:

    We made all A and CNAME records changes. Domain registrator confirmed us that all changes are propagated (It's more than 24hrs) and A records is obviously working http://www.jet-maid.com, but I still cannot confirm domain in azure portal.

    Is there some difference between A and CNAME propagation? How come that A record is working but CNAME isn't ?

  6. Jose says:

    In the first step you mentioned "I need to change that IP address so that it matches the one in the Azure portal". Where can I find that IP? I can't see any IP

  7. Anonymous says:

    Hi Jim,

    New Azure user , your steps were really helpfull, i have been facing some interfacing problems from 13 hours, then stumble onto your post.

    Thanks once again.

    Regards

    Vaibhav Sanil

  8. Anonymous says:

    I have a wildcard certificate and have three WAWS all using different subdomains for the same domain name and of course they all have different IP addresses. My DNS Zone file will not let me add multiple awverify CNAME records.  Do you think I should try using awverify.*.MyWawsSiteName.azurewebsites.net ?

    Same thing for the A record. I Can't add more than one @ host pointing to the different IP addresses.  Should I try using the subdomain instead of @ ?

    Then none of the subdomains are www, and I can't add a CNAME record with the same name as any of the A records.  Here's how I think I should configure it (I'm using GoDaddy):

    (instead of @)

    A Record1 = dev – points to the IP address for the WAWS that uses that subdomain: (MySiteName1)

    A Record2 = demo – points to the IP address for the WAWS that uses that subdomain: (MySiteName2)

    A Record3 = portal – points to the IP address for the WAWS that uses that subdomain: (MySiteName3)

    CNAME = Host: awverify – points to awverify.*.azurewebsites.net

    CNAME = Host: dev- points to MySiteName1.azurewebsites.net

    CNAME = Host: demo- points to MySiteName2.azurewebsites.net

    CNAME = Host: portal – points to MySiteName3.azurewebsites.net

    etc…

    When I try to add the A record with the same host name (i.e. dev) as the CNAME record Host value, GoDaddy gives me an error message: "The specified CNAME already exists in the zone: A – dev"

    When I go the other way and create the A record first (i.e. Host = portal – points to the IP address for MySiteName3), Then I try to create the CNAME: portal – points to portal.MySiteName3.azurewebsites.net.

    I get basically the same error message: "The specified record already exists. CNAME – portal"

    Any ideas?

  9. Anonymous says:

    It turns out I WAS able to create multiple A records with host = @ – all pointing to the different IP addresses for each of my WAWS.

    The CNAME records ended up working out because of this (one for each subdomain pointing to the different WAWS that use the respective subdomains.

    However, the awverify CNAME record is the problem.  I was able to create one that points to awverify.*mydomainname.azurewebsites.net.  We'll see if that works.  Not holding my breath, though.

    I'll post back in a couple of weeks and let you know if my IP addresses have changed or not.