VPN+DNS+Pi-Hole
https://t.me/black_triangle_tgПредыстория таже как и по VPN:
Затем правила для рекурсивного DNS:
sudo iptables -A INPUT -s 10.20.20.0/24 -p tcp -m tcp --dport 53 -m conntrack --ctstate NEW -j ACCEPT sudo iptables -A INPUT -s 10.20.20.0/24 -p udp -m udp --dport 53 -m conntrack --ctstate NEW -j ACCEPT
Не будь идиотом, меняй виртуальные IP на те которые у тя.
Засэйвим эту какашку:
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections sudo apt install iptables-persistent -y sudo systemctl enable netfilter-persistent sudo netfilter-persistent save
Установим Pi-Hole:
curl -sSL https://install.pi-hole.net | bash
Дальше как по видосу
Установим Unbound DNS:
sudo apt install unbound unbound-host -y Своруем DNS записи: curl -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache
Создаем конфиг /etc/unbound/unbound.conf.d/pi-hole.conf
nano /etc/unbound/unbound.conf.d/pi-hole.conf
Там пишем эту какашку:
server:
# if no logfile is specified, syslog is used
# logfile: "/var/log/unbound/unbound.log"
verbosity: 1
port: 5353
do-ip4: yes
do-udp: yes
do-tcp: yes
# may be set to yes if you have IPv6 connectivity
do-ip6: no
# use this only when you downloaded the list of primary root servers
root-hints: "/var/lib/unbound/root.hints"
# respond to DNS requests on all interfaces
interface: 0.0.0.0
max-udp-size: 3072
# IPs authorised to access the DNS Server
access-control: 0.0.0.0/0 refuse
access-control: 127.0.0.1 allow
access-control: 10.20.20.0/24 allow
# hide DNS Server info
hide-identity: yes
hide-version: yes
# limit DNS fraud and use DNSSEC
harden-glue: yes
harden-dnssec-stripped: yes
harden-referral-path: yes
# add an unwanted reply threshold to clean the cache and avoid, when possible, DNS poisoning
unwanted-reply-threshold: 10000000
# have the validator print validation failures to the log val-log-level: 1
# don't use Capitalisation randomisation as it known to cause DNSSEC issues sometimes
# see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
use-caps-for-id: no
# reduce EDNS reassembly buffer size
# suggested by the unbound man page to reduce fragmentation reassembly problems
edns-buffer-size: 1472
# TTL bounds for cache
cache-min-ttl: 3600
cache-max-ttl: 86400
# perform prefetching of close to expired message cache entries
# this only applies to domains that have been frequently queried
prefetch: yes
prefetch-key: yes
# one thread should be sufficient, can be increased on beefy machines
num-threads: 1
# ensure kernel buffer is large enough to not lose messages in traffic spikes
so-rcvbuf: 1m
# ensure privacy of local IP ranges
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: 172.16.0.0/12
private-address: 10.0.0.0/8
private-address: fd00::/8
private-address: fe80::/10
Не будь идиотом, меняй виртуальные IP на те которые у тя.
Перезагрузи тачку
reboot
Проверь все ли ровно по жизни
dig pi-hole.net @127.0.0.1 -p 5353 dig sigfail.verteiltesysteme.net @127.0.0.1 -p 5353 dig sigok.verteiltesysteme.net @127.0.0.1 -p 5353
Выхлопы должны быть как в видосе.
Ну а дальше меняй настройки через вэб морду Pi-hole, как в видосе. И юзай iptables дабы все лишнее жопой в сеть не светило, а ток в VPN тонель.