Ver código fonte

upgrade db.root.sh to use dig instead of now deprecated nslookup

Ralf S. Engelschall 23 anos atrás
pai
commit
20774b9d73
3 arquivos alterados com 13 adições e 29 exclusões
  1. 1 1
      bind/bind.spec
  2. 4 8
      bind/db.root
  3. 8 20
      bind/db.root.sh

+ 1 - 1
bind/bind.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [REL]
 Group:        DNS
 License:      ISC
 Version:      9.2.0
-Release:      20020206
+Release:      20020226
 
 #   list of sources
 Source0:      ftp://ftp.isc.org/isc/bind/%{version}/bind-%{version}.tar.gz

+ 4 - 8
bind/db.root

@@ -1,11 +1,7 @@
-;
-;   db.root -- BIND "hint" file
-;   [automatically created on Wed Feb  6 13:52:40 CET 2002 by db.root.sh]
-;
-;   Notice: Although this file officially is only used to initially load
-;   the cache of the BIND nameserver, it is actually used to specify the
-;   root nameservers only.
-;
+;;
+;;  db.root -- Internet Root Nameservers
+;;  DO NOT EDIT, IT WAS AUTOMATICALLY CREATED ON 2002-02-26 BY db.root.sh!
+;;
 
 .                    99999999  IN  NS  A.ROOT-SERVERS.NET.
 .                    99999999  IN  NS  B.ROOT-SERVERS.NET.

+ 8 - 20
bind/db.root.sh

@@ -1,32 +1,20 @@
 #!/bin/sh
 
-SERVER=a.root-servers.net
-TMPFILE=/tmp/tmp.$$
 ROOTFILE=./db.root
 
-date=`date`
+date=`date '+%Y-%m-%d'`
 cat >$ROOTFILE <<EOT
-;
-;   db.root -- BIND "hint" file
-;   [automatically created on $date by db.root.sh]
-;
-;   Notice: Although this file officially is only used to initially load
-;   the cache of the BIND nameserver, it is actually used to specify the
-;   root nameservers only.
-;
+;;
+;;  db.root -- Internet Root Nameservers
+;;  DO NOT EDIT, IT WAS AUTOMATICALLY CREATED ON $date BY db.root.sh!
+;;
 
 EOT
-nslookup >$TMPFILE <<-EOF
-server $SERVER
-set type=NS
-.
-EOF
-cat $TMPFILE |\
+dig @A.ROOT-SERVERS.NET . NS |\
 awk '
-  /nameserver =/ { printf("%-20s 99999999  IN  NS  %s.\n",   ".", $NF); }
-  /address =/    { printf("%-20s 99999999  IN  A   %s\n", $1 ".", $NF); }
+  /IN NS/ { printf("%-20s 99999999  IN  NS  %s\n", $1, $NF); }
+  /IN A/  { printf("%-20s 99999999  IN  A   %s\n", $1, $NF); }
 ' |\
 sort >>$ROOTFILE
-rm $TMPFILE
 echo "" >>$ROOTFILE