首页 > 代码库 > DNS实用脚本: 快速配置正向区域的slave

DNS实用脚本: 快速配置正向区域的slave

#!/bin/bash

read -p "set master eg: 192.168.1.1 ; enter ‘quit‘ for quit:" master

if [ $master == "quit" ];then

echo "bye"

exit 0

fi


read -p "enter zone eg:baidu.com; enter ‘quit‘ for quit:" netAddress


mkSlave() 

{

echo -e "\nzone \""$1"\" IN {

type slave;

masters { $master; };

file \""slaves/$1.zone"\";

allow-update { none; };

};" >> /etc/named.rfc1912.zones


}


while [ $netAddress != "quit" ];do

mkSlave $netAddress

echo "success"

read -p "enter zone eg:baidu.com; enter ‘quit‘ for quit:" netAddress

done

echo "bye"




使用方法:


技术分享


技术分享

DNS实用脚本: 快速配置正向区域的slave