1

We have a server running Ubuntu 12.04 Server.

There are two network interfaces on this server (eth0 and eth1), which we've bonded as bond0. DNS is not working currently.. if I ping google.com I get cannot resolve host, but I can ping Google's IP addresses fine.

From what I've read, we just need to add dns-nameservers into /etc/network/interfaces, but I'm unsure if it's going to work the same with a bonded connection.

This is on a live production server with tons of users, so obviously don't want to screw up the network connection, as I only have SSH access!

Could anyone tell me if this is the correct way to do it? Is it correct to add the nameservers to the bond rather than each individual interface?

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual
bond-master bond0

auto eth1
iface eth1 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.1.15
gateway 192.168.1.100
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4 208.67.222.222
slaves eth0 eth1

Or is there an easier way to update the nameservers? We used to put them in resolv.conf but this now gets overwritten on reboots.

1
  • I guess you might try putting those nameserver entries in /etc/resolvconf/resolv.conf.d/head (just as you would put them in /etc/resolv.conf) and then restart the resolvconf service with service resolvconf restart - most likely the /etc/resolv.conf is dynamically created elsewhere (/run/resolvconf/resolv.conf, I think) and only symlinked to /etc - test that very simply by running ls -la /etc/resolv.conf. Have you got a similar machine elsewhere for testing? Oct 3, 2013 at 21:01

1 Answer 1

1

The server had to be rebooted today anyway for something else.. and the method in my original question worked fine. Just had to put:

dns-nameservers 8.8.8.8 8.8.4.4 208.67.222.222

in /etc/network/interfaces

You must log in to answer this question.

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