0
votes

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

1
Do you add a CNAME record as your reference in your DNS provider?Nancy Xiong
@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
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 Xiong
@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
If you add the CNAME records just now, you can wait for DNS propagation time and verify it via whatsmydns.netNancy Xiong

1 Answers

0
votes

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.