Pdnsd is a good DNS parsing software in linux system. Compared with bind and dnsmasq, pdnsd has one advantage: it can still remember the cached entries after restarting.
1、install
pacman -S pdnsd
2、Pdnsd global setting
cp /etc/pdnsd.conf.sample /etc/pdnsd.conf global { perm_cache=10240; cache_dir="/var/cache/pdnsd"; # pid_file = /var/run/pdnsd.pid; run_as="pdnsd"; server_ip = 192.168.101.133; # machines on your network to query pdnsd. status_ctl = on; # paranoid=on; # This option reduces the chance of cache poisoning # but may make pdnsd less efficient, unfortunately. query_method=udp_tcp; min_ttl=15m; # Retain cached entries at least 15 minutes. max_ttl=1w; # One week. timeout=10; # Global timeout option (10 seconds). neg_domain_pol=on; udpbufsize=1024; # Upper limit on the size of UDP messages. }
The default DNS server for pdnsd is OpenDNS (208.67.222.222/208.67.220.220), and it is said that sometimes there will be slow response problems when accessing Google with OpenDNS, so it is recommended that the DNS server for Google be replaced directly: 8.8.8 and 8.8.4.4.
3、Test
systemctl start pdnsd
nslookup www.google.com 127.0.0.1
If returned success, the PDNS configuration is successful. Now you can set pdnsd as boot start item:
systemctl enable pdnsd