![dns blackhole dns blackhole](https://cdn.adguard.com/public/Adguard/Android/how-dns-filtering-works_en.png)
![dns blackhole dns blackhole](https://nakedsecurity.sophos.com/wp-content/uploads/sites/2/2012/07/run5.png)
The shell script needs to be run as a user who can write to the /usr/local/etc/namedb/ folder. We need to add some comments to the file which the script will use are markers to insert configuration items. Now before you run the script the nf file needs to be edited.
#DNS BLACKHOLE INSTALL#
Python3.7 is part of the FreeBSD base install so the only additional package we need is wget, then the script is good to run: # pkg install wget Now clone the repo and take a look at the code: # cd ~ # git-2.24.1 Distributed source code management tool So I compromised and wrote some of the code in Python but with the imposed mandate of using any libraries not in the base distribution.įirst off, install git so you can clone my repo: # pkg search git However the host files came in a variety of formats requiring some pretty basic regex which were not possible with just BRE and ERE regex support in the bash shell. I had originally wanted to write a bash script to download the host blacklist and munge them into bind zone files in an effort to present a solution with very few dependencies. We will use the hosts files collected by which themselves come from various sources: # We need to modify these files into bind format so that we can use them as zone files and return the relevant address information. The majority of blocklist are in ‘hosts file’ format, ie they specify an IP address (typically 127.0.0.1) and then FQDN. Bind914-9.14.9 BIND DNS suite with updated DNSSEC and DNS64