# vim /etc/named.conf# cat -n /etc/named.conf
1 //
2 // named.conf
3 //
4 // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
5 // server as a caching only nameserver (as a localhost DNS resolver only).
6 //
7 // See /usr/share/doc/bind*/sample/ for example named configuration files.
8 //
9 // See the BIND Administrator's Reference Manual (ARM)for details about the
10 // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
11
12 options {
13 listen-on port 53 { 127.0.0.1;any;}; 添加any;
14 listen-on-v6 port 53 { ::1;};
15 directory "/var/named";
16 dump-file "/var/named/data/cache_dump.db";
17 statistics-file "/var/named/data/named_stats.txt";
18 memstatistics-file "/var/named/data/named_mem_stats.txt";
19 recursing-file "/var/named/data/named.recursing";
20 secroots-file "/var/named/data/named.secroots";
21 allow-query { localhost;any;}; 添加any;
# vim /etc/named.rfc1912.zones# tail -5 /etc/named.rfc1912.zones
zone "msb.com" IN {type master;
file "msb.com.zone";
allow-update { none;};};
SOA msb.com 起始授权记录 最权威的域名
这一部分是邮箱 能用的邮箱: @特殊字符要用.替代 admin.msb.com.
ns 域名服务器的主机记录 当前DNS服务的主机ip地址
harbor 其他的公共服务 如果有就可以配置
# cd /var/named# cp -p named.localhost msb.com.zone# # vim msb.com.zone # cat msb.com.zone$TTL 1D
@ IN SOA msb.com admin.msb.com.(
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ); minimum
@ NS ns.msb.com.
ns A 192.168.10.145
harbor A 192.168.10.146
三、开启服务
# systemctl enable --now named# systemctl status named //查看是否开启