@thedarktangent dnsmasq has --ipset and --nftset options. e.g., nftset=/cdn.network.com/4#inet#filter#allow4 adds every A record answered for that domain (and its subdomains) to an nftables set.
Unbound has an ipset module that does basically the same thing. It has to be compiled in with --enable-ipset, and you tag the zones with local-zone: "network.com" ipset.
There are a couple others but these are two solid DNS projects.