[Pdns-users] Is there any way to write an LUA record that will apply over multiple query names?

Otto Moerbeek otto at drijf.net
Tue Sep 6 08:06:05 UTC 2022


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



More information about the Pdns-users mailing list