By default when users create a website on WAWS they hostname would be SITENAME.azurewebsites.net. So when I create a website called Kaushalz then the hostname would be Kaushalz.azurewebsites.net.
Windows Azure Web Sites allows user to configure custom domains as well. But this option is available when the website is scaled to either SHARED or STANDARD (Previously called RESERVED) mode.
There is an article on www.windowsazure.com on how to configure custom domain. Below is the URL: http://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns-web-site/
However, I have still seen few customers running into issues in spite of this. I will be discussing in as much detail as possible.
So as we know there are 2 ways to configure domain names:
NOTE: A records map a domain name to one or more IP addresses. They are used when the IP is not bound to change. Example: kaushalz.com points to 18.104.22.168. On the other hand CNAME (CANONICAL NAME) records map one domain name to another domain name. It is typically used when there are multiple hosted services. Example: ftp.kaushalz.com or www.kaushalz.com points to kaushalz.com
To explain this scenario I purchased a domain called www.kaushalz.org from GoDaddy.
Now I will show step by step how to configure this.
Logon to the Azure portal and create a website. If this is the first site being created in a specific data center then it would be scaled to FREE mode by default. You will have to scale it to either SHARED or STANDARD.
Refer this URL on how to do so: http://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns-web-site/#bkmk_configsharedmode
Once the website has been scaled to either SHARED or STANDARD, we can proceed further.
As I stated earlier, I purchased a domain www.kaushalz.org from GoDaddy. So I will have to configure the routings on GoDaddy’s DNS servers.
When you click on Manage Domains under the DASHBOARD management page, you will see the following pop-up window providing the details on how to configure:
As seen above it provides the IP which needs to be used while configuring A records on the DNS server.
Additionally it also suggests that before we add custom domains for the site Azure needs to verify that the user is authorized to use the domain name or not.
My DNS service provider is GoDaddy so I need to have www pointing to kaushalz.azurewebsites.net. Below is a snapshot of my DNS Manager.
NOTE: The @ entry (A record) is not required as we already have a CNAME mapping for www to kaushalz.azurewebsites.net.
Now consider a scenario where the user is wants to migrate his production websites to AZURE, without affecting any of his current sites. He would like to perform the verification of the hostname and then would like to modify his DNS records to point to the site hosted on Azure. What should he do?
For this he would have to create CNAME records on the DNS service provider as shown below:
I’m going to point both kaushalz.org and www.kaushalz.org to kaushalz.azurewebsites.net. Therefore I’m adding the above entries.
Note that kaushalz.org and www.kaushalz.org are 2 different hostnames. The above step is only for verification.
Below is a snapshot of my configuration from GoDaddy. I don’t need any other records apart from these 2 CNAME entries.
NOTE: I have seen cases where the propagation of the DNS entries takes up to 48 hours or sometime even more than that. In these cases you may have to wait for the propagation to succeed and then do go back to azure and then perform the verification. The user needs to ensure that the awverify entry resolves to the corresponding entry which has been added in the DNS server when performing a look up.
There are online DNS Query tools. I am using dnsquery.org for this. Provide the hostname awverify hostname and then click on query. it will produce results as shown below.
You can skip this, if you have an CNAME entry pointing to SITENAME.azurewebsites.net on the DNS server.
The WAWS verification logic has 2 steps:
TXT records are also supported. It is another alternative, because some DNS registrars don’t support CNAME’s pointing to invalid hostnames (the “awverify” version doesn’t truly exist). So one can also create just a TXT record instead of a CNAME (otherwise it is completely same setup as in validations above).
Thanks to Petr Podhorsky (DEV on WINDOWS AZURE WEB SITES) who shared the above information with me.
Lets assume the DNS records have propagated successfully, now the only task is to add the domain name to the portal.
Go to the DASHBOARD Management page and click on MANAGE DOMAINS at the bottom of the page.
Enter the domain name and give it some time to verify. If it succeeds, then you would see something as shown below:
If the verification fails then you would get a corresponding warning message that it was unable to perform the 2 step verification logic and would request the user to update the DNS entries.
You will have to try resolving the hostname and confirm that it is resolving to the entries you specified.
As I suggested earlier, go to dnsquery.org and query the hostname and see what does the hostname resolves to. This will indicate whether the propagation of entries has been done or not.
Once the verification is done, user can modify the DNS entries to point to the AZURE front end IP Address provided to him. Below is a snapshot of the final configuration of my domain name on GoDaddy.
Once added successfully you are ready to go. Browse the url’s to confirm the site’s availability.