[Pdns-users] Is there any way to write an LUA record that will apply over multiple query names?
Mohammad Ishtiaq Ashiq Khan
iashiq5 at vt.edu
Tue Sep 6 11:19:24 UTC 2022
Hi,
Thanks for the suggestion. Wildcards won't really work as I don't want to
apply this for all query names, rather a subset of query names only. In my
example, only queries starting with www.
Note: applying the logic at LUA end won’t work as well because I want to
have the usual NXDomain response for the query names that does not match
the logic. For example, having an NXDomain response for blah.google.com
because it does not start with www.
Thanks.
On Tue, Sep 6, 2022, 4:06 AM Otto Moerbeek <otto at drijf.net> wrote:
> On Tue, Sep 06, 2022 at 01:18:06AM -0400, Mohammad Ishtiaq Ashiq Khan via
> Pdns-users wrote:
>
> > Hello,
> > I am currently using PowerDNS as an authoritative server for my domain
> and
> > was experimenting with dynamic DNS via LUA records. From the
> documentation,
> > it seems like the LUA record is limited to a particular query name only.
> > For example, if I add an LUA record like the following, it will apply
> only
> > if the query name is *www.google.com <http://www.google.com>*.
> >
> > www.google.com IN LUA A "ifportup(443, {'192.0.2.1',
> '192.0.2.2'})"
> >
> >
> > I was wondering whether it is possible to extend this dynamic behavior
> for
> > multiple query names. For example, if the query name has 'www' at the
> > beginning (not only for www.google.com but also for wwww.google.com),
> the
> > associated LUA script will be executed.
>
> You can use DNS wildcards:
>
> *.example.net IN LUA A "...."
>
> but be aware DNS wildcards have specific matching properties that
> might be surprising.
>
> For more details on DNS wildcard matching, see
>
> https://en.wikipedia.org/wiki/Wildcard_DNS_record
>
> -Otto
>
> >
> > Could anyone let me know if this can be done? If it can not be done using
> > LUA, is there any way to achieve this using PowerDNS or perhaps any other
> > standard DNS server software out there? Would be grateful if anyone could
> > help.
> >
> > Thanks and best regards,
> >
> > --
> > Mohammad Ishtiaq Ashiq Khan,
> > Ph.D. Student,
> > Department of Computer Science,
> > Virginia Tech
>
> > _______________________________________________
> > Pdns-users mailing list
> > Pdns-users at mailman.powerdns.com
> > https://mailman.powerdns.com/mailman/listinfo/pdns-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20220906/ab4a8881/attachment.htm>
More information about the Pdns-users
mailing list