Viewing and Modifying Hostnames
Updated: December 4, 2014
To view the hostnames for your role instances or VMs, select one of the methods below, based on your deployment.
You can view the hostname for a role instance by obtaining the service configuration file that was used to create the role instance. The value that defines the hostname is vmName=“<vm-name>”. This value becomes the root of the hostname. The value is then translated into the hostname by appending the instance number to the vmName. For example, if the vmName is “MyApp”, then vmName=“MyApp”, the hostnames would be “MyApp01”, “MyApp02”, “MyApp03” etc.
<Role name="<role-name>" vmName=“<vm-name>”>
|In the Management Console, Name does not refer to the hostname of your role instance. To obtain the hostname of your role instance, view the Service Configuration file.|
There are multiple ways to view the hostname of your virtual machine. If you are not in the Management Portal, you can use a remote desktop connection directly to the virtual machine. View the hostname under Computer Properties or use ipconfig/all or hostname in the command prompt. You can also use any other method that you typically would use to view the hostname of a virtual machine that is running remotely.
To view the hostname of a virtual machine by using the Management Portal, navigate to the Dashboard view for the virtual machine, then locate Host Name in the quick glance menu.
|In the Management Portal, Name and Host Name can have the same value. However, Name does not refer to hostname. If you change the hostname of your virtual machine, only the Host Name field is updated. The value in Name will remain unchanged. Name resolution is based on the value listed in Host Name.|
To change the hostname for your role instance or virtual machine, select one of the methods below, based on your deployment.
To modify the hostname for role instances, modify the vmName=“<vm-name>” value in the Service Configuration file, and then upload your modified Service Configuration file to the Management Portal.
For more information about configuring an Azure Service, see Azure Service Configuration Schema (.cscfg).
<Role name="<role-name>" vmName=”<vm-name>”>
To change the hostname for virtual machines, use any method that you would typically use to remotely change a hostname of an on-premises computer. For example, you can connect to the host by using a remote desktop connection, and then change the name. If your DNS server is configured properly to pick up hostname updates and the client can connect to the DNS server, then the update will be made and the new hostname will be registered in DNS automatically.