[Dnsmasq-discuss] Re: Questions about "resolv-file"

Hugo Heden hugoheden at gmail.com
Mon Feb 9 13:16:41 GMT 2009


Adding a preliminary answer to all three questions below..

2009/2/9 Hugo Heden <hugoheden at gmail.com>:
> Adding a third question below..
>
> 2009/2/9 Hugo Heden <hugoheden at gmail.com>:
>> Good day all,
>>
>> Total rookie here. I am trying to understand things first by reading
>> documentation, i.e without really testing stuff. I have a few
>> questions about the "resolv-file" option in the configuration file, as
>> explained in:
>>
>> http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example
>> http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
>>
>> Ok, the example config file says (NOTE the typo in the example-conf
>> file: "other that" should be "other than"):
>>
>> # Change this line if you want dns to get its upstream servers from
>> # somewhere other that /etc/resolv.conf
>> #resolv-file=
>>
>>
>> Q--1-- Does this mean that
>>
>> (a) the nameservers specified in [resolv-file] will be *added* to the
>> ones in /etc/resolv.conf?
>>
>> *Or*
>>
>> (b) will the file(s) specified in [resolv-file] *override* the default
>> /etc/resolv.conf (so that dns will use servers specified in
>> [resolv-file] *instead of* in /etc/resolv.conf)?
>>
>>
>>
>> Q--2-- Can the resolv-file option be used to specify *several* files?
>>
>> The reason I ask the latter is that the man-page talks about using
>> more than one resolv.conf file, but does not specify if dnsmasq can be
>> told to do this using the conf-file:
>>
>> "Dnsmasq can be told to parse more than one resolv.conf file. This is
>> useful on a laptop, where both PPP and DHCP may be used: dnsmasq can
>> be set to poll both /etc/ppp/resolv.conf and /etc/dhcpc/resolv.conf
>> and will use the contents of whichever changed last, giving automatic
>> switching between DNS servers."
>>
>
>
> Q--3-- Could the man-page have mentioned the resolv-file option in the
> below text? I guess resolv-file can also be used here as well? The man
> page says:
>
>  "In order to configure dnsmasq to act as cache for the host on which
>  it is running, put "nameserver 127.0.0.1" in /etc/resolv.conf to
>  force local processes to send queries to dnsmasq. Then either
>  specify the upstream servers directly to dnsmasq using --server
>  options or put their addresses real in another file, say
>  /etc/resolv.dnsmasq and run dnsmasq with the -r /etc/resolv.dnsmasq
>  option."
>

I am starting to believe that the options in the config file pretty
much exactly reflect the corresponding command-line options.. heh..

So to understand the behaviour of resolv-file (in /etc/dnsmasq.conf),
I could probably just check what the man-page says about the
command-line option "-r, --resolv-file=<file>":

"Read the IP addresses of the upstream nameservers from <file>,
instead of /etc/resolv.conf. For the format of this file see
resolv.conf(5) the only lines relevant to dnsmasq are nameserver ones.
Dnsmasq can be told to poll more than one resolv.conf file, the first
file name specified overrides the default, subsequent ones add to the
list. This is only allowed when polling; the file with the currently
latest modification time is the one used. "

So the answers would be

A--1-- The default is "overridden"

A--2-- Yes,  specifying several files is possible (though it is not
clear whether to use space or comma as separator?)

A--3-- Yes.


Sorry to have bothered you all

Best regards

Hugo Heden



More information about the Dnsmasq-discuss mailing list