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

2022-09-06 Thread Mohammad Ishtiaq Ashiq Khan via Pdns-users
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  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 *.
> >
> > www.google.comINLUAA"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 .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@mailman.powerdns.com
> > https://mailman.powerdns.com/mailman/listinfo/pdns-users
>
>
___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users


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

2022-09-06 Thread Otto Moerbeek via Pdns-users
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 *.
> 
> www.google.comINLUAA"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 .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@mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/pdns-users

___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users


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

2022-09-05 Thread Mohammad Ishtiaq Ashiq Khan via Pdns-users
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 *.

www.google.comINLUAA"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 .google.com), the
associated LUA script will be executed.

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@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users