- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
一,安装dnsmasq,在绝大部分发行版中都有提供
# Centos,Fedora
yum install dnsmasq -y
# Debian,Ubuntu
apt-get install dnsmasq -y
二,修改dnsmasq配置文件
打开主配置文件,在头部加入几行
vi /etc/dnsmasq.conf
# 使用的hosts文件路径(可选)
addn-hosts=/etc/dnsmasq.hosts
# 记录缓存时间,单位为秒
local-ttl=3600
# 最大记录条数
dns-forward-max=1000000
# 当提供对外解析时,需要加入监听地址
listen-address=127.0.0.1,10.100.231.55
# 上游DNS服务器地址的配置文件
resolv-file=/etc/dnsmasq.nameserver.conf
# 可查询列表内的所有上游DNS服务器
all-servers
# 自定义DNS记录的配置目录
conf-dir=/etc/dnsmasq.d
再添加上游DNS服务器地址,
vi /etc/dnsmasq.nameserver.conf
# 阿里公共DNS
nameserver 223.5.5.5
nameserver 223.6.6.6
# 百度公共DNS
nameserver 180.76.76.76
# 114DNS,不建议使用,在多地已被污染
nameserver 114.114.114.114
nameserver 114.114.115.115
根据情自身情况,可以填写hosts文件,
vi /etc/dnsmasq.hosts
# 格式例子
1.1.1.1 landui.com
三,打开防火墙端口
# 使用firewall开放端口,并应用设置
systemctl enable firewalld
firewall-cmd --zone=public --add-port=53/udp --permanent
systemctl restart firewalld
# 或者使用ufw开放端口
apt-get install ufw
ufw allow dns
ufw enable
四,查看DNS服务是否正常运行
售前咨询
售后咨询
备案咨询
二维码
TOP