Handling resolv.conf on Ubuntu Server 14.04 LTS
tomh0665 at gmail.com
Mon Jun 16 10:40:50 UTC 2014
On Mon, Jun 16, 2014 at 4:15 AM, Niki Kovacs <info at microlinux.fr> wrote:
> Le 15/06/2014 17:41, Tom H a écrit :
>> If you'd like to disable resolvconf:
>> 1) Remove "dns-nameserver[s]" from "/etc/network/interfaces"
>> 2) Change "/etc/resolv.conf" into a file and populate it with
>> "nameserver 127.0.0.1"
>> 3) Run "echo manual > /etc/init/resolv.override"
> I tried to do as you suggested. resolv.conf still gets overwritten upon
> reboot. And as a side effect, SSH login also "hangs" for what seems to be
> an eternity.
> So the lesser evil seems to be to put all the stuff in
> /etc/network/interfaces and restart the whole server when I want to make
> changes to resolv.conf.
Are you using dhcp?
If you are, it's dhclient that's rewriting "/etc/resolv.conf".
You could edit "/etc/dhcp/dhclient.conf" ("supersede
domain-name-servers ..." or "prepend domain-name-servers ...") but, if
I were you, I'd choose to re-enable resolvconf and, rather than use
"dns-nameserver[s] ...", I'd have:
# cat /etc/resolvconf/resolv.conf.d/head
BTW, the symlink is "/etc/resolv.conf" to "/run/resolvconf/resolv.conf".
More information about the ubuntu-users