Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildcard subdomains on Azure

I'm trying to get an Azure site set up so that it will handle all (wildcard) subdomains, and not require any manual addition of a CNAME record every time a new customer signs up and chooses a subdomain like xyz.mysite.com

I'm following this guide: https://blogs.msdn.microsoft.com/waws/2015/12/01/mapping-a-wildcard-domain-name-to-an-azure-app-services-web-app-website/

I'm temporarily using a the domain www.joburger.co.za

I've created the A, CNAME & TXT records on the domain (did them all to be sure). In Azure, I've added the hostname www.joburger.co.za and it works.

In Azure, I can also add another hostname for a subdomain, like test.joburger.co.za, and it works too.

But if I don't add a hostname in Azure, then it doesn't work.

How do I get Azure to handle the wildcards without having to manually add the hostnames each time?

like image 371
Sean Avatar asked Oct 07 '16 09:10

Sean


People also ask

Can you have a wildcard for a subdomain?

A wildcard subdomain is particularly useful if you desire subdomains to display whatever you set as the document root (a designated folder that stores web pages.) Typically, most wildcards are set to the site's homepage out of preference. This should be specified when creating the wildcard subdomain.

Can you use a wildcard in DNS?

A wildcard DNS record is a record that answers DNS requests for any subdomain you haven't already defined. You can create wildcard A records and CNAME records by entering an asterisk (*) in the Host field when creating a DNS record.


2 Answers

In your domain manager make sure you have...

  • CNAME * entry that points to yourapp.azurewebsites.net
  • CNAME awverify entry that points to awverify.yourapp.azurewebsites.net

Then in Azure, go to your App Service > Custom Domains and add a hostname *.yourdomain.com. This validates that the hostname is valid and if everything's good you can add the new wild card entry to your hostnames list.

enter image description here

like image 198
Juan Carlos Puerto Avatar answered Nov 27 '22 02:11

Juan Carlos Puerto


Check this if it helps to add wild card domain.
https://azure.microsoft.com/en-in/blog/azure-websites-and-wildcard-domains/

like image 26
Mitin Dixit Avatar answered Nov 27 '22 04:11

Mitin Dixit