azurednsazure-virtual-machinedns-name

Change DNS name to Azure VM


I assigned a DNS name label to my VM. Now, I changed it with another one, and I want to assign the old one to another VM, but it says it is already in use. Do you know how to do it?


Solution

  • If I understood your question correctly you have two VMs with you. Let's say OldVM and a NewVM.

    Now this OldVM has a DNS name, let's say demoarko. You want to change this name to let's say demoarko1

    and use the demoarko dns name in your NewVM.

    The easiest way is to just go to your respective VMs from portal and under overview, click on your VM's public IP. It should open a page something like this-

    enter image description here

    Now as you can see we have dns name there demoarko

    Let's change it to demoarko1

    enter image description here

    Done. No issues so far.

    Now will use this demoarko dns name in my NewVM.

    Same way goto that VM and click on it's public IP from portal-> overview section. It should open up a similar page.

    enter image description here

    And it accepted demoarko dns name (existing one which was on OldVM)

    If I want to cross check it now from CLI level as well, I can see

    enter image description here

    it is reflecting. MS says

    enter image description here

    Found few additional MS docs-