0

I want to bind my custom domain to my Azure VM.

The DNS name of my networking is, for example, xxx.westus2.cloudapp.azure.com (here I use xxx to replace my real DNS name label)

I have followed the answer from this link: https://stackoverflow.com/a/62185398

Azure VM has a default FQDN that you only could change the DNS label. If you want to add your own custom domain for that Azure VM, you could add a CNAME type DNS record like somename.my.domain.com CNAME myvmname.northeurope.cloudapp.azure.com or A type record like somename.my.domain.com A your Azure VM public IP address in your DNS domain my.domain.com provider.

But when I click my custom domain, it directs me to the following weblink. This is the same link when I click my public IP from AZURE. How can I make my custom domain directs to my xxx.westus2.cloudapp.azure.com?

Thanks for your help.

enter image description here

Wang
  • 1,314
  • 14
  • 21
  • Do you add a CNAME record as your reference in your DNS provider? – Nancy Apr 26 '21 at 07:26
  • @NancyXiong, Thanks a lot for your kind help. I have added a CNAME record in my DNS provider GANDI.net. What I only did is to change the host name to `xxx.westus2.cloudapp.azure.com.` I changed both CNAME and A record. Should I only change CNAME or vice versa? – Wang Apr 26 '21 at 07:39
  • You only need one of them. What do you mean by "How can I make my custom domain directs to my xxx.westus2.cloudapp.azure.com?". How do you verify it? – Nancy Apr 26 '21 at 07:48
  • @NancyXiong. I could open my webpage with `xxx.westus2.cloudapp.azure.com`, what I want now is to link to the same webpage with my custom domain. However, right now my custom domain directs me to the 'Welcome to nginx' webpage. – Wang Apr 26 '21 at 07:54
  • If you add the CNAME records just now, you can wait for DNS propagation time and verify it via https://www.whatsmydns.net/ – Nancy Apr 26 '21 at 08:00
  • @NancyXiong, Thanks for the website. It seems that it works. I added CNAME few hours ago. So I will wait for another 24h. – Wang Apr 26 '21 at 08:10

1 Answers1

0

To allow the website on your Azure VM to be accessed with a custom domain, you can add A or CNAME records in your DNS provider to map the public IP address or FQDN of Azure VM.

For example, you want to access www.contoso.com, you can add CNAME record www in the contoso.com zone.

www CNAME xxx.westus2.cloudapp.azure.com

It usually takes a few hours to wait for DNS propagation worldwide. You can verify it via this website https://www.whatsmydns.net/.

Let me know if you have any concerns.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Hi @Nancy, It still did not work. Do I need to change Nameservers as well? – Wang Apr 27 '21 at 14:34
  • Could you show how do you configure the dns?Is it azure dns? – Nancy Apr 27 '21 at 15:05
  • I bought the domain from gandi.net. My configuration looks like this: `www CNAME 10800 xxx.westus2.cloudapp.azure.com.` There is a **dot** after `xxx.westus2.cloudapp.azure.com` – Wang Apr 27 '21 at 15:09
  • Could you access the website www.domain.com? – Nancy Apr 27 '21 at 15:11
  • Yes I could. It leads me to **Welcome to Nginx** website as shown in the picture above. – Wang Apr 27 '21 at 15:50
  • Is it the same when you access that Fqdn of vm xxx.westus2.cloudapp.azure.com? – Nancy Apr 27 '21 at 15:52
  • No, it is different. I can access my cloudApp with xxx.westus2.cloudapp.azure.com – Wang Apr 27 '21 at 16:08
  • Could you describe how do you deploy your cloud app? It looks like some configuration that need to updated there. – Nancy Apr 27 '21 at 16:11
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/231663/discussion-between-wang-and-nancy-xiong). – Wang Apr 27 '21 at 16:26
  • I just found out that my Azure public IP address also directs me to the "Welcome to Nginx" website – Wang Apr 27 '21 at 16:36
  • The DNS should not the key point. The problem is that why the result of accessing public IP and fqdn is different. Is there any articles you followed that steps to deploy your cloudapp or websites? – Nancy Apr 28 '21 at 03:13