- I want to know more about using virtual machine names as DNS names.
In Parallels Desktop Pro Edition a virtual machine's name will be automatically registered in the host's /etc/hosts records if the following statements are true:
- The VM is in Shared or Host-Only network mode; and
- the VM gets an IP address from DHCP (not a static).
For example, say you have a VM named rhel6.3-netperf which is in shared networking mode with the DHCP-assigned IP 10.211.55.4. When you start the VM, a new record will be created in the /etc/hosts:
10.211.55.4 rhel6.3-netperf rhel6.3-netperf.shared #prl_hostonly shared
Now, by using either the rhel6.3-netperf or rhel6.3-netperf.shared name, this VM can be accessed from the host or any other VM in the shared networking group.
How do I disable this functionality?
Open the /Library/Preferences/Parallels/network.desktop.xml file and locate the following:
NATDAllowEtcHostsWrite: default = 1.
If the setting above has 0 value (is disabled) no records will be created in the /etc/hosts file
VirtualNetwork -> HostOnlyNetwork -> RegVmNameInEtcHosts: default =1.
If this setting is disabled, VMs from this network won't register in either NATD or in the /etc/hosts file.
VirtualNetwork -> HostOnlyNetwork -> EnableDNS: default =1.
This setting enables the DNS server in the network. It can be disabled, but not for shared networking.
Initial registration occurs at the first VM request to DHCP. The VM is then registered in the /etc/hosts file so there is a record created. When the VM is shut down, the record is deleted. However, of the VM was force-stopped, the record will not be deleted.
Parallels records in the /etc/hosts file have #prl_hostonly in the string.
How do I specify a DNS name?
A DNS record in the /etc/hosts file is given the name of the VM from its configuration. A name which is given from within the guest OS is not considered.