Assign DNS name to VM in Azure to ensure remote connectivity

By default, an Azure virtual machine will receive a dynamic public IP, and as long as we keep it up and running that IP will not change. That is OK — depending on the nature of the application. However, in some cases — for example when we need to RDP to a server and the public IP keeps changing — that may become a challenge. Azure offers a great feature where we can assign a DNS name to the server, so even if the public IP changes, as long as you use the DNS name the connection will work.

We can configure a DNS name and use that to connect to our VMs. The process is straightforward. In the Overview page of any given VM, click on Configure located in the DNS Name item.

Assign a name for the VM in question, but keep in mind that suffix is being shown underneath the text field where we are defining the name of the VM. In our case, our VM will have the name vm001.canadacentral.cloudapp.azure.com. Click on Save.

We can use a DNS lookup site (in our example below, we are using MXToolbox) to see if the changes are in effect. As we can see the name is resolving to the public IP address of that instance.

Using this feature, the administrator can connect to the VM using DNS names instead of chasing them around with a dynamic public IP, which may change during the lifecycle of the server. When we check back in the Overview page of that given VM, we can copy the DNS name and use it accordingly.

Featured image: Shutterstock

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides of the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange, CISSP and several other certifications. Anderson contributes to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at Techgenix.com, MSExchange.org, ITPROCentral.com and Anderson Patricio.org (Portuguese).

Share
Published by
Anderson Patricio

Recent Posts

Don’t be a victim: Why MSPs must do an internal security audit

Managed Service Providers are in the crosshairs of hackers because the bad guys know MSPs hold a lot of sensitive…

6 hours ago

Azure Quick Tip: Link Azure Automation and Log Analytics workspace

Here’s a Quick Tip that will show you how to link an Azure Automation and Log Analytics workspace even if…

9 hours ago

Creating Hyper-V VMs from a CSV file with PowerShell

Expedite the process of creating several virtual machines with a PowerShell script that builds VMs based on the contents of…

11 hours ago

Provision VMs using Marketplace and save some valuable time

Do you provision VMs regularly? This step-by-step guide shows you a way to do it quickly that will save you…

14 hours ago

CRD in Kubernetes: Powerful boost for an already powerful platform

While Kubernetes is already the No. 1 container orchestration tool, a custom resource definition, or CRD, adds incredible custom features…

3 days ago

PowerShell Quick Tip: Consistent output in Azure Automation Accounts

Here’s another in our popular Quick Tips series. This one focuses on PowerShell and how it can help you get…

3 days ago