1

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?

1
  • 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. Commented Jul 31, 2013 at 3:42

1 Answer 1

0

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.

1
  • 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. Commented Jul 31, 2013 at 12:26

You must log in to answer this question.

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