Linux下用dnsmasq做dns cache server的配置方法

2019-10-14 12:51:09刘景俊

echo "IP地址 域名" > /etc/dnsmasq.hosts

另外,重启dnsmasq可以用SIGHUP(可以在修改hosts文件后,让配置生效)

 killall -s SIGHUP dnsmasq

查看服务状态:

 netstat -tunl
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:53              0.0.0.0:*

再dig 一下,发现稳定在4ms ,我晕,同样的配置,我在一台ubuntu server 10.04 上面dig 是1ms ,在我本地居然在4ms ,囧