Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  moon.musick Oct 3 '13 at 21:01

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

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.