How to configure DNS for Azure CDN with multiple endpoints and root - azure

I own a domain "x.wiki" which is managed via domains.google
I have a website, which is split up into multiple endpoints using azure cdn.
sub1-x.azureedge.net - Subdomain 1 (intended site route with all content)
sub2-x.azureedge.net - Subdomain 2 (subdomain with limited
content)
sub3-x.azureedge.net - Subdomain 3 (subdomain with limited
content)
I want to serve these as follows.
www.x.wiki -> sub1-x.azureedge.net
x.wiki -> sub1-x.azureedge.net
sub2.x.wiki -> sub2-x.azureedge.net
sub3.x.wiki -> sub3-x.azureedge.net
currently it only works with www. / sub2. / sub3.
x.wiki doesnt resolve
Does anyone know how I can get this working correctly?
My understanding is that due to limitations with CNAME i cannot do this easily, however azureCDN to my knowledge does not give me an IP for use with custom domains.
Here is my DNS configuration.

You also use alias records to point your DNS zone apex x.wiki to Azure CDN endpoints. If your domain DNS provider does not support alias record for root domain, you could optionally to host your domain in Azure DNS.
In the Azure DNS zone, you could create an alias record like this,
Then, you will see one A record and one CNAME for your CDN endpoint.
After the records are verified, you could add the hostname x.wiki in the custom domain of your CDN endpoint.
Alternatively, you could try the workaround in this blog.
Set up a CNAME “cdnverify.” to
“cdnverify..azureedge.net”. Once all is verified and set up
(including SSL provisioning if desired), delete the CNAME and use
ANAME for the root record.

The answer to this is to redirect root to WWW from my DNS provider.
The cdnverify cname is not necessary.
https://www.tachyonstemplates.com/2018/google-domains-forward-root/
May re-open this if i still cant get adsense to resolve the root (because it is a redirect)

Related

Azure CDN - Custom hostname without www not working (NameCheap)

I'm trying to add a custom domain without www to Azure CDN services.
With www it's working perfectly. But without www I get an error (see first image)
I'd appreciate any help.
Refer to RFC 1912 - Section 2,4
A CNAME record is not allowed to coexist with any other data. In other
words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't also
have an MX record for suzy.podunk.edu, or an A record, or even a TXT
record.
a CNAME can not be used at the apex (aka root) of a domain, so we can not use the CNAME records for the root domain as the custom domain in the CDN profile.
As a workaround, set up a CNAME cdnverify.<yourdomain> to cdnverify.<endpoint>.azureedge.net. Once all is verified and set up (including SSL provisioning if desired), delete the CNAME and use ANAME for the root record. Read this blog for more details.
The official recommended method is to create alias records in the Azure DNS. See Point zone apex to Azure CDN endpoints. If so, you will delegate DNS zones with Azure DNS and configure alias records for your CDN profile.
Edit
Please note that
Pointing a zone apex to CDN endpoints for Azure CDN from Akamai is
currently not supported.
You could change to use other CDN tiers if you're using Azure CDN from Akamai.

WWW domain on azure

