Centos 使用dnsmasq部署DNS服务器
一、默认情况下Centos已安装dnsmasq,如未安装,请自行安装。
12 yum install dnsmasq
13 yum install bind-utils
二、配置hosts文件,解析域名。
14 vim /etc/hosts
172.17.100.26 ns1.xnnet.com
三、配置主配置文件。
19 vim /etc/dnsmasq.conf
#配置在最后三行
log-queries
log-facility=/var/log/dnsmasq
resolv-file=/etc/resolv.dnsmasq.conf
四、配置上游服务器
21 vi /etc/resolv.dnsmasq.conf
all-servers#配置上游dns服务器,加上all-server 则自动选择访问最快的dns服务器
nameserver 202.96.128.86
nameserver 202.96.134.33
nameserver 114.114.114.114
nameserver 114.114.115.115
nameserver 114.114.114.119
nameserver 114.114.115.119
nameserver 114.114.114.110
nameserver 114.114.115.110
五、测试命令(yum install bind-utils)
nslookup
dig
原文链接:https://www.f2er.com/centos/377461.html