您好,登錄后才能下訂單哦!
#!/bin/bash
#DNS正向解析腳本文件
#auto by cheng at 2019.10.9
#安裝服務包
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
#修改區域配置文件
cat >>/etc/named.rfc1912.zones <<-EOF
zone "kgc.com." IN {
type master;
file "kgc.com.zone";
allow-update { none; };
};
EOF
#復制區域數據配置文件模板
cp -p /var/named/named.localhost /var/named/kgc.com.zone
#修改區域數據配置文件
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/127.0.0.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
#開啟服務
systemctl start named
#關閉防火墻
systemctl stop firewalld.service
setenforce 0
#修改dns解析地址配置文件
echo "nameserver 192.168.102.131" > /etc/resolv.conf
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。