dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Intermediate
Oct 21, 2002

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Auto Start the DNS Service in Linux


When the DNS service has stopped, use this code to start it automatically.
 
#! /bin/bash

dns_pid=`ps -ax|grep "named -u named" |grep -v grep 
|awk '{print $2}'`

if test "x$dns_pid" = "x" ; then
/etc/init.d/named restart
echo `date` << /home/admin/script/dns.log
echo "DNS Started" << /home/admin/script/dns.log
fi

//On the Above Shell Script save into a file name 
called Ex:- dnsfile//
chmod 755 dnsfile
//add that file path in /etc/crontab file like//
*  * * * * root /dnsfile
Bali Reddy
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date