lua2
This is a rewrite of existing Lua backend. This backend is stub between your Lua script and PowerDNS authoritative server. The backend uses AuthLua4 base class, and you can use same functions and types as in any other Lua script.
Warning
Some of the function calls and configuration settings have been changed from original Luabackend
, please review this document carefully.
Warning
All places which use DNS names now use DNSName class which cannot be compared directly to a string.
To compare them against a string use either tostring(dnsname)
or newDN(string)
.
Warning
There is no API version 1. Use Luabackend if you need version 1.
bool dns_dnssec
¶If your script supports DNSSEC, set this to true.
dns_lookup(qtype, qname, domain_id, ctx)
¶Perform lookup of given resource record name and type.
source_address
and real_source_address
.Expects a array which has tables with following keys:
dns_list(target, domain_id)
¶List all resource records for target.
lookup
function. Return false if not found or wanted.dns_get_domaininfo(domain)
¶Get domain information for given domain.
Return false if not supported or found, otherwise expects a table with keys:
last_check
is for automatic serial.
masters
, account
, notified_serial
are for master/slave interaction only.
If this function is missing, it will revert into looking up SOA record for the given domain,
and uses that, if found.dns_get_all_domains()
¶Get domain information for all domains.
dns_get_domain_metadata(domain, kind)
¶Get metadata value(s) for given domain and metadata kind.
dns_dnssec
is true.dns_get_all_domain_metadata(domain)
¶Get all metadata for domain.
dns_get_domain_keys(domain)
¶Get DNSSEC key(s) for the given domain. Content must be valid key record in format that PowerDNS understands.
Return false if not found or supported, otherwise expects array of tables with keys:
dns_get_before_and_after_names_absolute(id, qname)
¶Calculate NSEC before/after value for the given qname for domain with id.
Table with keys:
dns_dnssec
is true.
Hashing is required with NSEC3/5.
before
and after
should wrap, so that after record of last record is apex record.
You can use DNSName#canonCompare
to sort records in correct order.dns_set_notified(id, serial)
¶Called after NOTIFY so that backend can store the notified serial.