* `addACL(netmask)`: add to the ACL set who can use this server
* `setACL({netmask, netmask})`: replace the ACL set with these netmasks. Use `setACL({})` to reset the list, meaning no one can use us
* `showACL()`: show our ACL set
+ * Network related:
+ * `addLocal(netmask, [false])`: add to addresses we listen on. Second optional parameter sets TCP/IP or not.
+ * `setLocal(netmask, [false])`: reset list of addresses we listen on to this address. Second optional parameter sets TCP/IP or not.
* Blocking related:
* `addDomainBlock(domain)`: block queries within this domain
* Carbon/Graphite/Metronome statistics related:
g_ACL.modify([domain](NetmaskGroup& nmg) { nmg.addMask(domain); });
});
+ g_lua.writeFunction("setLocal", [client](const std::string& addr, boost::optional<bool> doTCP) {
+ if(client)
+ return;
+ try {
+ ComboAddress loc(addr, 53);
+ g_locals.clear();
+ g_locals.push_back({loc, doTCP ? *doTCP : true}); /// only works pre-startup, so no sync necessary
+ }
+ catch(std::exception& e) {
+ g_outputBuffer="Error: "+string(e.what())+"\n";
+ }
+ });
+
g_lua.writeFunction("addLocal", [client](const std::string& addr, boost::optional<bool> doTCP) {
if(client)
return;