I am trying to configure a www domain on azure. I want to have website under this domain. My domain is "legia.fitness". I have created the DNS zone as follows:
On this picture you see 4 DNS servers. I have delegated my domain that I bought at home.pl to those servers:
And this doesn't work. When I try to browse legia.fitness I get "ERR_NAME_NOT_RESOLVED" error. What am I doing wrong?
Your Azure DNS zone does not have any A or CNAME records for www or # so the name cannot be resolved to an IP address.
Add a new A record with the label # set to the IP address of your Azure website, and another A record with the label www also set to the same IP address.
Alternatively, create CNAME records (both # and www) and set them to your Azure Website's name (e.g. yourwebsite.azurewebsites.net). CNAME records are aliases of existing A or CNAME records, but are slower to resolve which is why I prefer A records.
You haven't directed the domain anywhere yet.
You have a DNS zone that works. I can see the SOA records on Dig web interface.
Now you have to add CNAME/A records to the DNS zone to direct the traffic to where you want it.
Here is a guide for Azure Web Apps: https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-custom-domain-name
If you use something else, you'll need to find its guide.

Setting up a private domain for Swisscom Cloudfoundry

most domain providers don’t allow setting a CNAME record for a main domain. It’s usually only possible to set CNAME records for subdomains.
So now I’m wondering if it would be possible to set an A record instead, pointing to scapp.io’s IP address. I tried it yesterday and it seems to work great but I’m worried that IP address might not be stable.
Any ideas whether setting an A record to 194.209.246.110 is a valid option for configuring a "naked" domain?
We don't recommend A record to IP address. The IP addresses may change without prior announcement.
See docs.developer.swisscom.com -> DNS for Domains for other options than CNAME.
Configuring DNS for Your Registered Root Domain
To use your root domain (for example, example.com) for apps on App
Cloud you can either use custom DNS record types like ALIAS and ANAME,
if your DNS provider offers them, or subdomain redirection.
Note: Root domains are also called zone apex domains.
If your DNS provider supports using an ALIAS or ANAME record,
configure your root domain with your DNS provider to point at a shared
domain in App Cloud.
What domain provider do you use?

Azure Websites DNS

I have an azure website at yis3.azurewebsites.net - I have promoted this to be a "shared" site so that I can use a custom domain. I have the domain yorkshireimagescanning.co.uk that I bought from 123-reg.co.uk. I have configured this to give a CName record with dnsname of "awverify" and destination of awverify.yis3.azurewebsites.net.
I've waited over 12 hours and checked on digwebinterface.com and all looks good but when I click to "Manage custom domains" from the Azure portal , I enter a domain name of "yorkshireimagescanning.co.uk" but it won't accept it.
Please help
* Edit *
I've now waited a couple of days for domain propagation. Here's a screen grab from my domain registrar:
In the azure portal I've tried to add the following custom domains for the yis3.azurewebsites.net site but it won't accept any:
awverify.www.yorkshireimagescanning.co.uk
www.yorkshireimagescanning.co.uk yorkshireimagescanning.co.uk
awverify.yorkshireimagescanning.co.uk
Here's a screen grab from the portal:
To use yorkshireimagescanning.co.uk
To use your domain without the www. prefix you need to add an A Record in addition to the CNAME you've added for "awverify".
First, make sure you've added the domain to the Azure portal by following the instructions under "Set the domain name in management portal" here.
Next, follow the instructions under "Configure an A record for the domain name" on the same page. This involves pointing your domain directly at the IP address of the Azure web site. You should then have added 2 DNS records in total:
CNAME awverify.www awverify.yis3.azurewebsites.net
A xx.xx.xx.xx (your website's IP address)
I've marked the next option as "preferred" because it points your domain at the Azure hostname "yis3.azurewebsites.net" instead of directly at the IP address. The IP address of your Azure website won't change, but if you ever need to deploy your website elsewhere it will have a different IP, so there will be a delay while the DNS change propagates.
To use www.yorkshireimagescanning.co.uk (preferred)
To use your domain with a www. prefix you need to add another CNAME record in addition to the one you've already added.
First, make sure you've added the domain to the Azure portal by following the instructions under "Set the domain name in management portal" here.
Next, follow the instructions under "Configure the CNAME on your domain registrar" on the same page. This involves adding a CNAME that points "www" to your Azure website's hostname (yis3.azurewebsites.net). You should then have added 2 DNS records in total:
CNAME awverify.www awverify.yis3.azurewebsites.net
CNAME www yis3.azurewebsites.net
A note about domain forwarding: Don't use 301 forwarding unless your site has been permanently moved. Use 302 for temporary redirection. More details here.
I finally figured out what was wrong. I was deploying a new version of an existing site but the old version still had www.yorkshireimagescanning.co.uk set on the custom domains page. Once I deleted it then I was able to add the domain on the new azure site.

Hosting root domain (mydomain.com) with Windows Azure Shared Website?

I've been working on trying to get my own domain, for example mydomain.com, hosted in Azure Websites.
I upgraded/scaled to change my setting to "Shared".
I added CNAME record from www.mydomain.com to mydomain.azurewebsites.net.
I added www.mydomain.com to my website in azure under "Manage Domains", and it allowed me to add it successfully.
I am able to browse successfully to the website with www.mydomain.com.
I changed the A record for mydomain.com to point to the IP address listed under the Manage Domains section of the Azure website.
The CNAME and A record have propagated based on testing on my machine and on centralops.net DNS lookup tools.
If I browse to mydomain.com I get a 404. www.mydomain.com works as expected.
Can anyone help?
Step by step. This is working for me.
1 - In your DNS registrar create a CNAME record like following.
Name = awverify.mydomain.com
Value = awverify.mydomain.azurewebsites.net
TTL = 86400
2 - In Azure panel, add mydomain.com to your custom domains. It should show green check.
3 - Go back to your DNS registrar's web site and add an A Record for your custom domain using to IP provided to you by Microsoft in Azure Portal.
Name = mydomain.com
Value = 64.49.121.33
TTL = 7200
More info here.
I can think two options:
a) The Azure web server needs to be configured to browse your site with both www.mydomain.com and mydomain.com. Maybe you have configured only one in "Manage Domains"
b) mydomain.azurewebsites.net. resolves to a different IP than mydomain.com (the A Record you added in mydomain.com is wrong)
you need to work with a DNS provider that allows you to forward the A record to a DNS (Go Daddy provides this option) - i.e. www.mydomain.com points to mydomain.azurewebsites.net and mydomain.com is forwarded to www.mydomain.com

Resources