0

I created a virtual machine with 2 network interfaces. One is bridged and the other one is host-only.

They are both using DHCP, and are overwriting the /etc/resolv.conf file.

  • if eth0 gets the DHCP response first then eth1 overwrites the file with the wrong DNS server address.

  • if eth1 gets the DHCP response first then eth0 overwrites the file with the right address and everything is fine.

It would be ideal to just always take the DNS response from eth0 (bridged interface).

I had a look at /etc/dhcp/dhcpclient.conf but i couldn't find a way to create somekind of if here so that the dhcp client would only request a dns address from eth0

what would be the best way to solve this?

1 Answer 1

0

The best way I've found to solve this "issue" is installing resolvconf package.

sudo apt-get install resolvconf

After that, /etc/resolv.conf is replaced by a symbolic link to /etc/resolvconf/run/resolv.conf that is dynamically generated by resolvconf with the info from the file /etc/network/interfaces

Note that dns-nameserver entries in /etc/network/interfaces are ignored if you don't have resolvconf package installed in your system. You can find more info about the resolvconf package info in Debian wiki documentation or using man pages.

man resolvconf

You must log in to answer this question.

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