荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: georgehill (NCNS), 信区: Linux
标  题: DNS HOWTO 中译版-6(转寄)
发信站: BBS 荔园晨风站 (Tue Feb 20 12:44:09 2001), 站内信件

【 以下文字转载自 georgehill 的信箱 】
【 原文由 georgehill.bbs@smth.org 所发表 】
发信人: czlong (紫龙), 信区: Linux
标  题: DNS HOWTO 中译版-6(转寄)
发信站: BBS 水木清华站 (Sun Feb  4 15:47:58 2001)


6. 维护工作
维持它的运作.

维持它们的继续执行之外,对於 named 你还有个维护的任务得要做.那就是维持
 root.cache 档案的更新.最简单的方法是使用 dig 程式,首先不加任何参数执
行 dig 程式,你将会取得从你自己伺服器得到的 root.cache.然後以 dig
@rootserver . ns 查问所列出的根伺服器其中之一.你将会注意到这份输出看起
来非常地像一个 root.cache 档案,除了一堆额外的数字以外.这些数字不会有什
麽妨碍.把它存放到档案里(dig @e.root-servers.net . ns >root.cache.new)并
且用它来取代原本旧的 root.cache 档案.

取代了原先的档案之後要记得重新启动 named 程式.

Al Longyear 寄给我这个指令稿,它可以自动执行来更新 named.cache,为它安装
个 crontab 项目然後忘了它.这个指令稿假设你的电子邮件可以运作而且
`hostmaster' 这个邮件别名有定义.你应该修订它以便符合你的设定.



------------------------------------------------------------------------
--------

#!/bin/sh
#
# Update the nameserver cache information file once per month.
# This is run automatically by a cron entry.
#
(
 echo "To: hostmaster <hostmaster>"
 echo "From: system <root>"
 echo "Subject: Automatic update of the named.boot file"
 echo

 export PATH=/sbin:/usr/sbin:/bin:/usr/bin:
 cd /var/named

 dig @rs.internic.net . ns >root.cache.new

 echo "The named.boot file has been updated to contain the following
information:"
 echo
 cat root.cache.new

 chown root.root root.cache.new
 chmod 444 root.cache.new
 rm -f root.cache.old
 mv root.cache root.cache.old
 mv root.cache.new root.cache
 ndc restart
 echo
 echo "The nameserver has been restarted to ensure that the update is
complete."
 echo "The previous root.cache file is now called /var/named/root.
cache.old."
) 2>&1 | /usr/lib/sendmail -t
exit 0


------------------------------------------------------------------------
--------

有些人可能用 ftp 从 Internic 得到 root.cache 档案.请不要用 ftp 来更新
root.cache,上面提到的方法更为便利.


--

※ 来源:·BBS 水木清华站 smth.org·[FROM: 210.34.33.55]
--
※ 转载:·BBS 荔园晨风站 bbs.szu.edu.cn·[FROM: 192.168.1.113]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店