标签:centos7+bind9.12 linux dns linux bind bind9.12 centos7 bind9
参考文献1:http://blog.51cto.com/sw5720/1611777 # chkconfig: 345 35 75
# description: a name server
if [ `id -u` -ne 0 ]
then
echo -e "\e[31mERROR:For bind to port 53,must run as root.\e[0m"
exit 1
fi
case "$1" in
start)
if [ -x /usr/local/named/sbin/named ]; then
/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf -u named && echo . && echo -e ‘BIND9 server \e[32mstarted\e[0m‘
fi
;;
stop)
kill `cat /usr/local/named/var/named.pid` && echo . && echo -e ‘BIND9 server \e[33mstopped\e[0m‘
;;
restart)
echo .
echo "Restart BIND9 server"
$0 stop
sleep 1
echo -n "." && sleep 2 && echo -n "." && sleep 2 && echo -n "." && sleep 2
$0 start
;;
reload)
/usr/local/named/sbin/rndc reload
;;
status)
/usr/local/named/sbin/rndc status
;;
*)
echo "$0 start | stop | restart |reload |status"
;;
esac
标签:centos7+bind9.12 linux dns linux bind bind9.12 centos7 bind9
原文地址:http://blog.51cto.com/markzwl/2093479