Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running two VM's in VMware Workstation 7: My primary work VM (hostname main), runs Ubuntu 11.04. Uses VMnet0, which I configured to use NAT, and a Debian-based appliance (hostname server), also in VMnet0. Now I need to get some data from main to server, which I thought I would do using nfs. No problem there.

I thought I'd put the host names in my host's (Windows 7 x64, hostname desktop) hosts file. It looks like this:    main    server

In Windows 7, i tried a ping main and a ping server, and both succeeded. However, when I try to ping desktop or ping server from main, it fails. nslookup desktop returns


** server can't find desktop: NXDOMAIN

(analogous for nslookup server).

It looks like VMware's DNS server doesn't care about my hosts file. How do I fix this?

Edit: I should have mentioned that I can browse the internet just fine, DNS lookups work perfectly, however, overrides in the host's host file are not applied.

share|improve this question
up vote 5 down vote accepted

Hosts files work only for the machine they are on.

You'll need to make a Hosts file with entries for the other machines on each of the VM's as well.

share|improve this answer
Oh good. I thought that DNS requests passing through a machine would look at the hosts file of that machine. Thanks. – Raphael R. Oct 8 '11 at 19:08
In fact you will see the same behavior if you use as example VMWare workstation. I just tried it – Ricardo Polo Oct 9 '11 at 5:48
+1. Specifically, each virtual machine does it's own DNS lookups using whatever configuration you give the OS running in the VM. By the time your host sees network activity from the VM, it's just ethernet packets. – kbyrd Oct 27 '11 at 19:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .