How do I get the default Network Manager plus dnsmasq-base setup back again?
Tom H
tomh0665 at gmail.com
Sun Jan 6 21:55:10 UTC 2013
On Sun, Jan 6, 2013 at 10:35 AM, Chris Green <cl at isbd.net> wrote:
> On Sat, Jan 05, 2013 at 08:30:19PM -0500, Tom H wrote:
>> On Sat, Jan 5, 2013 at 9:28 AM, Chris Green <cl at isbd.net> wrote:
>>> A while ago I installed the 'full' dnsmasq package on my desktop machine
>>> so that it ran as a the DNS and DHCP server on my LAN. In addition to
>>> installing dnsmasq (and configuring /etc/dnsmasq.conf) I commented out
>>> the dns=dnsmasq line in /etc/NetworkManager/NetworkManager.conf.
>>>
>>> This setup worked fine for a while but now I want to use another server
>>> on my LAN to provide DNS and DHCP.
>>>
>>> I have removed the dnsmasq package from my desktop machine and have
>>> uncommented the dns=dnsmasq line in /etc/NetworkManager/NetworkManager.conf.
>>> However Network Manager *isn't* running dnsmasq as it should.
>>>
>>> How do I get back to the default setup with dnsmasq being run by Network
>>> manager as a caching DNS server? I have tried uninstalling and
>>> reinstalling Network Manager but that doesn't help at all.
>>
>> Have "/etc/default/dnsmasq", "/etc/dnsmasq.conf", "/etc/dnsmasq.d/",
>> and "/etc/init.d/dnsmasq" (and any symlinks to the latter in
>> "/etc/rcX.d/") been deleted by uninstalling dnsmasq-base?
>>
> /etc/default/dnsmasq, /etc/dnsmasq.conf and /etc/init.d/dnsmasq are all
> gone.
>
> /etc/dnsmasq.d/ still exists but has a single file "network-manager" in
> it which I think is as it should be for the default setup. It's like
> that on the similar system I have where the dnsmasq run by network
> manager is working OK.
Oops, sorry about "/etc/dnsmasq.d/"; I was working without an Ubuntu
install to look at...
>> Not quite what you want:
>>
>> Why don't you re-install dnsmasq and use it as a forwarding and
>> caching dns server. You can disable its dhcp-server feature with
>> "no-dhcp-<something>" (I've forgotten what "<something>" is) in
>> "/etc/dnsmasq.conf".
>>
> Yes, I could do that, but I'd really like to get back to the default
> setup. I keep my system as standard as I possibly can.
>
> It all actually works OK as it is of course because the DNS is set up
> correctly in /etc/resolv.conf by Network Manager (pointing at my new DNS
> server on the LAN).
I installed Ubuntu in a VM (server edition).
I installed NM and commented out eth0 in "/etc/network/interfaces".
"127.0.1.1" was the dns server according to "/etc/resolv.conf" and my
dhcp-supplied dns server was the dns server according to "nm-tool".
There was an empty "/run/nm-dns-dnsmasq.conf"; I wish that that held
the dhcp-supplied dns server and nm-tool reported the local dns server
and not the upstream one...
I installed dnsmasq and commented out "dns=dnsmasq" in
"/etc/NetworkManager/NetworkManager.conf". "127.0.0.1" (not
"127.0.1.1" but it doesn't matter; the NM maintainer must've
debianized his/her package) was the local dns server according to
"/etc/resolv.conf" and my dhcp-supplied dns server was the dns server
according to "nm-tool". "/run/dnsmasq/resolv.conf" held my
dhcp-supplied dns server.
I purged dnsmasq and the situation returned to the previous
"integrated/builtin" behavior.
Are you sure that you have "dns=dnsmasq" in
"/etc/NetworkManager/NetworkManager.conf"?
What's the output of "ls /etc/dbus-1/system.d/"?
This is the log of the last reboot:
root at dnsmasqtest:~# grep dnsmasq /var/log/syslog
Jan 6 21:26:49 dnsmasqtest NetworkManager[672]: <info> DNS: loaded
plugin dnsmasq
Jan 6 21:27:09 dnsmasqtest NetworkManager[672]: <info> DNS: starting dnsmasq...
Jan 6 21:27:09 dnsmasqtest NetworkManager[672]: <error>
[1357507629.91780] [nm-dns-dnsmasq.c:390] update(): dnsmasq not
available on the bus, can't update servers.
Jan 6 21:27:09 dnsmasqtest NetworkManager[672]: <error>
[1357507629.91875] [nm-dns-dnsmasq.c:392] update(): dnsmasq owner not
found on bus: Could not get owner of name
'org.freedesktop.NetworkManager.dnsmasq': no such name
Jan 6 21:27:09 dnsmasqtest NetworkManager[672]: <warn> DNS: plugin
dnsmasq update failed
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: started, version 2.63rc6
cache disabled
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: compile time options: IPv6
GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: DBus support enabled:
connected to system bus
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: warning: no upstream servers
configured
Jan 6 21:27:09 dnsmasqtest NetworkManager[672]: <warn> dnsmasq
appeared on DBus: :1.9
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: setting upstream servers from DBus
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: using nameserver 8.8.4.4#53
Jan 6 21:27:09 dnsmasqtest dnsmasq[902]: using nameserver 8.8.8.8#53
root at dnsmasqtest:~#
Amazingly, NM gets the dns servers from "/var/run/dnsmasq/resolv.conf"
when dnsmasq is installed and "dns=dnsmasq" is commented out in
"/etc/NetworkManager/NetworkManager.conf"! (I deleted syslog before my
last reboot so I can't post those logs.)
More information about the ubuntu-users
mailing list