Skip to content

network – Block Parallels Desktop from connecting to domain without using `/etc/hosts`

  • by
Spread the love


Configure Parallels Desktop to stop editing /etc/hosts

You don’t mention which domains you are trying to block access to, but you can configure Parallels Desktop to stop fiddling with /etc/hosts, which will hopefully prevent this issue.

According to this Parallels Knowledge Base article, you can prevent Parallels Desktop from updating /etc/hosts as follows:

  1. Open the /Library/Preferences/Parallels/network.desktop.xml file and locate the following line:

    <NATDAllowEtcHostsWrite>1</NATDAllowEtcHostsWrite>

  2. Set the setting above to “0” (disabled) so that no records will be created in the /etc/hosts file.

Use firewall software

Alternatively, if the above method doesn’t work, you can block the domains by using a firewall software like Little Snitch (Little Snitch offers a free trial).

More information

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 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 /etc/hosts:

10.211.55.4 rhel6.3 rhel6.3.shared #prl_hostonly shared 

Now, by using either the rhel6.3 or rhel6.3.shared name, this VM can be accessed from the host or any other VM in the shared networking group.

Leave a Reply

Your email address will not be published. Required fields are marked *