k8s(二)-bind的安装
作者:互联网
1.基础包的安装(zyjc7-11上)
yum install -y wget net-tools telnet tree nmap sysstat lrzsz dos2unix bind-utils
2、安装bind
yum -y install bind
3、修改配置
vim /etc/named.conf
listen-on port 53 { 10.4.7.11; }; #修改为本机地址 allow-query { any; }; #主机都可以访问 forwarders { 223.5.5.5; }; # 办公网上一级的DNS,(生产写运营商dns) recursion yes; # dns采用递归的查询 dnssec-enable no; # 关闭,节省资源(生产可能不需要关闭) dnssec-validation no; # 关闭,节省资源,不做互联网认证
vim /etc/named.rfc1912.zones 在文件最后插入
zone "host.com" IN { type master; file "host.com.zone"; allow-update { 10.4.7.11; }; }; zone "od.com" IN { type master; file "od.com.zone"; allow-update { 10.4.7.11; }; };
vim /var/named/host.od.com
$ORIGIN host.com. $TTL 600 ; 10 minutes @ IN SOA dns.host.com. dnsadmin.host.com. ( 2022032501 ; serial 10800 ; refresh (3 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS dns.host.com. $TTL 60 ; 1 minute dns A 10.4.7.11 zyjc7-11 A 10.4.7.11 zyjc7-12 A 10.4.7.12 zyjc7-21 A 10.4.7.21 zyjc7-22 A 10.4.7.22 zyjc7-200 A 10.4.7.200
# 过期时间2019.12.09+01序号
# 区域授权文件的开始,OSA记录,dnsadmin.host.com为邮箱
2022032501 # 安装的当天时间
vim /var/named/od.com.zone
$ORIGIN od.com. $TTL 600 ; 10 minutes @ IN SOA dns.od.com. dnsadmin.od.com. ( 2022032501 ; serial 10800 ; refresh (3 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS dns.od.com. $TTL 60 ; 1 minute dns A 10.4.7.11
4、检查配置是否修改正确
named-checkconf named-checkzone "host.com" /var/named/host.com.zone named-checkzone "od.com" /var/named/od.com.zone chown root:named /var/named/host.com.zone chown root:named /var/named/od.com.zone chmod 640 /var/named/host.com.zone chmod 640 /var/named/od.com.zone
5、启动服务,开机启动,并检测
systemctl enable --now named
dig -t A zyjc7-12.host.com @10.4.7.11 +short
标签:named,10.4,zone,bind,od,host,com,k8s,安装 来源: https://www.cnblogs.com/knowledge-ks/p/16055777.html