Page MenuHomeVyOS Platform

dnsmasq startup dependencies seem off
Closed, InvalidPublic

Description

I'm not sure what's causing this, but I am unable to start bind9 without that causing dnsmasq to start up, as well.

I have installed bind9 by adding the jessie package repository:

system {
    package {
        auto-sync 1
        repository community {
            components main
            distribution helium
            password ""
            url http://packages.vyos.net/vyos
            username ""
        }
        repository jessie {
            components "main contrib non-free"
            distribution jessie
            password ""
            url http://httpredir.debian.org/debian
            username ""
        }
    }
}

and installing bind9:

apt-get update
apt-get install bind9 bind9-doc dnsutils
systemctl enable bind9.service

(Of course, I also set up the files in /etc/bind.)

I deleted the config for service dns, which I expected would stop dnsmasq from starting. Unfortunately, it does not. I can even issue these commands:

systemctl disable dnsmasq
systemctl stop dnsmasq.service

And that does stop dnsmasq, but then this command:

systemctl restart bind9

(to try to get bind9 to bind to port 53) will inexplicably cause dnsmasq to start up too!

Of course, when both dnsmasq and bind9 try to start up, they fight for access to port 53 on each of the interfaces I care about, and things don't go well.

I have, for now, worked around this by specifying a bogus interface for dnsmasq to listen on:

service {
    dns {
        forwarding {
            listen-on nonexistent0
        }
    }
}

And that seems to get everything working (by causing dnsmasq to fail), but on reboot, I still see these messages:

...
[  OK  ] Reached target Network is Online.
         Starting LSB: start and stop the Quagga routing suite...
[  OK  ] Started System Logging Service.
[  OK  ] Started /etc/rc.local Compatibility.
         Starting Serial Getty on ttyS1...
[  OK  ] Started Serial Getty on ttyS1.
[FAILED] Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
See 'systemctl status dnsmasq.service' for details.
[DEPEND] Dependency failed for Host and Network Name Lookups.
[  OK  ] Started LSB: start and stop the Quagga routing suite.
         Starting VyOS Router...

I wonder what else might not be starting correctly because of the failed dependency. Checking the status of the dnsmasq.servce as suggested yields:

● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled)
  Drop-In: /run/systemd/generator/dnsmasq.service.d
           └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
   Active: failed (Result: exit-code) since Fri 2016-10-28 23:23:16 PDT; 36min ago

What is causing this linkage between bind9 and dnsmasq? No matter how much I disable dnsmasq, it will try to start again any time I try to start bind9. For the record, here is bind9's systemctl status:

● bind9.service - BIND Domain Name Server
   Loaded: loaded (/lib/systemd/system/bind9.service; enabled)
  Drop-In: /run/systemd/generator/bind9.service.d
           └─50-insserv.conf-$named.conf
   Active: active (running) since Fri 2016-10-28 23:21:58 PDT; 39min ago
     Docs: man:named(8)
 Main PID: 1589 (named)
   CGroup: /system.slice/bind9.service
           └─1589 /usr/sbin/named -f -u bind

Details

Difficulty level
Normal (likely a few hours)
Version
dev build 999.201609230235

Event Timeline

gadams set Version to dev build 999.201609230235.

That is not supported