0

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:

192.168.130.10    main
192.168.130.12    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:     192.168.130.2
Address:    192.168.130.2#53

** 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.

1 Answer 1

5

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.

3
  • 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, 2011 at 19:08
  • In fact you will see the same behavior if you use as example VMWare workstation. I just tried it Oct 9, 2011 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, 2011 at 19:48

You must log in to answer this question.

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