码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-01-03 08:23:14      阅读:261      评论:0      收藏:0      [点我收藏+]

标签: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

标签:dns实用脚本: 快速配置正向区域的slave

原文地址:http://362475097.blog.51cto.com/1808795/1888389

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!