點擊返回架構師成長之路html
編輯主DNS : /var/named/chroot/etc/carlos.com.zone,在文件末尾添加一條記錄架構
\$ORIGIN . \$TTL 3600 ; 1 hour carlos.com IN SOA op.Carlos.com. dns.carlos.com. ( 2003 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour)#TTL ) NS op.carlos.com. \$ORIGIN carlos.com. shanks A 1.2.3.4 op A 1.2.3.4 a A 192.168.122.100
注意:負載均衡
編輯主DNS : /var/named/chroot/etc/carlos.com.zone,在文件末尾添加一條記錄測試
\$ORIGIN . \$TTL 3600 ; 1 hour carlos.com IN SOA op.Carlos.com. dns.carlos.com. ( 2004 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour)#TTL ) NS op.carlos.com. \$ORIGIN carlos.com. shanks A 1.2.3.4 op A 1.2.3.4 a A 192.168.122.100 cname CNAME a.carlos.com.
注意:spa
編輯主DNS :/var/named/chroot/etc/carlos.com.zone,在文件末尾添加一條記錄htm
\$ORIGIN . \$TTL 3600 ; 1 hour carlos.com IN SOA op.Carlos.com. dns.carlos.com. ( 2005 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour)#TTL ) NS op.carlos.com. \$ORIGIN carlos.com. shanks A 1.2.3.4 op A 1.2.3.4 a A 192.168.122.100 cname CNAME a.carlos.com. MX MX 5 1 92.168.122.101
注意:blog
編輯主DNS :/var/named/chroot/etc/view.conf,加入ptr的zone配置dns
zone "168.192.in-addr.arpa" { type master; file "168.192.zone"; allow-transfer { 10.6.0.254; }; notify yes; also-notify { 10.6.0.254; }; };
編輯主DNS :/var/named/chroot/etc/168.192.zone部署
$TTL 3600 ; 1 hour @ IN SOA op.carlos.com. dns.carlos.com. ( 2006 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour) ) NS op.carlos.com. 102.122 IN PTR a.carlos.com.
修改168.192.zone文件的屬性
chown named.named 168.192.zone rndc reload
編輯從DNS:/var/named/chroot/etc/view.conf,加入ptr的zone配置
zone "168.192.in-addr.arpa" { type slave; masters {10.5.35.14; }; file "slave.168.192.zone"; };
從DNS執行rndc reload命令。
分別對兩臺機器作ptr記錄的解析 host 192.168.122.102 127.0.0.1 結果應爲a.carlos.com 。
編輯主DNS:/var/named/chroot/etc/carlos.com.zone,在文件末尾添加一條記錄
\$ORIGIN . \$TTL 3600 ; 1 hour carlos.com IN SOA op.Carlos.com. dns.carlos.com. ( 2007 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour)#TTL ) NS op.carlos.com. \$ORIGIN carlos.com. shanks A 1.2.3.4 op A 1.2.3.4 a A 192.168.122.100 cname CNAME a.carlos.com. MX MX 5 192.168.122.101 a A 192.168.122.101
注意:
配置主DNS: /var/named/chroot/etc/named.conf,在include上面添加
acl group1 { 10.5.35.14; }; acl group2 { 10.5.35.15; };
配置主DNS: /var/named/chroot/etc/view.conf
view "GROUP1" { match-clients { group1; }; zone "viewcarlos.com" { type master; file "group1.viewcarlos.com.zone"; }; }; view "GROUP2" { match-clients { group2; }; zone "viewcarlos.com" { type master; file "group2.viewcarlos.com.zone"; }; };
配置主DNS: /var/named/chroot/etc/group1.viewcarlos.com.zone
$ORIGIN . $TTL 3600 ; 1 hour viewcarlos.com IN SOA op.viewcarlos.com. dns.viewcarlos.com. ( 2008 ; serial 900 ; refresh (15 minutes) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour) ) NS op.viewcarlos.com. $ORIGIN viewcarlos.com. op A 192.168.122.1 view A 192.168.122.1
修改文件所屬,加載配置。
chown named.named /var/named/chroot/etc/group*.zone rndc reload
分別在主機A與B上作view.viewcarlos.com的域名解析測試,結果應爲主機A上是192.168.122.1,主機B上是192.168.122.2
....