How to point a domain to Azure

When you create a Cloud Service, Azure assigns it to a subdomain of cloudapp.net. For instance, if your Cloud Service is named "example", your users will be able to access your application on a URL like http://example.cloudapp.net. Azure also assigns a virtual IP address. Thus, it is possible to point your custom domain to Azure either via a CNAME record or an IP address.

If your domain is pointed to our BasicDNS, BackupDNS (a legacy option), PremiumDNS or FreeDNS, you can easily configure it for the Azure Cloud Service via creating a CNAME record or an A record.

If you decide to link a domain to Azure using a CNAME record, please follow the steps below:

1) Get a CNAME value at Azure.

You can use one of these methods to find the .cloudapp.net domain name assigned to your Cloud Service:

  a) Log into the Azure classic portal, select your Cloud Service, go to Dashboard, and then find the Site URL entry:





OR

  b) Install and configure Azure Powershell, and then use the following command:
Get-AzureDeployment -ServiceName yourservicename | Select Url


Save the domain name used in the returned URL as you will need it when creating a CNAME record.

2) Sign into your Namecheap account with your username and password (The Sign In option is available in the top hat of the page) to set the needed records.

   a) Select Domain List from the left sidebar and click on the Manage button next to your domain:





   b) Click on the Advanced DNS tab and find the Host records section. Then click on the Add New Record button:





    c) In this section, you need to create two records for your domain:

URL redirect Unmasked record for @ redirecting to http://www.domain.tld (http://www.nctest.info, for instance)
CNAME record for www (pointing to your application's cloudapp.net domain, example.cloudapp.net, for instance)

   d) Once all details are inserted, save them using the Save all changes button:



*It may take up to 30 minutes for the changes to take effect.


Note: If you want to direct traffic from non-exsistent subdomains, such as blog.domain.tld or test.domain.tld, to your cloudapp.net address, you can configure a Wildcard URL Redirect entry in your DNS settings.
The configuration will look as follows:

URL redirect Unmasked Record for * to forward to http://www.domain.tld
CNAME record for www mapped to your application's cloudapp.net domain

Here is the example of such settings:





Once all the details are inserted, save them using the Save all changes button.

   e) Make sure that there are no conflicting records set for the same Host.

If there are any conflicting records, please remove them. You need to pay attention to the records of the following types: URL Redirect (Unmasked/Masked/Permanent Redirect), A or CNAME.

For example, you need to check if you have such records as URL redirect and CNAME set for the default Namecheap parking page:






If you wish to point the domain to Azure via an A record (using the IP address of your Cloud Service), please follow the next steps:

1) Get the IP address of your Cloud Service.

You can use one of these methods to find the IP address assigned to your Cloud Service:

   a) Log into the Azure classic portal, select your Cloud Service, go to Dashboard, and then find the Public Virtual IP (VIP) address entry:





OR

   b) Install and configure Azure Powershell, and then use the following command:
get-azurevm -servicename yourservicename | get-azureendpoint -VM {$_.VM} | select Vip

If you have multiple endpoints associated with your Cloud Service, you will receive multiple lines containing the IP address, but all of them should display the same address.

Save the IP address, as you will need it when creating an A record.

2) Sign into your Namecheap account with your username and password (The Sign In option is available in the top hat of the page) to create the needed records.

   a) Select Domain List from the left sidebar and click on the Manage button next to your domain:





   b) Click on the Advanced DNS tab and find the Host records section. Then click on the Add New Record button:





   c) In this section, you need to create two A records for your domain:

A Record for @ to mapped to the IP address of your cloud service (11.22.33.44 in our case)
A Record for www mapped to the same IP address.

   d)  Once all details are inserted, save them using the Save all changes button:



*It may take up to 30 minutes for the changes to take effect.


This example demonstrates creating an A record for the root domain and www subdomain (www.nctest.info). If you wish to create a wildcard entry to cover all non-existent subdomains, please enter '*' as the host name as shown below:

A Record for @ to forward to the IP address of your Cloud Service.
A Record for * mapped to the same IP address.

Here is the example:





Once all the details are inserted, save them using the Save all changes button.

   e) Make sure that there are no conflicting records set for the same Host.

If there are any conflicting records, please remove them. You need to pay attention to the records of the following types: URL Redirect (Unmasked/Masked/Permanent Redirect), A or CNAME.

For example, you need to check if you have such records as URL redirect and CNAME set for the default Namecheap parking page:






That's it!

If you have any questions, feel free to contact our Support Team.

Comments

We welcome your comments, questions, corrections and additional information relating to this article. Your comments may take some time to appear. Please be aware that off-topic comments will be deleted.

If you need specific help with your account, feel free to contact our Support Team. Thank you.

Need help? We're always here for you.

× Close