* Andrew Sands <[EMAIL PROTECTED]> writes:

> I've been attempting to use the script within the DNS HOW-TO to update my
> root.hints file on my local net DNS, however it doesn't appear to always
> work and I keep getting a notification within my logs of missing
> ROOT-SERVERS.

I had a similar problem to you, I think that what happens is for some
reason the 'dig' command occasionally gives you an empty root.hints
file. 

This is how I get around it... (I'm on a dialup and I run dig out of
ip-up) 

        - cp a *working* root.hints file to root.hints.orig and
          root.hints.min 

        - edit root.hints.min and take out most of the comments so it
          becomes a much smaller file

        - make dig output to root.hints.new

        - once a day from cron compare the size of root.hints.new to
          root.hints.min and if the new file is smaller cp
          root.hints.orig to root.hints, otherwise cp root.hints.new
          to root.hints.

Here's the script that I use to decide which root.hints.* file gets to
replace root.hints.

,----[ /usr/local/sbin/check-root-servers.sh ]
| #! /bin/bash
| # $Id: check-root-servers.sh,v 1.0 1999-05-03 12:58:52+10 steve Exp $
|
| # Copyright (C) 1999, 2000 Steve Youngs
| 
| # Test the size of the new root.servers file against
| # the original.  If the new file is more that 1k smaller 
| # than the original we copy the original to root.hints.
| # Otherwise we copy the new file to root.hints.
| 
| MIN=/etc/named/root.hints.min
| NEW=/etc/named/root.hints.new
| HINTS=/etc/named/root.hints
| ORIG=/etc/named/root.hints.orig
| 
| sizeof() {
|     ls -l $1 | tr -s " " | cut -d " " -f 5
|    }
| 
| if [ `sizeof $MIN` -gt `sizeof $NEW` ]; then
|     cp $ORIG $HINTS
| else
|     cp $NEW $HINTS
| fi
| 
| if [ -f /var/run/named.pid ]; then
|     ndc restart 
| fi
`----

Hope that helps.


===========================
Want to really learn Linux?
   ... Install Slackware
===========================

-- 
|---<Regards, Steve Youngs>-----------[GnuPG KeyID: EFD82ED2]---|
|                    Genius is the ability to                   |
|              reduce the complicated to the simple             |
|-----------------------------<mailto:[EMAIL PROTECTED]>---|

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to