-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 23 May 2002 11:32 pm, Peter Kiem wrote:
> Hi Daniel,
>
> > dig > /var/named/named.ca
>
> I just tried this but it seems to be missing MOST of the root name
> servers!
Attached is a script I run monthly via cron that updates the root.hints
file. Before trying to run it, please be sure to edit it for your
situation. (paths, file names, etc.) It is mainly derived from the
example in the bind howto.
Hope it helps,
- --
- -Michael
pgp key: http://www.tuxfan.homeip.net:8080/gpgkey.txt
Red Hat Linux 7.2 in 8M of RAM: http://www.rule-project.org/
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjztuzEACgkQn/07WoAb/SsXHACfTxDcaTiRSzreywiX3nafDRDK
4zAAoJKWOqKGMgMwWsgf0ui1GlrGnoUx
=YSqP
-----END PGP SIGNATURE-----
#!/bin/sh
#
# Update the nameserver cache information file once per month.
#
(
echo "To: hostmaster <hostmaster>"
echo "From: system <root>"
echo "Subject: Automatic update of the root.hints file"
echo
PATH=/sbin:/usr/sbin:/bin:/usr/bin:
export PATH
cd /var/named
# Are we online? Ping a server at your ISP
case `ping -qnc 2 gis.net` in
*'100% packet loss'*)
echo "The network is DOWN. root.hints NOT updated"
echo
exit 0
;;
esac
dig @e.root-servers.net . ns >root.hints.new 2>&1
case `cat root.hints.new` in
*NOERROR*)
# It worked
:;;
*)
echo "The root.hints file update has FAILED."
echo "This is the dig output reported:"
echo
cat root.hints.new
exit 0
;;
esac
echo "The root.hints file has been updated to contain the following
information:"
echo
cat root.hints.new
chown root.root root.hints.new
chmod 444 root.hints.new
rm -f root.hints.old
mv root.hints root.hints.old
mv root.hints.new root.hints
rndc reload
echo
echo "The nameserver has been restarted to ensure that the update is complete."
echo "The previous root.hints file is now called
/var/named/root.hints.old."
) 2>&1 | /usr/lib/sendmail -t
exit 0