2

I edit /etc/resolvconf/resolv.conf.d/base:

$ cat /etc/resolvconf/resolv.conf.d/base 
nameserver 192.168.100.16

I force an update:

$ sudo resolvconf -u

I check if it worked:

$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.100.4
nameserver 192.168.100.3
nameserver 192.168.100.2
search openstacklocal

It didn't. Read the resolvconf manpage. Maybe updates are disabled?

   --updates-are-enabled
          Return 0 if the flag is set, otherwise return 1.

Let's see:

$ resolvconf --updates-are-enabled
$ echo $?
0

It is enabled then (right? 0 means enabled?). It might be that it was disabled before, I have also run sudo resolvconf --enable-updates. I will force the update again (even though being enabled should be enough):

$ sudo resolvconf -u

Let's check again:

$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.100.4
nameserver 192.168.100.3
nameserver 192.168.100.2
search openstacklocal

Nothing, zilch, nada! :(

Why is /etc/resolv.conf not being updated?

My system is:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
blueFast
  • 4,200
  • 13
  • 37
  • 54

1 Answers1

1

I don't know if it's the right answer or not but I've bickered with the resolvconf package long enough that I simply remove it on my servers these days and go back to hand-editing /etc/resolv.conf. Not sure why it's installed on a server install by default anyway. As I understand, the purpose of the package is to handle setup of resolvers, routes and other dynamic network settings via DHCP. I don't provision servers that way so it's useless to me.

For desktop systems, in a corporate environment, the reverse is true. DHCP is almost always used so some sort of automatic route and resolver twiddling is needed. For whatever reason, I've always found Ubuntu just can't get it right in this area. One way or another, something is always a problem. Sometimes the wifi interface is inexplicably disabled in some file under /var/ (don't recall where); othertimes, the DHCP settings would simply not be changed leaving no route or resolvers but you do have an IP to ping with so that's nice (wth).

That said, what I do with my corporate laptop is remove resolvconf as well any scraps left behind from /var/lib/ntpdate/default.dhcp and then follow the accepted answer here. It's B.S. but it doesn't require hours of frustration to troubleshoot or setup. Hopefully someone else has a better answer?

Server Fault
  • 3,714
  • 12
  • 54
  • 89