DNS is not working, /etc/resolv.conf is not overwritten. Why?

I have this configuration in my server in the Network Manager connection:

/etc/NetworkManager/system-connections/wired-connection

[connection]
id=wired-connection
uuid=0c501f08acc5497cb7...
type=8023ethernet

[8023ethernet]

[ipv4]
method=manual
dns=8.8.8.8;
address1=192.168.1.250/24,192.168.1.1

[ipv6]
method=auto
ip6privacy=0

/etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=true

But my file /etc/resolv.conf (symbolic link) is not overwritten by the Network Manager. If I add manually the line nameserver 8.8.8.8 to the file it works well, but it is only a temporal solution. If I open the IP configuration, in the interface of Kubuntu, I see the DNS fields empty.

I also tried with this command, but it didn’t work
dpkg-reconfigure resolvconf

The route of my original configuration file is in /run/resolvconf/resolv.conf

And I found this file, it belongs to an old configuration /etc/resolvconf/resolv.conf.d/original

nameserver 213.60.205.175
nameserver 213.60.205.174
nameserver 212.51.33.110

Should I remove or edit this file to make it work?

I can access only remotely to the server, due to this I would like to be sure that’s going to work. If not I could break the connection

Thanks in advance

Update 03/08/15. Output of /usr/share/resolvconf/dump-debug-info

###### Start of debugging information for resolvconf ######
### ls -l /etc/resolvconf
total 16
-rw-r--r-- 1 root root  172 dic 13  2012 interface-order
drwxr-xr-x 2 root root 4096 jul  8 18:33 resolv.conf.d
drwxr-xr-x 2 root root 4096 jul  8 18:33 update.d
drwxr-xr-x 2 root root 4096 jul  8 19:11 update-libc.d
### cat /etc/resolvconf/interface-order
# interface-order(5)
lo.inet*
lo.dnsmasq
lo.pdnsd
lo.!(pdns|pdns-recursor)
lo
tun*
tap*
hso*
em+([0-9])?(_+([0-9]))*
p+([0-9])p+([0-9])?(_+([0-9]))*
eth*
ath*
wlan*
ppp*
*
### ls -l /etc/resolvconf/resolv.conf.d
total 8
-rw-r--r-- 1 root root   0 dic 13  2012 base
-rw-r--r-- 1 root root 151 dic 13  2012 head
-rw-r--r-- 1 root root  77 jul  8 18:21 original
-rw-r--r-- 1 root root   0 jul  8 18:26 tail
### cat /etc/resolvconf/resolv.conf.d/base
### cat /etc/resolvconf/resolv.conf.d/head
# 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
### cat /etc/resolvconf/resolv.conf.d/original
nameserver 213.60.205.175
nameserver 213.60.205.174
nameserver 212.51.33.110
### cat /etc/resolvconf/resolv.conf.d/tail
### ls -l /etc/resolvconf/run
ls: no se puede acceder a /etc/resolvconf/run: No existe el archivo o el directorio
### ls -l /run/resolvconf
total 4
-rw-r--r-- 1 root root   0 jul 29 10:10 enable-updates
drwxr-xr-x 2 root root  40 jul 29 10:10 interface
-rw-r--r-- 1 root root 151 ago  3 09:40 resolv.conf
### cat /run/resolvconf/enable-updates
### cat /run/resolvconf/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
### ls -l /run/resolvconf/interface
total 0
### ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 jul 24 12:59 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
### lsattr /etc/resolv.conf
lsattr: La operación no está soportada Mientras se leían las banderas en /etc/resolv.conf
### 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
### cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=true
###### End of debugging information for resolvconf ######

I’m using Kubuntu 14.04 by the way

Answer

The dnsmasq executable binary is included in the dnsmasq-base package.

When dns=dnsmasq appears uncommented in NetworkManager.conf, NetworkManager runs a dnsmasq instance to serve as a local forwarding nameserver.

The dnsmasq package includes configuration files which support running a dnsmasq instance independently of NetworkManager. The latter dnsmasq instance is configured by /etc/dnsmasq.conf.

The resolvconf utility is used by network interface configurers to manage nameserver information. On the basis of information that it has been provided it writes a file /run/resolvconf/resolv.conf which is intended to be used to configure the libc resolver. The file is activated in this role by creating a symbolic link from /etc/resolv.conf to /run/resolvconf/resolv.conf.

NetworkManager and ifup send nameserver information to resolvconf. Normally /etc/resolv.conf is a symbolic link to /run/resolvconf/resolv.conf and all works well.

In case dns=dnsmasq appears uncommented in NetworkManager.conf, NetworkManager supplies resolvconf with the nameserver address 127.0.1.1 which appears in resolv.conf; NetworkManager’s slave dnsmasq process listens at address 127.0.1.1 and forwards queries to external nameservers at addresses that NetworkManager has been configured to know about or has learned about via DHCP.

The questioner’s first remark is:

But my file /etc/resolv.conf (symbolic link) is not overwritten by the Network Manager. 

This indicates that there is a misconfiguration. /etc/resolv.conf should be a symbolic link to /run/resolvconf/resolv.conf and resolvconf should update the latter when some network interface is configured or deconfigured. Given that you have dns=dnsmasq in NetworkManager.conf, the nameserver line in resolv.conf should be nameserver 127.0.1.1, unless you have the server instance of dnsmasq running in which case it might be nameserver 127.0.0.1, thus directing the libc resolver to use the server instance of dnsmasq which listens at 127.0.0.1.

The questioner’s subsequent question is:

[...] /etc/resolvconf/resolv.conf.d/original [...]
Should I remove or edit this file to make it work?

This file (original) which is simply a copy of /etc/resolv.conf at the time the resolvconf package is installed, normally has no effect. It is kept by the resolvconf package in case the package is uninstalled, then this original file is put back at /etc/resolv.conf. In some cases /etc/resolvconf/resolv.conf.d/tail is a symbolic link to original but that is non-standard and if this holds for your system then you should change /etc/resolvconf/resolv.conf.d/tail to be an empty file or a symbolic link to /dev/null.

Attribution
Source : Link , Question Author : ChesuCR , Answer Author : jdthood

Leave a Comment