locked
Transfering DNS Names between VMs RRS feed

  • Question

  • I wish to replace a VM on Azure with an updated image.   So I am going to create a new VM.    I then want to swap this VM in for the existing one by giving it the same DNS Name.  (This is a westeurope.cloudapp.azure.com name)

    I obviously have to remove the DNS name from the old VM, and then allocate it to the new VM.   But I have encountered issues in the past where I have not been allowed to allocate a DNS Name to a VM because it is still unavailable.   So my questions are;

    - How long does it take for a DNS Name to become detached from a VM that previously used it?

    - Is changing the DNS on a VM enough to release the previous name?

    - Is this DNS name 'saved' anywhere?  What is preventing a third party taking the DNS name after I release it, before I put it on my new VM?

    - Am I doing any of this the right way?

    Thanks all for any advice.

    Friday, June 1, 2018 11:31 AM

Answers

  • The DNS name is actually associated with the Public IP address resource, not with the VM directly. I suggest the best and safest way is to move the public IP address from your old VM to the new VM. You may be able to do this via the Portal, you can certainly do it using CLI or PowerShell.

    If you choose to remove the name and re-assign it to a new VM, then there may be a short delay before the name becomes available for re-use, but it shouldn't be long (less than a minute). Be sure to refresh your browser.

    There is nothing stopping someone else grabbing the DNS name in between removing it and re-assigning it. That's one reason why moving the Public IP Address between VMs might be a better approach.

    Regards,

    Jonathan (www.opsgility.com)

    • Proposed as answer by Jonathan Tuliani Friday, June 1, 2018 12:32 PM
    • Marked as answer by G_S_S Friday, June 1, 2018 1:44 PM
    Friday, June 1, 2018 12:32 PM

All replies

  • The DNS name is actually associated with the Public IP address resource, not with the VM directly. I suggest the best and safest way is to move the public IP address from your old VM to the new VM. You may be able to do this via the Portal, you can certainly do it using CLI or PowerShell.

    If you choose to remove the name and re-assign it to a new VM, then there may be a short delay before the name becomes available for re-use, but it shouldn't be long (less than a minute). Be sure to refresh your browser.

    There is nothing stopping someone else grabbing the DNS name in between removing it and re-assigning it. That's one reason why moving the Public IP Address between VMs might be a better approach.

    Regards,

    Jonathan (www.opsgility.com)

    • Proposed as answer by Jonathan Tuliani Friday, June 1, 2018 12:32 PM
    • Marked as answer by G_S_S Friday, June 1, 2018 1:44 PM
    Friday, June 1, 2018 12:32 PM
  • Thanks for your reply.  I'll look into moving the public IP instead.
    Friday, June 1, 2018 1:46 PM