This repository was archived by the owner on Aug 8, 2023. It is now read-only.
-
- Notifications
You must be signed in to change notification settings - Fork 144
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Add support for unbound.conf format? #308
Copy link
Copy link
Closed
Description
Any chance of revealing how the lists are actually built? I see what they're aggregated from in the sources file, but there's clearly some magic still happening inbetween the original sources and the actual configs here.
I was able however to whip up an awk script to convert domains.txt and hostnames.txt into a format consumable by unbound:
#!/usr/bin/awk # To convert dnsmasq domains and hostnames files to unbound confs # Adjust SINKHOLE4 and SINKHOLE6 as needed BEGIN { FS=" " SINKHOLE4 = "0.0.0.0" SINKHOLE6 = "::" TTL = 86400 print "server:" } { if ($1 == "0.0.0.0") { print "\tlocal-zone: \""$2".\" redirect" print "\tlocal-data: '"$2". "TTL" IN TXT \"Redirected per https://github.com/notracking/hosts-blocklist\"'" print "\tlocal-data: \""$2". "TTL" IN A "SINKHOLE4"\"" } else if ($1 == "::") { print "\tlocal-data: \""$2". "TTL" IN AAAA "SINKHOLE6"\"" } else if ($0 ~ /^address=\/.*\/0\.0\.0\.0$/) { split($0, domain, "/") print "\tlocal-zone: \""domain[2]".\" redirect" print "\tlocal-data: '"domain[2]". "TTL" IN TXT \"Redirected per https://github.com/notracking/hosts-blocklist\"'" print "\tlocal-data: \""domain[2]". "TTL" IN A "SINKHOLE4"\"" } else if ($0 ~ /^address=\/.*\/::$/) { split($0, domain, "/") print "\tlocal-data: \""domain[2]". "TTL" IN AAAA "SINKHOLE6"\"" } else { print $0 } } Metadata
Metadata
Assignees
Labels
No labels