possible ways to add domain name to website hosted on azure VM

Atul 21 Reputation points

As the title states, I would like to know about the possible ways through which I can add domain name to the website hosted in azure cloud over VM or if you could provide me the documents.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,106 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tasadduq Burney 8,361 Reputation points MVP

    Hello @Atul !

    Hope you are having a great day!
    Thank you for asking a Question! We are Glad to Assist you!.

    Please follow the steps mentioned below to add your Custom Domain to VM as alias.

    When you create a virtual machine in the Azure portal, a public IP resource for the virtual machine is automatically created. Your public IP address is shown in VM overview page.


    Shows the public IP address in the essentials section of the VM overview page.

    If you select the IP address you can see more information on it. Check to make sure your IP Assignment is set to Static. A static IP address will not change if the VM or resource reboots or shuts down.


    Shows the public IP configuration so you can see if the IP address is static.

    If your IP Address is not static, you will need to create an FQDN.

    1. Select your VM in the portal.
    2. In the left menu, select Properties
    3. Under Public IP address\DNS name label, select your IP address.
    4. Under DNS name label, enter the prefix you want to use.
    5. Select Save at the top of the page.
    6. Select Overview in the left menu to return to the VM overview blade.
    7. Verify that the DNS name appears correctly.

    Open a browser and enter your IP address or FQDN and verify that it shows the web content running on your VM.

    After verifying your static IP or FQDN, go to your domain provider and navigate to DNS settings.
    Once there add an A record pointing to your Public IP Address or FQDN. For example, the procedure for the GoDaddy domain registrar / Azure Domain Service is as follows:

    1. Sign in and select the custom domain you want to use.
    2. In the Domains section, select Manage All, then select DNS | Manage Zones.
    3. For Domain Name, enter your custom domain, then select Search.
    4. From the DNS Management page, select Add, then select A in the Type list.
    5. Complete the fields of the A entry:
    6. Type: Leave A selected.
    7. Host: Enter @
    8. Points to: Enter the Public IP Address or FQDN of your VM.
    9. TTL: Leave one hour selected.
    10. Select Save.
    11. The A record entry is added to the DNS records table.

    !How to create a DNS Zone in Azure?

    1. Create a DNS zone
    2. Go to the Azure portal to create a DNS zone. Search for and select DNS zones.
    3. DNS zone
    4. Select Create DNS zone.
    5. On the Create DNS zone page, enter the required values, and then select Create.


    1. Use the Above NameServer and update it on your Custom Domain Purchased from Azure Domain Services
    2. Go to Azure Domain
    3. Select your Domain
    4. Go to Advance Management
    5. Go to DNS and add the new Name Servers and save the changes
    6. After the Changes has been performed, add the Alias by going to your Virtual Machine's VNet > Configuration > Create Alias Record and Add your "@" and "www" record to your domain.

    After the record is created it usually takes about an hour for DNS propagate, but it can sometimes take up to 48 hours.

    Let me know if the above solution resolved your issue!

    Tasadduq Burney


    |- Please don't forget to "Upvote" and "Accept as answer" if the reply is helpful -|

0 additional answers

Sort by: Most helpful