ambiguous config file

Bug #1652032 reported by Hadmut Danisch
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Hi,

I'm currently hunting some problems caused by some ambiguity in the dnsmasq config.

There's a directory /etc/dnsmasq.d, where some packages put files with except-interface=... clauses, telling other instances of dnsmasq to "Keep your fingers from my interface". Good practice.

But then, conf-dir=/etc/dnsmasq.d clauses in /etc/dnsmasq.conf are commented out, so actually the /etc/dnsmasq.d directory is not read by default.

Some packages that use dnsmasq therefore give it a --conf-dir=/etc/dnsmasq.d command line parameter to make it read all those config snippets.

This causes two problems:

- Not all packages give their dnsmasq this additional parameter, and therefore not all dnsmasq instances obey those config. E.g. NetwerkManager uses it's own /etc/NetworkManager/dnsmasq.d, libvirt does not read it either.

- Even those packages that use --conf-dir=/etc/dnsmasq.d do not all read the same, since there is an additional parameter telling which files to load or ignore, which is used differently by all the packages.

So it is quite unclear how these things should work together cleanly. Since the details are left to both the user's arbitrary configuration of /etc/dnsmasq.conf and every single package maintainer how he would prefer to use it, there's just a heap of confusion.

In my eyes the best way would be to just use

conf-dir=/etc/dnsmasq.d/,*.conf

in the /etc/dnsmasq.conf and have this as a default, and that's it.

regards

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: dnsmasq 2.76-4
ProcVersionSignature: Ubuntu 4.8.0-30.32-generic 4.8.6
Uname: Linux 4.8.0-30-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.3-0ubuntu8.2
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Dec 22 12:55:33 2016
InstallationDate: Installed on 2016-04-22 (243 days ago)
InstallationMedia: Lubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420)
PackageArchitecture: all
SourcePackage: dnsmasq
UpgradeStatus: Upgraded to yakkety on 2016-10-17 (66 days ago)

Revision history for this message
Hadmut Danisch (hadmut) wrote :
Changed in dnsmasq (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Network Manager does: --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d
and might therefore be an example of those that call it - as you mentioned it can be discussed if it would have to add the,*.conf or anything like it.

An example of a program not calling with --conf-dir=/etc/dnsmasq.d might be libvirt.
But then it explicitly wants no other config at all to influence it and in terms of the interface exceptions and such it is correct as it explicitly states the interface to bind to.
Call:
--conf-file=/var/lib/libvirt/dnsmasq/default.conf
But in there:
interface=virbr0
So instead of using exclusions it it very specific where to bind to.
Maybe that and similar cases are a reason why it should not always pull in the dnsmasq.d dir - not sure?

Could you list the other examples you found - as I assume to get an idea of potential side effects we would have to collect as much as possible.

Changed in dnsmasq (Ubuntu):
status: New → Confirmed
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.