skip to Main Content

What I understand from CNAME record is that, if we have this record in our Authoritative Name Server, then the DNS resolver will resolve for the CNAME record’s pointed path.

Let suppose I have test.azurewebsites.net, and I also own mynameistest.com, now I go and create CNAME record in my DNS Provider with the below details:

www.mynameistest.com CNAME test.azurewebsites.net

If I have created this record successfully, isn’t it enough as I will be pointing the DNS query to the hosted app service? Why do I need to tell Azure App Service that I have created a custom domain name for it with hostname as "www.mynameistest.com".

2

Answers


  1. Chosen as BEST ANSWER

    Will the IP Address point to that of test.azurewebsites.net if CNAME is added?

    Adding the CNAME record pointing to test.azurewebsites.net will make the DNS resolvers resolve queries for mynameistest.com to the IP Address associated with test.azurewebsites.net.

    Is this NOT enough?

    No. This is NOT enough, as the Azure App Service (or the underlying server, in general) needs to be "instructed" to respond to the requests for "mynameistest.com".

    How does the server know the URL(FQDN) being requested? Isn't it all about IP Addresses?

    During the TLS/SSL Handshake, when the client sends the "Client Hello" message, it embeds some "Extensions" header in it, one of those extensions is, "server_name", which tells the TLS/SSL Layer (of server) that which FQDN is being requested. Now, if the server is unaware of this, it will respond with 404 (Not Found). But if the server knows about this, it will send out the corresponding SSL Certificate from its pool of certificates (A server can host multiple websites/domains, and each of them can have one SSL Certificate, this is called Virtual Hosting).

    The above is reason why, we need to tell the Azure App Service to serve the requests for "mynameistest.com", and this "instruction" is given via adding the custom domain from the portal.


  2. Check the below steps:

    In DNS Zone, while creating CName you can clearly see in type to Link your subdomain.

    enter image description here

    There is no option related to the App Service in the created DNS Zone CName - record set for Azure resource

    enter image description here

    enter image description here

    Even if we provide the Alias name, we cannot see any option for App Service.

    Initially I have not given Alias in the created CName.

    enter image description here

    Now, in my Azure App Service, I have added the custom domain with subdomain.

    enter image description here

    Now when I check in the created CName in DNS Zone, I can see the Alias name is added with the WebApp name.

    enter image description here

    When we assign the Web App to the created domain name, the domain name will be available in the Alias.

    So, it is necessary to tell the App Service which CName we have to use.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search