DNS Configuration


This blog I will update several times. I spent the day today researching Azure DNS. I currently use Namecheap for my domain hosting. I have two new domains, cigardoug.org and cigardoug.net, that I created just to have a sandbox to play with that won't break my existing websites or emails. I already created a few subdomains in cPanel under Namecheap, for this I wanted to start with a custom domain from scratch in Azure, and I was able to make everything work. Moved this to it's own blog entry. Here are some of the steps:

Add a Custom Domain

  • Open Azure portal and search for "Domain Names".
  • From Custom domain names, in the Ribbon, click "Add custom domain".
  • From the pane, enter the custom domain, example "norfolkvalley.com" and click "Add domain".
  • From the next page, note the TXT record and open a browser tab to your domain registrar, example "namecheap.com".
  • From your domain registrar, add the TXT record. This will confirm for Azure that you control the domain. In Namecheap:
    • Go to your domain list.
    • Select your domain, for example, norfolkvalley.com, and click "Manage".
    • Under Domain, set Nameservers to Namecheap BasicDNS. This unlocks Advanced DNS so you can enter the TXT record. cPanel will not let you enter a "@" as a record.
    • Under Advanced DNS, enter your TXT record.
  • Back in Azure, click "Verify" once you have added the TXT record.

Add a DNS Zone

  • From Azure portal, search for "DNS Zones".
  • From DNS Zones, click "Create"
  • From Create a DNS Zone, choose your Resource Group (your DNS Zone will be in the same region as your Resource Group) and enter the same name as you did in the previous steps. Example, "norfolkvalley.com".
  • Click Review + Create. It may take a few minutes to create your new DNS Zone.
  • Click the name of your DNS Zone.
  • From your DNS Zone home page, note the four Nameservers. You will need to copy each one.
  • Open a browser tab to your domain registrar, example "namecheap.com".
  • From your domain registrar, change your Nameserver to "Custom DNS". Paste the four Nameservers from Azure and save changes.
  • It may take a while for the DNS changes to apply.
  • From your DNS Zone home page, from the Ribbon, click Record Sets.
  • Add whatever new records are necessary. You will need to add an A record or a CNAME record for your website.
  • If you are using Namecheap and cPanel, and you want to continue to use cPanel to manage your email, you will have to copy over the MX records from cPanel to Azure. There are three MX records. I have tested with one of my domains, and everything is working again.

Associate your App Service with your Custom Domain

  • From Azure portal, search for "App Services".
  • Select your existing App Service.
  • From the navigation panel, under Settings, click "Custom Domain".
  • From Custom Domains, click "Add Custom Domain".
  • From the "Add Custom Domain" pane, select "All other domain services", leave the other settings alone, and enter your domain.
  • Under domain validation, create an A and TXT record in DNS Zone as shown.
  • Click "Validate" to confirm you created the records successfully, then click "Add".
  • Your domain should now point to your App Service.

There are so many moving pieces with DNS, it's no wonder I put off trying to really understand it years ago. What I am trying to sort out is what I can do in Azure, and what I need to pay Namecheap to do for me. It's even more involved than I thought, so I am sorting out one use case at a time. Here is part of the latest conversation with an AI at Namecheap:

ME: So, in Namecheap, I would have to point my Nameservers back to Namecheap Basic or Web Hosting, if I wanted to do the HTTP Redirects, which I would then set in cPanel. Is that correct?

AI: Yes, that's correct. If you want to use Namecheap's HTTP Redirect or set up redirects via cPanel, your domain's nameservers need to be pointed to Namecheap BasicDNS or your Namecheap Web Hosting nameservers. This allows you to manage redirects either through the Namecheap dashboard (for BasicDNS) or through cPanel (for Web Hosting). If your nameservers are set to Azure or another provider, you would need to use their tools or services to handle redirects.

So, to sum up a recent test with norfolkvalley.com:

  • Created custom domain and DNS Zone in Azure.
  • Added Nameservers to Namecheap and validated in Azure.
  • Added MX records from cPanel (Namecheap) to DNS Zone in Azure.
  • Added App Service records to DNS Zone in Azure.
  • Verified App Service is displayed and email works.
  • If I am hosting in Azure, I can still use cPanel for email. If I am just redirecting, leave everything in cPanel.
  • Removed all test resources.

Wednesday, 24 September 2025 12:45
Category
Keywords
Private
Azure
Development, DNS