[Dnsmasq-discuss] Can use sub-directories in addn-hosts?

David Rosenstrauch darose at darose.net
Thu Oct 18 15:46:02 BST 2012


On 10/18/2012 02:30 AM, Simon Kelley wrote:
>  From the man page for the current version of dnsmasq: If yours doesn't
> say this, you may have to upgrade: I can't find the exact version at
> which the directory-reading facility was added, but it was fairly long ago.
>
> -H, --addn-hosts=<file>
>     Additional hosts file.  Read  the  specified  file  as  well  as
>     /etc/hosts.  If  -h is given, read only the specified file. This
>     option may be repeated for more than one additional hosts  file.
>     If  a  directory  is given, then read all the files contained in
>     that directory.
>
> Cheers,
>
> Simon

Yes, I've already read that.

So reading between the lines from what that man page says, it sounds 
like the answer is:  no, dnsmasq is not able to handle a parent/child 
directory structure for --addn-hosts.


Just to clarify what I'm trying to do.  (Since it sounds like you may 
not have understood).

I'm already doing this (which works):

--addn-hosts=<hosts-dir>

where <hosts-dir> looks like:

<hosts-dir>/hosts-file-1
<hosts-dir>/hosts-file-2
...
<hosts-dir>/hosts-file-n


What I'm trying to do is this:

--addn-hosts=<hosts-dir>

<hosts-dir>/subdir-a/hosts-file-a1
<hosts-dir>/subdir-a/hosts-file-a2
<hosts-dir>/subdir-b/hosts-file-b1
...
<hosts-dir>/subdir-n/hosts-file-n1

Thanks,

DR




More information about the Dnsmasq-discuss mailing list