您好,登錄后才能下訂單哦!
#!/bin/bash
#DNS解析主服務(wù)器腳本文件
#auto by cheng at 2019.10.9
#安裝服務(wù)包
yum install bind -y
修改主配置文件
sed -i '/listen-on/s/127.0.0.1/192.168.102.131/' /etc/named.conf
sed -i '/allow-query/s/localhost/any/' /etc/named.conf
#修改區(qū)域配置文件
cat >>/etc/named.rfc1912.zones <<-EOF
zone "kgc.com." IN {
type master;
file "kgc.com.zone";
allow-transfer { 192.168.102.159; };
};
EOF
#復(fù)制區(qū)域數(shù)據(jù)配置文件模板
cp -p /var/named/named.localhost /var/named/kgc.com.zone
#修改區(qū)域數(shù)據(jù)配置文件
sed -i '2s/@/kgc.com/2' /var/named/kgc.com.zone
sed -i '2s/rname.invalid./admin.kgc.com/' /var/named/kgc.com.zone
sed -i '8s/@/kgc.com/' /var/named/kgc.com.zone
sed -i '9s/::1/192.168.102.131/' /var/named/kgc.com.zone
sed -i '10d' /var/named/kgc.com.zone
cat >>/var/named/kgc.com.zone <<-EOF
IN MX 10 mail.kgc.com
www IN A 192.168.100.99
ftp IN A 192.168.100.88
stmp IN CNAME www
* IN A 8.8.8.8
EOF
#開啟服務(wù)
systemctl start named
#關(guān)閉防火墻
systemctl stop firewalld.service
setenforce 0
#修改dns解析地址配置文件
echo "nameserver 192.168.102.131" > /etc/resolv.conf
#!/bin/bash
#DNS解析從服務(wù)器腳本文件
#auto by cheng at 2019.10.9
#安裝服務(wù)包
yum install bind -y
#修改主配置文件
sed -i '/listen-on/s/127.0.0.1/192.168.102.159/' /etc/named.conf
sed -i '/allow-query/s/localhost/any/' /etc/named.conf
#修改區(qū)域配置文件
cat >>/etc/named.rfc1912.zones <<-EOF
zone "kgc.com." IN {
type slave;
file "slaves/kgc.com.zone";
masters { 192.168.102.131; };
};
EOF
#開啟服務(wù)
systemctl start named
#關(guān)閉防火墻
systemctl stop firewalld.service
setenforce 0
#修改dns解析地址配置文件
echo "nameserver 192.168.102.159" > /etc/resolv.conf
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。