- Lua preoutquery filter 3457a2a0ec41d3b3aff7640f30008788e1228a6e
- Lua IP-based filter (ipfilter) before parsing packets 4ea949413c495254acb0bd19335142761c1efc0c
- `iputils` class for Lua, to quickly process IP addresses and netmasks in their native format
+- `getregisteredname` function for Lua, to find the registered domain for a given name
- Various new ringbuffers: top-servfail-remotes, top-largeanswer-remotes, top-servfail-queries
Speedups:
To indicate that an answer should not be cached in the packet cache, use
`setvariable()`. Available since version 3.3.
+`getregisteredname('www.powerdns.com')` returns `powerdns.com.`, based on Mozilla's
+Public Suffix List. In general it will tell you the 'registered domain' for a given
+name.
+
To get fake AAAA records for DNS64 usage, use `return "getFakeAAAARecords",
domain, "fe80::21b:77ff:0:0"`. Available since version 3.4.
#include <boost/foreach.hpp>
#include "logger.hh"
#include "namespaces.hh"
+#include "rec_channel.hh"
+
+static int getRegisteredNameLua(lua_State *L) {
+ const char *name = luaL_checkstring(L, 1);
+ string regname=getRegisteredName(name);
+ lua_pushstring(L, regname.c_str());
+ return 1;
+}
RecursorLua::RecursorLua(const std::string &fname)
: PowerDNSLua(fname)
{
- // empty
+ lua_pushcfunction(d_lua, getRegisteredNameLua);
+ lua_setglobal(d_lua, "getregisteredname");
}
int followCNAMERecords(vector<DNSResourceRecord>& ret, const QType& qtype)