2008-05-07 17:10:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
2009-02-12 14:18:06 +00:00
|
|
|
DIRECTORY=/var/named
|
|
|
|
|
|
|
|
if [ -f /etc/SuSE-release ]; then
|
2011-02-11 17:49:49 +00:00
|
|
|
DIRECTORY=/var/lib/named
|
2009-02-12 14:18:06 +00:00
|
|
|
fi
|
|
|
|
FILE=/etc/named.conf
|
2011-08-15 00:30:40 +00:00
|
|
|
|
|
|
|
if [ -f /etc/lsb-release ]; then
|
|
|
|
FILE=/etc/bind/named.conf
|
|
|
|
fi
|
|
|
|
|
2008-05-07 17:10:30 +00:00
|
|
|
#unalias cp
|
2008-05-21 14:02:38 +00:00
|
|
|
if [ -f $FILE ]; then
|
|
|
|
cp -f $FILE ${FILE}.ORIG
|
|
|
|
fi
|
2011-02-11 17:49:49 +00:00
|
|
|
if [ ! -d $DIRECTORY ]; then
|
|
|
|
mkdir $DIRECTORY
|
2008-09-09 15:30:47 +00:00
|
|
|
fi
|
2008-05-07 17:10:30 +00:00
|
|
|
echo "options {
|
2009-02-12 14:35:23 +00:00
|
|
|
directory \"$DIRECTORY\";
|
2009-02-12 14:18:06 +00:00
|
|
|
dump-file \"$DIRECTORY/data/cache_dump.db\";
|
|
|
|
statistics-file \"$DIRECTORY/data/named_stats.txt\";
|
|
|
|
memstatistics-file \"$DIRECTORY/data/named_mem_stats.txt\";
|
2008-05-07 17:10:30 +00:00
|
|
|
recursion yes;
|
|
|
|
forward only;
|
|
|
|
forwarders {" >$FILE
|
|
|
|
|
|
|
|
for i in $(grep "^nameserver" /etc/resolv.conf | awk '{print $2}')
|
|
|
|
do
|
|
|
|
echo " $i;"
|
|
|
|
done >>$FILE
|
|
|
|
echo " };
|
|
|
|
};" >>$FILE
|
|
|
|
|