主页
文章
分类
标签
关于
搭建私人DNS服务器
发布于: 2024-1-24   更新于: 2024-1-24   收录于: liunx
文章字数: 125   阅读时间: 1 分钟   阅读量:

使用dnsmasq搭建私人DNS服务器

安装


yum install dnsmasq -y

配置

修改resolv.dnsmasq.conf配置文件

vim /etc/resolv.dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf
strict-order
addn-hosts=/etc/dns.hosts
cache-size=100
bogus-nxdomain=114.114.114.114
server=/google.com/8.8.8.8
log-queries
log-facility=/var/log/dnsmasq.log

解析增加默认nameserver

vim  /etc/resolv.dnsmasq.conf 
nameserver 192.168.0.168
nameserver 114.114.114.114
nameserver 8.8.8.8

hosts填写自建的dns解析

vim  /etc/dns.hosts
192.168.0.168  kuma.test.top

设置

systemctl start dnsmasq
systemctl enable dnsmasq

测试

systemctl status dnsmasq
ping kuma.test.top

重启

 systemctl restart dnsmasq