Last active
July 29, 2024 23:10
-
-
Save nrdmn/9bed16155eabe57cfe665173f45a4d2b to your computer and use it in GitHub Desktop.
NetBSD Pi Hole Howto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/localtime: | |
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime | |
/etc/rc.conf: | |
inetd=NO | |
postfix=NO | |
named=YES | |
/etc/resolv.conf: | |
nameserver 2001:4ce8::53 # AS250 Foundation | |
nameserver 194.150.168.168 # AS250 Foundation | |
nameserver 2a02:2970:1002::18 # Digitalcourage e.V. | |
nameserver 46.182.19.48 # Digitalcourage e.V. | |
/etc/dhcpcd.conf: | |
nohook resolv.conf | |
/etc/ntp.conf: | |
server 0.de.pool.ntp.org | |
server 1.de.pool.ntp.org | |
server 2.de.pool.ntp.org | |
server 3.de.pool.ntp.org | |
/etc/named.conf: | |
options { | |
response-policy { | |
zone "block"; | |
}; | |
forwarders { | |
2001:4ce8::53; # AS250 Foundation | |
194.150.168.168; # AS250 Foundation | |
2a02:2970:1002::18; # Digitalcourage e.V. | |
46.182.19.48; # Digitalcourage e.V. | |
}; | |
forward only; | |
}; | |
logging { | |
category default { null; }; | |
}; | |
zone "block" { | |
type master; | |
file "block"; | |
}; | |
/root/build.sh: | |
#!/bin/sh | |
echo '$TTL 3600 | |
@ IN SOA localhost. hostmaster.localhost. ( | |
2019022400 ; Serial | |
3600 ; Refresh | |
300 ; Retry | |
3600000 ; Expire | |
3600 ) ; Minimum | |
IN NS localhost.' > /etc/namedb/block | |
ftp -o- https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt | grep '^address=/.*/\(0\.0\.0\.0\|::\)$' | sed 's/^address=\/\(.*\)\/0\.0\.0\.0$/\1 CNAME ./' | sed 's/^address=\/\(.*\)\/::$/*.\1 CNAME ./' >> /etc/namedb/block | |
ftp -o- https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt | grep '^\(0\.0\.0\.0\|::\) ' | sed 's/^0\.0\.0\.0 \(.*\)$/\1 CNAME ./' | sed 's/^:: \(.*\)$/*.\1 CNAME ./' >> /etc/namedb/block | |
/etc/rc.d/named restart | |
/var/cron/tabs/root: | |
4 0 1 * * /bin/sh /root/build.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment