Robert Spangler on 10 Nov 2007 15:47:47 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Odd DNS messages


On Fri November 9 2007 18:07, gabriel rosenkoetter wrote:

>  http://www.google.com/search?q=l.root-servers.net+ip+change confirms
>  from a wide variety of reliable sources that the address change is
>  legit. The change took place on 1 November (with ample warning,
>  assuming you bother to read IETF publications).

It has changed and was announced on the Bind Mailing list.

Here is a script I use to keep my root hints file up to date.  I run it weekly

++++++ Code ++++++

cron.weekly $ cat dns-update
#!/bin/sh
#
# Update the nameserver cache information file once per month.
# This is run automatically by a cron entry.
#
# Original by Al Longyear
# Updated for BIND 8 by Nicolai Langfeldt
# Miscelanious error-conditions reported by David A. Ranch
# Ping test suggested by Martin Foster
# named up-test suggested by Erik Bryer.
#
(
 echo "To: sysadmin <root>"
 echo "From: dns-update <root>"

 # Is named up? Check the status of named.
 case `rndc status 2>&1` in
    *refused*)
        echo "named is DOWN. zone.root was NOT updated"
        echo
        exit 0
        ;;
 esac

 PATH=/sbin:/usr/sbin:/bin:/usr/bin:
 export PATH
 # NOTE: /var/named must be writable only by trusted users or this script
 # will cause root compromise/denial of service opportunities.
 cd /var/named/chroot/var/named/slaves/ 2>/dev/null || {
    echo "Subject: Cannot cd to /var/named/chroot/var/named/slaves, error $?"
    echo
    echo "The subject says it all"
    exit 1
 }

 # Are we online?  Ping a server at your ISP
 case `ping -qnc 1 some.machine.net 2>&1` in
   *'100% packet loss'*)
        echo "Subject: zone.root NOT updated.  The network is DOWN."
        echo
        echo "The subject says it all"
        exit 1
        ;;
 esac

 dig @e.root-servers.net . ns >root.db.new 2> errors

 case `cat root.db.new` in
   *NOERROR*)
        # It worked
        :;;
   *)
        echo "Subject: The zone.root file update has FAILED."
        echo
        echo "The zone.root update has failed"
        echo "This is the dig output reported:"
        echo
        cat root.db.new errors
        exit 1
        ;;
 esac

 echo "Subject: The root.db file has been updated"
 echo
 echo "The root.db file has been updated to contain the following
information:"
 echo
 cat root.db.new

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

++++++ /Code ++++++


-- 

Regards
Robert

Smile... it increases your face value!
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug