[Dnsmasq-discuss] how to avoid reading /etc/dnsmasq.conf

Albert ARIBAUD albert.aribaud at free.fr
Tue Jul 7 11:13:44 BST 2015


Bonjour Kristian,

Le Tue, 7 Jul 2015 11:21:34 +0200, Kristian Lein-Mathisen
<kristian at adellica.com> a écrit :

> Hi!
> 
> I'm using dnsmasq for bootstrapping our embedded linux device, and dnsmasq
> is working really great.
> 
> However, I cannot seem to be able to avoid dnsmasq reading the
> configuration file from /etc/dnsmasq.conf and use _only_ my command-line
> arguments. Lets say you have this:
> 
> $ cat /etc/dnsmasq.conf
> tftp-root=/bad/path
> enable-tftp
> 
> $ dnsmasq -tftp-root=/good/path
> dnsmasq: TFTP directory /bad/path inaccessible: No such file or directory
> 
> $ # this doesn't work either:
> $ dnsmasq --conf-file="" -tftp-root=/good/path
> dnsmasq: TFTP directory /bad/path inaccessible: No such file or directory
> 
> $ dnsmasq --version
> Dnsmasq version 2.73  Copyright (c) 2000-2015 Simon Kelley
> Compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6
> no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect inotify
> 
> Why does the conf-file take presedence over command-line args? Why does it
> try to read /etc/dnsmasq.conf even though I'm giving it an empty filename
> for a conf-file?
> 
> Thanks for any pointers!

Seems like you cannot prevent dnsmasq from reading its configuration
file. You can, however, make this file empty.

... and of course, I feel compelled to ask: why do you want to avoid
reading the configuration file?

> K.


Amicalement,
-- 
Albert.



More information about the Dnsmasq-discuss mailing list