Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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

1 Answer 1

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
        address 192.168.2.179
        netmask 255.255.255.0
        network 192.168.2.0
        broadcast 192.168.2.255
        gateway 192.168.2.1
        dns-nameservers 192.168.2.246
        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

 
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.