NetworkManager dnsmasq dependency for static ip but not dhcp

Asked by Tyler

First off, I'm not sure if this is a bug as I am not familiar with internals of networkManager and dnsmasq and their working relationship. However, the behavior I observed I found odd. I imagine someone else out there can clarify why this is expected behavior, if it is not a bug.

TLDR version: with dnsmasq disabled in /etc/NetworkManager/NetworkManager.conf my DHCP NM connection resolves names just fine. However, when using a Static IP NM with the same default gateway, dns's, etc., then names do not resolve correctly. Granted, these are names on an internal network (e.g. "google.com" still resolves just fine in either case, as do other pages/sites).

Here's my askUbuntu post, for more detail (e.g. nmcli output for both cases):
http://askubuntu.com/questions/684709/dns-goes-missing-with-static-ip-via-networkmanager

Here are some existing launchpad bugs which appear to be related:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/959037
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1003842
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/998529

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"

$ apt-cache policy network-manager
network-manager:
  Installed: 0.9.4.0-0ubuntu4.4.1
  Candidate: 0.9.4.0-0ubuntu4.4.1
  Version table:
 *** 0.9.4.0-0ubuntu4.4.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.9.4.0-0ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

$ apt-cache policy dnsmasq
dnsmasq:
  Installed: (none)
  Candidate: 2.59-4ubuntu0.2
  Version table:
     2.59-4ubuntu0.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages
     2.59-4 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages

Thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu network-manager Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Add the IP you use for LAN resolution to the bottom of

/etc/resolvconf/resolv.conf.d/head

You can do this in terminal with:

echo "nameserver 10.0.0.1" | sudo tee -a /etc/resolvconf/resolv.conf.d/head > /dev/null

Reboot to test. Obviously, change the IP if your LAN DNS server is not 10.0.0.1

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

If dnsmasq is running on the local PC, use 127.0.0.1

Revision history for this message
Tyler (tniles09) said :
#3

Hmmm... well

/etc/resolvconf/resolv.conf.d/head

has a comment at the top of it saying it's a generated file, and changes will be overwritten. So that leads me to assume you meant this as momentary test? One that might even expire through a reboot?

I was more or less trying to see if anyone could comment on whether this is a bug or not. My issue was indeed resolved by re-enabling dnsmasq, so I do have static IP connectivity now. I just found it odd that nm was so dependent (in this case) on dnsmasq being active.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

The file is used to generate the text in /etc/resolv.conf which is generated each boot. If you add to the file then the configuration line/s you add will be used first.
It does sound like a bug but this is a good workaround.

Can you help with this problem?

Provide an answer of your own, or ask Tyler for more information if necessary.

To post a message you must log in.