centos+dnsmasq打造DNS緩存服務(wù)器加速上網(wǎng)
安裝centos部分
查看是否有ip
ip addr show?
修改inet的配置
vi /etc/sysconfig/network-scripts/ifcfg-ens192
查看ient的配置發(fā)現(xiàn)網(wǎng)卡沒有打開,按下鍵盤 i 鍵后修改,將no改為yes。修改完成按下 esc 鍵,然后輸入 :wq? 保存退出。??
輸入指令? service network restart? ?重新啟動網(wǎng)絡(luò)服務(wù)
安裝
yum -y install dnsmasq
配置
vi /etc/dnsmasq.conf
添加
resolv-file=/etc/resolv.dnsmasq.conf
listen-address=192.168.1.4,127.0.0.1
strict-order
cache-size=10240
編輯resolv.dnsmasq.conf
vi /etc/resolv.dnsmasq.conf
寫入?
nameserver 114.114.114.114
nameserver 8.8.8.8
關(guān)閉防火墻
systemctl stop firewalld.service
systemctl disable firewalld.service
重啟
systemctl restart dnsmasq
設(shè)置為開機(jī)自啟動
systemctl enable dnsmasq
啟動 dnsmasq 服務(wù)
systemctl start dnsmasq
重啟
reboot
安裝dig
yum install bind-utils
測試
dig 網(wǎng)址
標(biāo)簽: