4

I have a Debian Wheezy VMware virtual machine guest with two network cards. One is in bridged mode and has access to the internet. The other is in host-only mode and does not.

Some process, perhaps dhclient, is writing and overwriting /etc/resolv.conf. Sometimes it's written with nameservers for the bridged network. Other times it's written with nameservers for the host-only network. When it's written with nameservers for the host-only network it seems like VMware does not forward/resolve ip requests to the name server configured in the host. In this case, the Debian guest doesn't resolve any domain names.

How can I configure whatever process is writing /etc/resolv.conf so that it's only written by the dhcp information received over the bridged network (eth0)?

drs
  • 5,363
  • 9
  • 40
  • 69
  • 3
    I suggest you to install [resolvconf](https://packages.debian.org/wheezy/resolvconf) and handle the order of the nameserver in `/etc/resolvconf/interface-order`. – jofel Apr 15 '15 at 12:03

1 Answers1

1

Set dns-nameservers in /etc/network/interfaces so your DHCP requests don't include request for DNS. If you leave the rest as dhcp auto, you'll still get IP addresses from the DHCP service.

The reason the DNS that is configured on your host is not getting requests from your VM is your network path. With two NICs you need to watch your routes and set static routes and which has priority in your VM to divert traffic down the interfaces correctly. That is one of the issues with multi-homing. Trace your packets and see where they are going. VMware is not blocking the traffic, but following the network rules which happens to be leading your DNS requests to a virtual network that cannot connect to your gateway.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
MyuFoxy
  • 21
  • 1