Handling resolv.conf on Ubuntu Server 14.04 LTS
Niki Kovacs
info at microlinux.fr
Sat Jun 14 05:03:29 UTC 2014
Hi,
I've just installed Ubuntu 14.04 LTS on a public server. Until now I've
mainly used Slackware for this sort of thing. I'm doing a lot of RTFM to
see how Ubuntu handles things.
Right now I'm into configuring DNS with BIND, and something puzzles me.
The traditional *NIX way of configuring the resolver is to just add a
line or a couple lines in /etc/resolv.conf. Now Ubuntu doesn't handle
things that way, and after reading the corresponding section in the
official documentation, here's what my /etc/network/interfaces looks like:
--8<----------------------------------------
# /etc/network/interfaces
# lo
auto lo
iface lo inet loopback
# eth0
auto eth0
iface eth0 inet static
address 195.154.104.191
netmask 255.255.255.0
gateway 195.154.104.1
dns-nameservers 62.210.16.6 62.210.16.7
dns-search online.net
--8<----------------------------------------
Now let's say I just installed BIND and want to use it, be it as a
simple caching nameserver or as a primary domain server. In that case,
on a traditional *NIX system I'd simply open /etc/resolv.conf and add
the following line :
nameserver 127.0.0.1
And that's it. Immediate effect, without restarting anything.
Now I wanted to do something similar on my Ubuntu server, so I figured
this information would go in /etc/network/interfaces, like this:
# eth0
auto eth0
iface eth0 inet static
address 195.154.104.191
netmask 255.255.255.0
gateway 195.154.104.1
dns-nameservers 127.0.0.1
dns-search online.net
And now what ? Invoking '/etc/init.d/networking restart' has no effect
on the content of /etc/resolv.conf, which still keeps the old values.
Do I really have to restart my whole server just to change my DNS
resolver ? There must surely be another way.
Cheers,
Niki
--
Microlinux - Solutions informatiques 100% Linux et logiciels libres
7, place de l'église - 30730 Montpezat
Web : http://www.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32
More information about the ubuntu-users
mailing list