Current Unbound in openwrt has IPSET support. But there is not much documentation on how to use it or even make it work.
Does anybody know how to configure ipsets with unbound?
I would like to switch to unbound from dnsmasq but this got me stomped as I have multiple ipsets i'm using in dnsmasq. This is the only thing right now stopping me from switching.
IPSET is a legacy iptables extension.
OpenWrt no longer uses iptables and has replaced IPSET in the fw4 package with a rather messy emulation that actually uses nftsets in the background.
If unbound requires genuine iptables ipsets, then it is not really (default) supported by OpenWrt any more and needs to be upgraded to use nftsets directly, in the same way dnsmasq does.
You still have the option to build custom image, incl. iptables.
And to get rid of fw4 completely, if you want. Otherwise, iptables and nftables can co-exist, depending upon careful usage, avoiding interference.
My custom build already have iptables and related packages since I'm also using mwan3. I've got the nft2ipset (actually a more streamlined version based on the original script) running also for mwan3. This is actually the reason I need ipset to work with unbound as I have some routing set for certain domains using ipset which is working in dnsmasq.
It seems, you should be able then to do a special compile of UNBOUND for your image, to directly use ipsets.
May need editing of openwrts Makefile for UNBOUND, though. Use Makefile from older openwrt as template, then.
Native ipsets are MUCH faster than nftsets, BTW.
That is for one IPSET only (well 2 because of ipv4/ipv6 pairing).. i've got at least 4 ipsets (2 ipv4/ipv6 pairs). Is there an example/documentaiton for multiple ipsets?
I think dnsmasq still calls it IPSET in the config but actually it's already using NFTSET in the background.
Anyway, staying with dnsmasq outweighs the need of switching to legacy iptables just to make unbound work. Looks like I will stay with dnsmasq until such time unbound can work with nft sets.
Why should a dns resolver handle nftables sets? Why did you use dnsmasq with these kind of sets? Whats so special that the fw4 can't handle this directly?
I know banip has this feature (which I'm using already), but there are certain domains that I want specific mac addresses only (not the whole network) to be blocked. And some of the domains are only accessible for certain time of the day. Although this is just my secondary requirement.
Second (primary requirement), is domain based routing in mwan3 using ipsets. I've got some domains I need (which should include all subdomains) route to a VPN. And another set of domains routing to my secondary wan.