NM doesn't sets the DNS properly, forces local dnsmasq as a resolver

Bug #1577724 reported by Uqbar
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
New
Low
Unassigned

Bug Description

1. Setup a network with DHCP address, gateway and DNS.
2. Connect to that network.
3. Check the resolver configured in /etc/resolv.conf

Expected result:
To find "nameserver" set to the DNS addresses provided by the external DHCP server

Actual result:
"nameserver=127.0.1.1" in any case.

This related to https://bugs.launchpad.net/bugs/1577720

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: network-manager 1.1.93-0ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-21.37-lowlatency 4.4.6
Uname: Linux 4.4.0-21-lowlatency x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: KDE
Date: Tue May 3 12:42:19 2016
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2016-04-22 (10 days ago)
InstallationMedia: Kubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
IpRoute:
 default via 192.168.1.1 dev wlxc4e9840ddc04 proto static metric 600
 169.254.0.0/16 dev wlxc4e9840ddc04 scope link metric 1000
 192.168.1.0/24 dev wlxc4e9840ddc04 proto kernel scope link src 192.168.1.95 metric 600
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH CONNECTION CON-UUID CON-PATH
 wlxc4e9840ddc04 wifi connected /org/freedesktop/NetworkManager/Devices/0 SIGKILL 2986445c-d935-4b58-b3ca-da6199994dd4 /org/freedesktop/NetworkManager/ActiveConnection/5
 C0:EE:FB:44:15:8A bt disconnected /org/freedesktop/NetworkManager/Devices/3 -- -- --
 enp3s0 ethernet unavailable /org/freedesktop/NetworkManager/Devices/1 -- -- --
 lo loopback unmanaged /org/freedesktop/NetworkManager/Devices/2 -- -- --
nmcli-nm: Error: command ['nmcli', '-f', 'all', 'nm'] failed with exit code 2: Error: Object 'nm' is unknown, try 'nmcli help'.

Revision history for this message
Uqbar (uqbar) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

thank you for your bug report. Do you have "dnsmasq-base" installed (your logs suggests it's can contact the service)?

Changed in network-manager (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Uqbar (uqbar) wrote :

Sorry I haven't fully got your question.
Yes, I think I have dnsmasq running, but that's default by installation.
What do you mean with "can contact the service"?

Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

I believe this is by design. NetworkManager starts up a dnsmasq instance that then uses the DNS servers provided by the DHCP server to resolve queries. This is so that dnsmasq acts as a DNS caching application.

If you run tcpdump or wireshark to log DNS queries made, you should see that the DNS servers provided by the DHCP server are used.

Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

Alternatively, you can create a file (choose any file name) in /etc/NetworkManager/conf.d/ with the following in it:

[main]
dns=default

This should have NetworkManager not use dnsmasq and update resolv.conf.

Revision history for this message
Uqbar (uqbar) wrote :

What about when I choose to only get the address from DHCP and not the DNS?
Is tcpdump (and the likes) the only way to know which DNSes have been configured?

Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

If you choose to only get the IP address from DHCP and you don't specify and DNS servers to use, then there won't be any DNS servers configured (besides 127.0.1.1).

What will happen is that a DNS request will be sent to 127.0.1.1 (dnsmasq). dnsmasq doesn't have any upstream servers configured, so unless the IP address for the domain is statically set somewhere in the configuration file, DNS won't work.

Revision history for this message
Uqbar (uqbar) wrote :

I choose to get just the IP address and set my own DNS servers.
I expect to see those addresses appear somewhere, usually /etc/resolve.conf, the standard resolver configuration file.

Changed in network-manager (Ubuntu):
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.