145 字
1 分钟
Setting Up a DNS Server on RPi
- Install
- Configure dnscrypt-proxy
- Change the router’s default DNS to the RPi
- Auto-restart on configuration failure
Install
sudo apt-get install dnscrypt-proxysudo apt-get install dnsutils #Contains commands like dig; better to install itConfigure dnscrypt-proxy
sudo nano /etc/dnscrypt-proxy/dnscrypt-proxy.tomllisten_addresses = ['127.0.0.1:53', '192.168.0.150:53'] #Change according to your own IPserver_names = ['cloudflare','cloudflare-ipv6']dnscrypt-proxy -resolve cloudflare-dns.comTry whether it works; if it does, proceed to install the service.
Very important, otherwise binding the port will fail when starting the service
sudo nano /lib/systemd/system/dnscrypt-proxy.service #Modify the dnscrypt-proxy service settings#User=_dnscrypt-proxy #Comment out this line from the source fileUser=root #Add this new line to run it as root (doesn't seem very safe... haha, whatever)Start the service and try it!
sudo systemctl enable dnscrypt-proxysudo systemctl start dnscrypt-proxysudo systemctl status dnscrypt-proxyChange the router’s default DNS to the RPi
Skip skip skip!!!
Google it yourself; only one thing to note: the place to change is the DHCP one, NOT the WAN port DNS!!!
References
Setting Up a DNS Server on RPi
https://tski.uk/blog/en/rpi-make-dns/