使用knot搭建DNS域名服务
服务安装
我的环境是 ubuntu
,通过 apt
直接安装
1
| $ apt install knot knot-dnsutils
|
启动 knot 服务
配置服务
默认配置文件是 /etc/knot/knot.conf
1 2 3 4 5 6 7 8 9 10 11 12 13
| server: listen: 0.0.0.0@53 listen: ::@53 log: - target: syslog any: info template: - id: default storage: "/var/lib/knot" file: "%s.zone" zone: - domain: linux.com file: "linux.com.zone"
|
几个配置项的解释说明:
/var/lib/knot
存储域名 zone 文件
linux.com
解析域名
linux.com.zone
域名 zone 文件
下边是域名 zone
文件的示例配置
1 2 3 4 5 6 7
| ;; Zone dump (Knot DNS 2.7.8) linux.com. 3600 SOA ns1.linux.com. admin.linux.com. 2021020415 60 60 1800 60 linux.com. 3600 NS ns1.linux.com. linux.com. 3600 NS ns2.linux.com. 41.linux.com. 600 A 172.16.61.62 42.linux.com. 600 A 172.16.61.162 v6.linux.com. 600 AAAA 9000::6172
|
执行 reload
命令重新加载配置
上一篇 « 使用火焰图来分析性能问题
下一篇 » Linux系统性能分析利器lsof