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
|
|
|
|
DIRECTORY=/var/lib
|
|
|
|
fi
|
|
|
|
FILE=/etc/named.conf
|
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
|
2008-09-09 15:30:47 +00:00
|
|
|
if [ ! -d /var/named ]; then
|
|
|
|
mkdir "/var/named"
|
|
|
|
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
|
|
|
|
|