Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have what was a perfectly functioning Ubuntu 13.04 server running a LAMP stack using NAT. A change to the host configuration required that I use bridged networking and a static IP. I've set up a thousand static IPs in Ubuntu versions prior to version 12, but now I can't get a DNS configuration to stick. I can get DNS working fine if I manually add my DNS servers to resolv.conf every session, but that's a pain? 13.04 release notes mentioned a change whereby I insert the line dns-nameservers x.x.x.x into the interfaces file, but that doesn't seem to do anything either. Any ideas what's up with my DNS?

share|improve this question
After digging a fair bit deeper into the documentation, I stumbled, quite by accident onto adding the line: prepend domain-name-servers x.x.x.x, y.y.y.y; to my dhclient.conf file. Hadn't really considered that sort of configuration change as the idea was to NOT use DHCP. Just in case anyone else gets caught in the same trap. – user1119648 Jul 31 '13 at 3:42

The same approach can be used with static IP's. Instead of editing /etc/resolv.conf, you should be editing /etc/network/interfaces. It should include something like:

auto eth0
iface eth0 inet static
        dns-search home

The next time you restart your system (or just network services), you'll see the proper entries in /etc/resolv.conf.

share|improve this answer
I wasn't clear. I only edited resolv.conf to test that my internet would actually work. The IP addresses were working fine, I just had no name resolution. What you posted is exactly what my interfaces file looks like, but it still wasn't using my static DNS servers. It would have no DNS at all. I found the answer in a thread about uninstalling DHCP which seemed like a lot of work to make DNS work properly. – user1119648 Jul 31 '13 at 12:26

Your Answer


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.