[Dnsmasq-discuss] question on dnsmasq capability...trying to do something maybe a bit unusual

clemens fischer ino-news at spotteswoode.dnsalias.org
Fri Jun 11 20:53:06 BST 2010


Chris Friesen wrote:

> Care to be more specific?  Currently I have a rule of the form:
> 
> server=/company1.com/a.b.c.d
> 
> As far as I can tell there is no way to distinguish between domains and
> hosts in the "server" option, so how do I make it so that "company1.com"
> itself goes to the standard servers instead of a.b.c.d?
> 
> What I would like is to have wildcards such that I could use rules of
> the form:
> 
> server=/company1.com/#
> server=/*.company1.com/a.b.c.d

I don't think this type of wildcard is implemented directly.  If
internal hosts of example.com had a common label "int", though, it would
be:

    server=/example.com/#
    server=/int.example.com/a.b.c.d

If not, you could try to list all the internal hosts manually:

    server=/example.com/#
    server=/h1.example.com/a.b.c.d
    server=/h2.example.com/a.b.c.d
    server=/h3.example.com/a.b.c.d

It works the other way around, too:

    server=/example.com/a.b.c.d
    server=/wellknown1.example.com/#
    server=/wellknown2.example.com/#
    server=/wellknown3.example.com/#

Here the world visible wellknownX hosts are resolved from upstream
forwarders while less specific queries go to a.b.c.d.

The manual describes the relevant option quite clearly:

-S, --local,
--server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]]
...

Other options are to use etc/resolv.conf or include a file containing
"address" directives.


clemens




More information about the Dnsmasq-discuss mailing list