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

Kristian Lein-Mathisen kristian at adellica.com
Thu Jul 9 15:37:16 BST 2015


I see, that makes sense. I had a feeling that I'd had this working before.
Thanks Simon for the clarification.

Albert says:

> 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?


I often find config files to be clunky to work with. If you are writing a
script, for example, it's easier to skip the config file entirely and apply
all options in the script itself. Also, if you don't have root access, you
may not be able to modify /etc/dnsmasq.conf.

Thanks!
K.

On Tue, Jul 7, 2015 at 3:01 PM, Simon Kelley <simon at thekelleys.org.uk>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> This is a bug in 2.73. Either downgrade to 2.72, or (better) apply
>
>
>
> http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=90cb2225515faae2ca53bb6ff76a348fc6f1c403
>
> Cheers,
>
> Simon.
>
>
> On 07/07/15 10:21, Kristian Lein-Mathisen wrote:
> > 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! K.
> >
> >
> >
> > _______________________________________________ Dnsmasq-discuss
> > mailing list Dnsmasq-discuss at lists.thekelleys.org.uk
> > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQIcBAEBCAAGBQJVm82hAAoJEBXN2mrhkTWiJBIP/AoPC5fc0I5qQlLOv54rNkWP
> y1RqqXkWK/Zw9TONbScmY/O6evOt1rGF04u42kT6AcUVLKCRX+zQ5efupwfw4pX2
> 99IigAdTY6nFyViBQ32DqVYh3H4F5cCI6tKvt1WMSWqCMVPPwX2MrfCqpvshSF7Z
> Qw4r+ebNyyXilV3C9imbJmt3NIAkcJ7yxjWitKi8ap9MSbySWhhGlgH/G+8B5mMM
> y1mPBg1LRuYMUqS5Qi37yMYh4lCFTN6KH9Q7poFI/lGLxj3gygoIQQh+FGKwAeFc
> iX/W7RDaBYG4hITmMVkgw4pyUM2qki95E0sPBe+zq4fLDFWHZr7tLHmdrDawpN2J
> +yLsV5SbVCg7bQcU1XdwyrZruJ4pi2x4sVIojhJIinsIRtZvLsuor810ydRu85Nf
> uJcR3Y6s+asxnxRAOIR5PD94wfLL1iJx1NPdXWW24BYnyY+f+QX5vI6I/TLgQNA6
> ZTV9hdsDBsW9J6vgGUQBkQZ/Bu5KGWB2ouwxR2vutS4xeK0ankMmIyWc/B0OtyMr
> O3HNdWndp1ySBi7ZrzdlvrkJaO20N9MHggiVE2DGSn++792UQVMUkWARcMQtoLCe
> bNj9iaxL7jvVYuroC5sysMoGoFwxpCvgh3FtTCdn29sD+7/pHmr9v501IbqNcA97
> dxYm+KZ4E80ePttjv7e2
> =Neuz
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20150709/599499ba/attachment.html>


More information about the Dnsmasq-discuss mailing list