2008-05-07 17:10:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
FILE=/etc/named.conf
|
|
|
|
|
|
|
|
#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 {
|
|
|
|
directory \"/var/named\";
|
|
|
|
dump-file \"/var/named/data/cache_dump.db\";
|
|
|
|
statistics-file \"/var/named/data/named_stats.txt\";
|
|
|
|
memstatistics-file \"/var/named/data/named_mem_stats.txt\";
|
|
|
|
recursion yes;
|
|
|
|
forward only;
|
|
|
|
forwarders {" >$FILE
|
|
|
|
|
|
|
|
for i in $(grep "^nameserver" /etc/resolv.conf | awk '{print $2}')
|
|
|
|
do
|
|
|
|
echo " $i;"
|
|
|
|
done >>$FILE
|
|
|
|
echo " };
|
|
|
|
};" >>$FILE
|
|
|
|
|