作者 主題: dns view  (閱讀 4572 次)

0 會員 與 1 訪客 正在閱讀本文。

小徒兒

  • 區域板主
  • 鑽研的研究生
  • *****
  • 文章數: 622
    • 檢視個人資料
dns view
« 於: 2007-01-02 20:27 »
***first unzip all the named zone file then run the chname.sh
localdomain.zone
代碼: [選擇]


$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
       IN NS localhost
localhost IN A 127.0.0.1




localhost.zone

代碼: [選擇]


$TTL 86400
@ IN SOA @       root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

       IN NS @
IN A 127.0.0.1
IN AAAA ::1




chname.sh
代碼: [選擇]

#!/bin/bash

echo "$1" | grep -q '[^1-5]' && {
echo "Usage: $0 number"
exit 1
}

nu=$1

mkdir named
cd named
tar zxvf ../named.fw.tgz
sed -e "s/team5/team$nu/g" -e "s/168.5/168.$nu/g" -e "s/5.168/$nu.168/" etc/named.conf > /etc/named.conf
sed -e "s/pc5/pc$nu/" -e "s/1.5/1.$nu/" var/named/named.ext.team5.test.cxm > /var/named/named.ext.team$nu.test.cxm
sed -e "s/pc5/pc$nu/" -e "s/168.5/168.$nu/" var/named/named.local.team5.test.cxm > /var/named/named.local.team$nu.test.cxm
sed -e "s/team5/team$nu/" -e "s/168.5/168.$nu/" var/named/named.int.team5.test.cxm > /var/named/named.int.team$nu.test.cxm
sed -e "s/team5/team$nu/g" -e "s/168.5/168.$nu/" var/named/named.192.168.5 > /var/named/named.192.168.$nu



gnome-terminal