Pointing Namecheap domains to Azure Websites

I recently wrote about updating my website as part of my new job change, and one of the things that I had some trouble with was figuring out all of the things I needed to change on Namecheap to get my Azure site up and running properly with my custom domains. There are a bunch of different resources available online for these things separately, but having a less-than-expert knowledge of networking (it’s sadly a weak spot for me at this point) some of them were tricky to follow so I’d figure I’d share what I got done!

I use Namecheap.com for my domains – In the future, I plan to make a few changes to these for consistency, but for this project, I was moving my personal website (http://virtualinfinity.io) from being hosted on GitHub pages in an old repository to an entirely new site (and GH repo) that deploys to Azure. Deploying a website from GitHub on Azure is just one click in the management portal, and you can find plenty of help on this in the documentation. For me, the tricky part was figuring out all of the domain configurations.

Specifically, there were three things that I wanted to confirm worked with my new Azure site, which sits under the Azure provided subdomain of http://misslivirose.azurewebsites.net:

1. I wanted my naked domain, virtualinfinity.io, to direct to my site when it was typed in the search bar

2. I wanted www.virtualinfinity.io to direct to my site (by default, making #1 happen does not imply that this works, which I learned the hard way)

3. I wanted to configure my site’s static IP, which will help me for debugging and work in the case that for some reason all DNS servers fail at the same time.

The first thing that you’ll want to do is go to your Namecheap dashboard with your account signed in, and in a separate tab open the Microsoft Azure management portal. Sign in to both to access your websites and owned domains. For this example, we will say that our Namecheap domain is sample.com, our Azure website name is demo.azurewebsites.net, and our IP is 0.0.0.0

In The Azure Portal

  1. Navigate to your websites in your Azure portal and select the one you’re going to be pointing your domain to. Note that you cannot configure custom domains with the free hosting plan, so you’ll need to make sure that you are on a plan that enables custom domains. You can find more information about choosing a plan here.

customdomainazure

  1. In the dashboard of the site you are configuring, select ‘Manage Domains’ in the bottom task bar. This will bring up a menu that allows you to enter your domains. Right now, though, we’re interested in the IP address that we’ll use to point our domain to our site, so copy this from the bottom of the window and switch over to Namecheap.

In the Namecheap Portal

  1. In your account, select the domain you want to use for your Azure site and open it for editing. This should go to a page under My Account -> Manage Domain -> Modify Domain.
customdomain2

Ignore the extra two @ and the mail subdomain – these are specific to my personal site and not part of setting up the basics

  1. Under Host Management, click ‘All Host Records’.

  2. Add the following entries to your domain to set up the forwarding using your actual domain and Azure website URL:

Note: After the first two entries, you will likely need to edit the rest of the records under sub-domain settings. 

Host Name IP Address / URL Record Type
@ 0.0.0.0 A (Address)
www demo.azurewebsites.net CNAME (Alias)
awverify awverify.demo.azurewebsites.net CNAME (Alias)
awverify.www awverify.demo.azurewebsites.net CNAME (Alias)

The awverify and awverify.www entries are used by Azure to check that you actually own the sites that you’re setting up. Once you’ve verified this, you can delete those entries if you like, but I generally don’t bother. Specifying the www. and awverify.www will allow your domain to successfully point to the right site, regardless of whether or not you enter http://sample.com or http://www.sample.com.

In the Azure Portal

Back in the Azure portal, under your domain settings for the site you added above, enter in the following two entries to your Namecheap domains (note that you will want to use your actual domain here):

  • www.sample.com
  • sample.com

Azure will check for the awverify entries and when they are confirmed, your site will be good to go!

Related Posts

2 thoughts on “Pointing Namecheap domains to Azure Websites

  1. Your post is inspiring and detailed. I like it. We also provide domain registraton service. We hope you like us too. Your creative potential seems limitless. Keep Writing..

Leave a Reply

Your email address will not be published.