发信人: albin.bbs@bbs.dlut.edu.cn (阿乐斌), 信区: cnlinux
标  题: DNS HOWTO(维护)
发信站: 碧海青天 (Thu Jul 10 13:52:51 1997)
转信站: Lilac!ustcnews!ustcnews!sjtunews!DUT
出  处: rose.dlut.edu.cn

  5.  维护

  维持它的运作。

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

  取代了原先的 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 >named.cache.new

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

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

--
※ 来源:.碧海青天 bbs.dlut.edu.cn.[FROM: 202.118.66.18]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.940毫秒