[Pdns-users] zoneToCache - File Format

Otto Moerbeek otto at drijf.net
Wed Jan 19 06:14:14 UTC 2022


On Tue, Jan 18, 2022 at 09:13:54PM +0000, Clint Anderson via Pdns-users wrote:

> Hi All,
> 
> BackGround:
> PowerDNS Recursor v4.6.0
> I have the example from the docs (https://doc.powerdns.com/recursor/lua-config/ztc.html) working perfectly:
> zoneToCache(".", "url", "https://www.internic.net/domain/root.zone", { refreshPeriod = 0 })
> 
> 
> Problem:
> I'd like to load a "BlackList" file (or multiple BlackList files) the same way, but I have no idea what file format the PDNS zoneToCache function is looking for.  In a perfect world, I'd like to be able to take a list of domains like this:
> 
> Domain1.com
> Domain2.com
> Domain3.com
> *.Domain3.com
> Domain4.com
> Sub.Domain4.com
> Sub2.Domain4.com
> 
> And load them via the zoneToCache feature, and have them all point to a specific, common IP Address, like 192.168.1.100, but I can't seem to figure out how to accomplish this.
> 
> Any thoughts, examples, or suggestions would be greatly appreciated.  Thank you very much for your time & help.

The format is the zone file format see e.g. https://en.wikipedia.org/wiki/Zone_file

But the zone to cache is not for overriding. It is meant to be used
for keeping the cache hot. The recursor will replace records 
your are trying to override with data retrieved from the net in some
cases.

To override names there are two mechanisms available: Lua interception
[1] and RPZ [2].

[1] https://docs.powerdns.com/recursor/lua-scripting/hooks.html
[2] https://docs.powerdns.com/recursor/lua-config/rpz.html#response-policy-zones-rpz

	-Otto


More information about the Pdns-users mailing list