Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.