From 81f11a70588c6929d1aefd529b940efb70747fc2 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 22:11:48 +0000
Subject: [PATCH 001/226] 322. [bug] Queries for KEY RRs are now
sent to the parent server rather than the
authoritative one, making DNSSEC insecurity proofs
work in many cases where they previously didn't.
---
CHANGES | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CHANGES b/CHANGES
index 285cd654c1..a76bad2c67 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+o
+ 322. [bug] Queries for KEY RRs are now sent to the parent
+ server rather than the authoritative one, making
+ DNSSEC insecurity proofs work in many cases
+ where they previously didn't.
+
321. [bug] When synthesizing a CNAME RR for a DNAME
response, query_addcname() failed to intitialize
the type and class of the CNAME dns_rdata_t,
From a7bec08f7cc37d7fceb689caa7a77cf52e45c2b2 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 22:13:17 +0000
Subject: [PATCH 002/226] the 'controls' statement is now implemented
---
doc/misc/options | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/misc/options b/doc/misc/options
index cffa338a29..68405a3035 100644
--- a/doc/misc/options
+++ b/doc/misc/options
@@ -1,7 +1,7 @@
Copyright (C) 2000 Internet Software Consortium.
See COPYRIGHT in the source root or http://www.isc.org/copyright for terms.
-$Id: options,v 1.29 2000/06/22 21:54:12 tale Exp $
+$Id: options,v 1.30 2000/07/10 22:13:17 gson Exp $
This is a summary of the implementation status of the various named.conf
options in BIND 9.
@@ -111,7 +111,7 @@ key Yes
logging Yes
-controls No
+controls Yes
server ip_addr {
[ bogus yes_or_no; ] No
From ce8d0fffea20fe03fd0f075263f529ad55f82aac Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 22:15:42 +0000
Subject: [PATCH 003/226] clarified 322
---
CHANGES | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGES b/CHANGES
index a76bad2c67..17f4f3a1f5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,6 @@
-o
+
322. [bug] Queries for KEY RRs are now sent to the parent
- server rather than the authoritative one, making
+ server before the authoritative one, making
DNSSEC insecurity proofs work in many cases
where they previously didn't.
From a4db2a47f544382539c6984a63bdc8d168c49e8f Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 22:20:43 +0000
Subject: [PATCH 004/226] incremented library version numbers to 1.0.0
---
lib/dns/api | 2 +-
lib/isc/api | 2 +-
lib/lwres/api | 2 +-
lib/omapi/api | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/dns/api b/lib/dns/api
index 494278e7f5..91fedd3885 100644
--- a/lib/dns/api
+++ b/lib/dns/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 0
+LIBINTERFACE = 1
LIBREVISION = 0
LIBAGE = 0
diff --git a/lib/isc/api b/lib/isc/api
index 494278e7f5..91fedd3885 100644
--- a/lib/isc/api
+++ b/lib/isc/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 0
+LIBINTERFACE = 1
LIBREVISION = 0
LIBAGE = 0
diff --git a/lib/lwres/api b/lib/lwres/api
index 494278e7f5..91fedd3885 100644
--- a/lib/lwres/api
+++ b/lib/lwres/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 0
+LIBINTERFACE = 1
LIBREVISION = 0
LIBAGE = 0
diff --git a/lib/omapi/api b/lib/omapi/api
index 494278e7f5..91fedd3885 100644
--- a/lib/omapi/api
+++ b/lib/omapi/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 0
+LIBINTERFACE = 1
LIBREVISION = 0
LIBAGE = 0
From 796b1656b62ac362a5a4515dc9fe1607ed1d714c Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Mon, 10 Jul 2000 22:49:46 +0000
Subject: [PATCH 005/226] pulldown: If the testsock.pl test fails, try 5 times
(2 seconds between tries) in case a server took some time to fully free the
port. (Appears to be an occasional problem on Solaris)
---
bin/tests/system/start.sh | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/bin/tests/system/start.sh b/bin/tests/system/start.sh
index 62bddaf906..7ab3524525 100644
--- a/bin/tests/system/start.sh
+++ b/bin/tests/system/start.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: start.sh,v 1.24 2000/07/07 18:25:08 bwelling Exp $
+# $Id: start.sh,v 1.25 2000/07/10 22:49:46 mws Exp $
#
# Start name servers for running system tests.
@@ -28,16 +28,26 @@ test $# -gt 0 || { echo "usage: $0 test-directory" >&2; exit 1; }
test -d "$1" || { echo No test directory: "$1"; exit 1; }
-if $PERL ./testsock.pl -p 5300
-then
- :
-else
- echo "$0: could not bind to server addresses, server still running?"
- echo "I:server sockets not available"
- echo "R:FAIL"
- sh ./stop.sh $1
- exit 1
-fi
+portup=0
+testloop=0
+while [ $portup == 0 ]
+do
+ if $PERL ./testsock.pl -p 5300
+ then
+ portup=1
+ else
+ echo "I:Couldn't bind to socket (yet)"
+ sleep 2
+ testloop=`expr $testloop + 1`
+ if [ $testloop == 5 ]; then
+ echo "$0: could not bind to server addresses, still running?"
+ echo "I:server sockets not available"
+ echo "R:FAIL"
+ sh ./stop.sh $1
+ exit 1
+ fi
+ fi
+done
cd $1
From acc859e12c147037b4fb9d6da83c9c27d26feaea Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Mon, 10 Jul 2000 23:04:42 +0000
Subject: [PATCH 006/226] updated to describe current options
---
bin/rndc/rndc.8 | 152 +++++++++++++++++++++++++++------------------
doc/man/bin/rndc.8 | 152 +++++++++++++++++++++++++++------------------
2 files changed, 182 insertions(+), 122 deletions(-)
diff --git a/bin/rndc/rndc.8 b/bin/rndc/rndc.8
index b101e4a671..82778ad5d5 100644
--- a/bin/rndc/rndc.8
+++ b/bin/rndc/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.2 2000/07/04 01:25:01 tale Exp $
+.\" $Id: rndc.8,v 1.3 2000/07/10 23:04:42 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -24,13 +24,13 @@
.Nd name server control utility
.Sh SYNOPSIS
.Nm rndc
-.\" -c option has been zapped for now
-.\" .Op Fl c Ar config-file
+.Op Fl c Ar config-file
+.Op Fl k Ar key_id
+.Op Fl M
.Op Fl m
.Op Fl p Ar port#
-.\" -s option has been zapped for now
-.\" .Op Fl s Ar server
-.Ar server
+.Op Fl s Ar server
+.Op Fl v
.Ar command ....
.Sh DESCRIPTION
This command allows the system administrator to control the operation
@@ -38,51 +38,46 @@ of a name server.
It supersedes the
.Xr ndc 8
utility that was provided in old BIND releases.
+If
.Nm rndc
-uses a secure channel with encryption algorithms and keys to
-communicate with the name server.
-In the current version of
-.Nm ndc ,
-the only supported encryption algorithm is HMAC-MD5 which uses a
-shared secret.
-This provides TSIG-style authentication for the command request
-and the name server's response.
+is invoked with no command line options or arguments, it
+prints a short summary of the supported commands and the available
+options and their arguments.
.Pp
-.Nm
+.Nm rndc
+uses a secure channel with digital signatures to communicate
+with the name server.
+In the current versions of
+.Nm rndc
+and
+.Xr named 8
+the only supported encryption algorithm is HMAC-MD5, which uses a
+shared secret on each end of the connection.
+This provides TSIG-style authentication for the command request
+and the name server's response. All commands sent over the channel
+must be signed by a key_id known to the server.
+.Pp
+.Nm rndc
reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-.\" An alternate configuration file can be specified with the
-.\" .Ar c
-.\" option.
-.\" .Ar config-file
-.\" is the name of the configuration file to use instead of the default
-.\" one,
-.\" .Pa /etc/rndc.conf .
-.\" .Pp
+An alternate configuration file can be specified with the
+.Ar c
+option.
+.Pp
.Ar server
-is the name of the server which matches a
+is the name or address of the server which matches a
.Dv server{}
statement in the configuration file for
.Nm rndc .
-If an explicit null argument is supplied in
-.Ar server ,
-.Nm rndc
-will contact some default name server which is defined by a
+If no
+.Ar server
+is supplied on the command line, the host named by the
.Dv default-server
clause in the
-.Fv options{}
-statement of
-.Pa /etc/rndc.conf .
-.Pp
-Currently, the
-.Fl m
-option makes
-.Nm rndc
-print details of its internal memory usage statistics.
-This option will only be of interest to BIND9 developers and may be
-removed or changed in a future release.
+.Dv options{}
+statement of the configuration file will be used.
.Pp
The
.Fl p
@@ -90,19 +85,52 @@ option is used to make
.Nm rndc
send commands to TCP port number
.Ar port#
-on the system running the name server instead of the default.
-The standard port number used by BIND9 name servers for receiving
-control commands is 953.
+on the system running the name server instead of BIND 9's
+default control channel port of 953.
.Pp
-If
+The
+.Fl k
+option identifies the
+.Ar key_id
+to use from the configuration file. The
+.Ar key_id
+must be known by
+.Xr named
+with the same algorithm and secret string in order for
+control message validation to succeed. If no
+.Fl k
+option is provided,
.Nm rndc
-is invoked with no command-line options or arguments, it
-prints a short summary of the supported commands and the available
-options and their arguments.
+will first look for a
+.Dv key
+clause in the
+.Dv server{}
+statement of the server being used, or if no
+.Dv server{}
+statement is present for that host, then the
+.Dv default-key
+clause of the
+.Dv options{}
+statement. Note that .Pp
+The configuration file for
+.Nm rdnc
+contains shared secrets which are used to send authenticated
+control commands to name servers, and should therefore not have
+general read or write access.
+.Pp
+The
+.Fl M ,
+.Fl m ,
+and
+.Fl v
+options provided debugging information and are primarily of interest
+only to the BIND 9 developers. They might be changed or removed in
+future releases.
.Pp
The only valid value for
.Ar command
-is \*qreload\*q, which forces the name server to reload.
+is \*qreload\*q, which forces the name server to reload its configuation
+file and zones.
Further commands will be provided in future releases as the management
capabilities of
.Nm rndc
@@ -118,21 +146,23 @@ offers at least as many management capabilities as the old
.Xr ndc
utility.
.Pp
-The configuration file for
-.Nm rdnc
-probably contains shared secrets which are used to send authenticated
-control commands to name servers.
-The file should therefore not have general read or write access.
+There is currently no way to provide the shared secret for a key_id
+without using the configuration file, and thus the
+.Fl c
+option is really required in order for
+.Nm rndc
+to issue validly signed commands to
+.Xr named .
.Pp
-In the current BIND9 release, the name server only listens for
-.Nm rndc
-commands on the loopback interface, 127.0.0.1.
-This means that
-.Nm rndc
-only works on the same system that runs the name server.
-This limitation will be removed in a future release.
+Several error messages could be clearer. For example, trying to connect
+from an address that is not in the list of acceptable addresses
+configured into
+.Xr named
+will result in the error message "end of file" when the server just
+unceremonisously closes the connection.
.Sh SEE ALSO
-.Xr named 8 ,
-.Xr RFC2845 ,
.Xr rndc.conf 5 ,
+.Xr named 8 ,
+.Xr named.conf 5 ,
+.Xr RFC2845 ,
.Xr ndc 8 .
diff --git a/doc/man/bin/rndc.8 b/doc/man/bin/rndc.8
index b101e4a671..82778ad5d5 100644
--- a/doc/man/bin/rndc.8
+++ b/doc/man/bin/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.2 2000/07/04 01:25:01 tale Exp $
+.\" $Id: rndc.8,v 1.3 2000/07/10 23:04:42 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -24,13 +24,13 @@
.Nd name server control utility
.Sh SYNOPSIS
.Nm rndc
-.\" -c option has been zapped for now
-.\" .Op Fl c Ar config-file
+.Op Fl c Ar config-file
+.Op Fl k Ar key_id
+.Op Fl M
.Op Fl m
.Op Fl p Ar port#
-.\" -s option has been zapped for now
-.\" .Op Fl s Ar server
-.Ar server
+.Op Fl s Ar server
+.Op Fl v
.Ar command ....
.Sh DESCRIPTION
This command allows the system administrator to control the operation
@@ -38,51 +38,46 @@ of a name server.
It supersedes the
.Xr ndc 8
utility that was provided in old BIND releases.
+If
.Nm rndc
-uses a secure channel with encryption algorithms and keys to
-communicate with the name server.
-In the current version of
-.Nm ndc ,
-the only supported encryption algorithm is HMAC-MD5 which uses a
-shared secret.
-This provides TSIG-style authentication for the command request
-and the name server's response.
+is invoked with no command line options or arguments, it
+prints a short summary of the supported commands and the available
+options and their arguments.
.Pp
-.Nm
+.Nm rndc
+uses a secure channel with digital signatures to communicate
+with the name server.
+In the current versions of
+.Nm rndc
+and
+.Xr named 8
+the only supported encryption algorithm is HMAC-MD5, which uses a
+shared secret on each end of the connection.
+This provides TSIG-style authentication for the command request
+and the name server's response. All commands sent over the channel
+must be signed by a key_id known to the server.
+.Pp
+.Nm rndc
reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-.\" An alternate configuration file can be specified with the
-.\" .Ar c
-.\" option.
-.\" .Ar config-file
-.\" is the name of the configuration file to use instead of the default
-.\" one,
-.\" .Pa /etc/rndc.conf .
-.\" .Pp
+An alternate configuration file can be specified with the
+.Ar c
+option.
+.Pp
.Ar server
-is the name of the server which matches a
+is the name or address of the server which matches a
.Dv server{}
statement in the configuration file for
.Nm rndc .
-If an explicit null argument is supplied in
-.Ar server ,
-.Nm rndc
-will contact some default name server which is defined by a
+If no
+.Ar server
+is supplied on the command line, the host named by the
.Dv default-server
clause in the
-.Fv options{}
-statement of
-.Pa /etc/rndc.conf .
-.Pp
-Currently, the
-.Fl m
-option makes
-.Nm rndc
-print details of its internal memory usage statistics.
-This option will only be of interest to BIND9 developers and may be
-removed or changed in a future release.
+.Dv options{}
+statement of the configuration file will be used.
.Pp
The
.Fl p
@@ -90,19 +85,52 @@ option is used to make
.Nm rndc
send commands to TCP port number
.Ar port#
-on the system running the name server instead of the default.
-The standard port number used by BIND9 name servers for receiving
-control commands is 953.
+on the system running the name server instead of BIND 9's
+default control channel port of 953.
.Pp
-If
+The
+.Fl k
+option identifies the
+.Ar key_id
+to use from the configuration file. The
+.Ar key_id
+must be known by
+.Xr named
+with the same algorithm and secret string in order for
+control message validation to succeed. If no
+.Fl k
+option is provided,
.Nm rndc
-is invoked with no command-line options or arguments, it
-prints a short summary of the supported commands and the available
-options and their arguments.
+will first look for a
+.Dv key
+clause in the
+.Dv server{}
+statement of the server being used, or if no
+.Dv server{}
+statement is present for that host, then the
+.Dv default-key
+clause of the
+.Dv options{}
+statement. Note that .Pp
+The configuration file for
+.Nm rdnc
+contains shared secrets which are used to send authenticated
+control commands to name servers, and should therefore not have
+general read or write access.
+.Pp
+The
+.Fl M ,
+.Fl m ,
+and
+.Fl v
+options provided debugging information and are primarily of interest
+only to the BIND 9 developers. They might be changed or removed in
+future releases.
.Pp
The only valid value for
.Ar command
-is \*qreload\*q, which forces the name server to reload.
+is \*qreload\*q, which forces the name server to reload its configuation
+file and zones.
Further commands will be provided in future releases as the management
capabilities of
.Nm rndc
@@ -118,21 +146,23 @@ offers at least as many management capabilities as the old
.Xr ndc
utility.
.Pp
-The configuration file for
-.Nm rdnc
-probably contains shared secrets which are used to send authenticated
-control commands to name servers.
-The file should therefore not have general read or write access.
+There is currently no way to provide the shared secret for a key_id
+without using the configuration file, and thus the
+.Fl c
+option is really required in order for
+.Nm rndc
+to issue validly signed commands to
+.Xr named .
.Pp
-In the current BIND9 release, the name server only listens for
-.Nm rndc
-commands on the loopback interface, 127.0.0.1.
-This means that
-.Nm rndc
-only works on the same system that runs the name server.
-This limitation will be removed in a future release.
+Several error messages could be clearer. For example, trying to connect
+from an address that is not in the list of acceptable addresses
+configured into
+.Xr named
+will result in the error message "end of file" when the server just
+unceremonisously closes the connection.
.Sh SEE ALSO
-.Xr named 8 ,
-.Xr RFC2845 ,
.Xr rndc.conf 5 ,
+.Xr named 8 ,
+.Xr named.conf 5 ,
+.Xr RFC2845 ,
.Xr ndc 8 .
From 60f0c97c9024e75a74b9b1a8f3c24274663a3dc9 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Mon, 10 Jul 2000 23:05:51 +0000
Subject: [PATCH 007/226] fix broken shell code
---
bin/tests/system/start.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/tests/system/start.sh b/bin/tests/system/start.sh
index 7ab3524525..9ac22da012 100644
--- a/bin/tests/system/start.sh
+++ b/bin/tests/system/start.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: start.sh,v 1.25 2000/07/10 22:49:46 mws Exp $
+# $Id: start.sh,v 1.26 2000/07/10 23:05:51 bwelling Exp $
#
# Start name servers for running system tests.
@@ -30,7 +30,7 @@ test -d "$1" || { echo No test directory: "$1"; exit 1; }
portup=0
testloop=0
-while [ $portup == 0 ]
+while [ $portup = 0 ]
do
if $PERL ./testsock.pl -p 5300
then
@@ -39,7 +39,7 @@ do
echo "I:Couldn't bind to socket (yet)"
sleep 2
testloop=`expr $testloop + 1`
- if [ $testloop == 5 ]; then
+ if [ $testloop = 5 ]; then
echo "$0: could not bind to server addresses, still running?"
echo "I:server sockets not available"
echo "R:FAIL"
From 4ebb4093f80e32e4a57ff3769f7fd4ad2217ee44 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 23:23:30 +0000
Subject: [PATCH 008/226] assertion -> assertion failure; tabified
---
CHANGES | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/CHANGES b/CHANGES
index 17f4f3a1f5..124d706fa7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -33,7 +33,7 @@
more than one key specified for the inet clause.
313. [bug] When parsing resolv.conf, don't terminate on an
- error. Instead, parse as much as possible, but
+ error. Instead, parse as much as possible, but
still return an error if one was found.
312. [bug] Increase the number of allowed elements in the
@@ -73,11 +73,11 @@
destroying the query context and then want to use
it again when the send event posted, triggering an
assertion as it tried to cancel an already-canceled
- query. (RT #77)
+ query. (RT #77)
- 306. [bug] Reading HMAC-MD5 private key files didn't work.
+ 306. [bug] Reading HMAC-MD5 private key files didn't work.
- 305. [bug] When reloading the server with a config file
+ 305. [bug] When reloading the server with a config file
containing a syntax error, it could catch an
assertion failure trying to perform zone
maintenance on tentatively created zones whose
@@ -106,7 +106,7 @@
299. [cleanup] Get the user and group information before changing the
root directory, so the administrator does not need to
keep a copy of the user and group databases in the
- chroot'ed environment. Suggested by Hakan Olsson.
+ chroot'ed environment. Suggested by Hakan Olsson.
--- 9.0.0b5 released ---
@@ -116,7 +116,7 @@
297. [bug] Specifying a key name that wasn't fully qualified
in certain parts of the config file could cause
- an assertion.
+ an assertion failure.
296. [bug] "make install" from a separate build directory
failed unless configure had been run in the source
@@ -148,7 +148,7 @@
over TCP just because the incoming recursive query
was a TCP one.
- 290. [cleanup] +twiddle option to dig (for testing only) removed.
+ 290. [cleanup] +twiddle option to dig (for testing only) removed.
289. [cleanup] dig is now installed in $bindir instead of $sbindir.
host is now installed in $bindir. (Be sure to remove
@@ -169,7 +169,7 @@
285. [bug] A change made to the dst API for beta4 inadvertently
broke OMAPI's creation of a dst key from an incoming
- message, causing an assertion to be triggered. Fixed.
+ message, causing an assertion to be triggered. Fixed.
284. [func] The DNSSEC key generation and signing tools now
generate randomness from keyboard input on systems
From e09caeceef8a6759de5c34ffba9a7a566eb8c74c Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Mon, 10 Jul 2000 23:46:50 +0000
Subject: [PATCH 009/226] print the test info before executing the test
---
bin/tests/system/dnssec/tests.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh
index b4956cd0b7..f2c77fbc0d 100644
--- a/bin/tests/system/dnssec/tests.sh
+++ b/bin/tests/system/dnssec/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.19 2000/07/10 21:40:16 bwelling Exp $
+# $Id: tests.sh,v 1.20 2000/07/10 23:46:50 bwelling Exp $
#
# Perform tests
@@ -32,69 +32,70 @@ rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocmd -p 5300"
# Check the example. domain
+echo "I:checking that zone transfer worked"
ret=0
$DIG $DIGOPTS a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
$DIG $DIGOPTS a.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking that zone transfer worked"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+echo "I:checking positive validation"
ret=0
$DIG $DIGOPTS +noauth a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
$DIG $DIGOPTS +noauth a.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking positive validation"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Check the insecure.example domain
+echo "I:checking 1-server insecurity proof"
ret=0
$DIG $DIGOPTS a.insecure.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
$DIG $DIGOPTS a.insecure.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
$PERL ../digcomp.pl dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking 1-server insecurity proof"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Check the secure.example domain
+echo "I:checking multi-stage positive validation"
ret=0
$DIG $DIGOPTS a.secure.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
$DIG $DIGOPTS a.secure.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
$PERL ../digcomp.pl dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking multi-stage positive validation"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Check the bogus domain
+echo "I:checking negative validation"
ret=0
$DIG $DIGOPTS a.bogus.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
grep "SERVFAIL" dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
-echo "I:checking negative validation"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Try validating a key with a bad trusted key.
# This should fail.
+echo "I:checking that validation fails with a misconfigured trusted key"
ret=0
$DIG $DIGOPTS example. key @10.53.0.5 -p 5300 > dig.out.ns5.test$n || ret=1
grep "SERVFAIL" dig.out.ns5.test$n > /dev/null || ret=1
n=`expr $n + 1`
-echo "I:checking that validation fails with a misconfigured trusted key"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Check the insecure.secure.example domain (insecurity proof)
+echo "I:checking 2-server insecurity proof"
ret=0
$DIG $DIGOPTS a.insecure.secure.example. @10.53.0.2 a > dig.out.ns2.test$n \
|| ret=1
@@ -102,12 +103,12 @@ $DIG $DIGOPTS a.insecure.secure.example. @10.53.0.4 a > dig.out.ns4.test$n \
|| ret=1
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking 2-server insecurity proof"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# Check a negative response in insecure.secure.example
+echo "I:checking 2-server insecurity proof with a negative answer"
ret=0
$DIG $DIGOPTS q.insecure.secure.example. @10.53.0.2 a > dig.out.ns2.test$n \
|| ret=1
@@ -115,7 +116,6 @@ $DIG $DIGOPTS q.insecure.secure.example. @10.53.0.4 a > dig.out.ns4.test$n \
|| ret=1
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
-echo "I:checking 2-server insecurity proof with a negative answer"
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
From 7d7bd1b4f0270691f434d37b1052259a13185663 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Mon, 10 Jul 2000 23:52:36 +0000
Subject: [PATCH 010/226] added missing CHANGES entry: 323. [bug]
dns_rbt_findname() did not ignore empty rbt nodes.
Because of this, servers authoritative for a parent
and grandchild zone but not authoritative for the
intervening child zone did not correctly issue
referrals to the servers of the child zone.
---
CHANGES | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CHANGES b/CHANGES
index 124d706fa7..349b93e81b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
+ 323. [bug] dns_rbt_findname() did not ignore empty rbt nodes.
+ Because of this, servers authoritative for a parent
+ and grandchild zone but not authoritative for the
+ intervening child zone did not correctly issue
+ referrals to the servers of the child zone.
+
322. [bug] Queries for KEY RRs are now sent to the parent
server before the authoritative one, making
DNSSEC insecurity proofs work in many cases
From 32d6b7bbfb2f23c1bb9480441ede5cd2f0f51aa0 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 00:23:38 +0000
Subject: [PATCH 011/226] use base64 for the secret; describe how base64
secrets can be made; clarify the interaction of some of the statements and
the command line; clarify the double quote rules
---
bin/rndc/rndc.conf.5 | 110 +++++++++++++++++++++++++++++++--------
doc/man/bin/rndc.conf.5 | 110 +++++++++++++++++++++++++++++++--------
doc/man/misc/rndc.conf.5 | 110 +++++++++++++++++++++++++++++++--------
3 files changed, 261 insertions(+), 69 deletions(-)
diff --git a/bin/rndc/rndc.conf.5 b/bin/rndc/rndc.conf.5
index 218366d57b..5d9ac5b0e1 100644
--- a/bin/rndc/rndc.conf.5
+++ b/bin/rndc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.1 2000/06/29 06:14:18 jim Exp $
+.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -58,11 +58,8 @@ statement contains two clauses.
The
.Dv default-server
clause
-is followed by the name of a name server.
-This must be identified by a
-.Dv server{}
-statement elsewhere in the file.
-This server will
+is followed by the name or address of a name server.
+This host will
be used when no name server is given as an argument to
.Nm rndc .
The
@@ -71,52 +68,76 @@ clause
is followed by the name of a key which is identified by a
.Dv key{}
statement.
-If no other suitable key can be found in the file, this default key
-will be used to authenticate commands sent to the name
-server and its responses.
-The key name is enclosed in double quotes.
+If no
+.Fl k
+option is provided on the
+.Xr rndc
+command line, and no
+.Dv key
+clause is found in a a matching
+.Dv server{}
+statement, this default key will be used to authenticate the server's
+commands and responses.
.Pp
After the keyword
.Dv server ,
the
.Dv server{}
-statement is followed by a string which is the hostname for the
+statement is followed by a string which is the hostname or address for a
name server.
-The statement has a single clause:
+The statement has a single clause,
.Dv key .
-This contains the name of a key which is enclosed in double quotes.
The key name must match the name of a
.Dv key{}
statement in the file.
.Pp
The
.Dv key{}
-statement begins with an identifying string - the name of the key.
+statement begins with an identifying string, the name of the key.
The statement has two clauses.
.Dv algorithm
identifies the encryption algorithm for
.Nm rndc
-to use.
-Currently only HMAC-MD5 is supported.
+to use; currently only HMAC-MD5 is supported.
This is followed by a
.Dv secret
clause which contains the base-64 encoding of the
algorithm's encryption key.
The base-64 string is enclosed in double quotes.
+.Pp
+There are two common ways to generate the base-64 string for the
+.Dv secret .
+The BIND 9 program
+.Xr dnssec-keygen 8
+can be used to generate a random key, or the
+.Xr mmencode 1
+program, also known as
+.Xr mimencode 1 ,
+can be used to generate a base-64 string from known input.
+.Xr mmencode
+does not ship with BIND 9 but is available on many systems.
+See the
+.Sx EXAMPLES
+section for sample command lines for each.
+.Pp
+Normally it is not necessary to double quote host or key names, but
+host addresses must always be double quoted and both host and key
+names must be double quoted when they match another keyword, such as
+having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
- default-server localhost;
- default-key "samplekey";
+ default-server localhost;
+ default-key samplekey;
};
server localhost {
- key "samplekey";
+ key samplekey;
};
-key "samplekey" {
- algorithm hmac-md5;
- secret "strong enough for a man, but made for a woman";
+key samplekey {
+ algorithm hmac-md5;
+ secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
.Ed
.Pp
@@ -135,6 +156,49 @@ uses the HMAC-MD5 algorithm and its
.Dv secret
clause contains the base-64 encoding of the HMAC-MD5 secret enclosed
in double quotes.
+.Pp
+To generate a random secret with
+.Xr dnssec-keygen :
+.Bd -literal indent
+$ dnssec-keygen -a hmac-md5 -b 128 -n user rndc
+.Ed
+.Pp
+The base-64 string will appear in two files,
+.Pa Krndc.+157.+{random}.key
+and
+.Pa Krndc.+157.+{random}.private .
+After extracting the key to be
+placed in the
+.Nm rndc.conf
+and
+.Xr named.conf
+.Dv key{}
+statements, the
+.Pa .key
+and
+.Pa .private
+files can be removed.
+.Pp
+To generate a secret from known input with
+.Xr mmenode :
+.Bd -literal indent
+$ echo "known plaintext for a secret" | mmencode
+.Ed
+.Sh LIMITATIONS
+There is currently no way to specify the port for
+.Xr rndc
+to use. This will be remedied in future releases by allowing a
+.Dv port
+clause to the
+.Dv server{}
+statement and a
+.Dv default-port
+clause to the
+.Dv options{}
+statement.
.Sh SEE ALSO
.Xr rndc 8 ,
-"BIND9 Administrators Manual"
+.Xr named.conf 8 ,
+.Xr dnssec-keygen 8 ,
+.Xr mmencode 1 ,
+"BIND9 Administrators Manual".
diff --git a/doc/man/bin/rndc.conf.5 b/doc/man/bin/rndc.conf.5
index 218366d57b..5d9ac5b0e1 100644
--- a/doc/man/bin/rndc.conf.5
+++ b/doc/man/bin/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.1 2000/06/29 06:14:18 jim Exp $
+.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -58,11 +58,8 @@ statement contains two clauses.
The
.Dv default-server
clause
-is followed by the name of a name server.
-This must be identified by a
-.Dv server{}
-statement elsewhere in the file.
-This server will
+is followed by the name or address of a name server.
+This host will
be used when no name server is given as an argument to
.Nm rndc .
The
@@ -71,52 +68,76 @@ clause
is followed by the name of a key which is identified by a
.Dv key{}
statement.
-If no other suitable key can be found in the file, this default key
-will be used to authenticate commands sent to the name
-server and its responses.
-The key name is enclosed in double quotes.
+If no
+.Fl k
+option is provided on the
+.Xr rndc
+command line, and no
+.Dv key
+clause is found in a a matching
+.Dv server{}
+statement, this default key will be used to authenticate the server's
+commands and responses.
.Pp
After the keyword
.Dv server ,
the
.Dv server{}
-statement is followed by a string which is the hostname for the
+statement is followed by a string which is the hostname or address for a
name server.
-The statement has a single clause:
+The statement has a single clause,
.Dv key .
-This contains the name of a key which is enclosed in double quotes.
The key name must match the name of a
.Dv key{}
statement in the file.
.Pp
The
.Dv key{}
-statement begins with an identifying string - the name of the key.
+statement begins with an identifying string, the name of the key.
The statement has two clauses.
.Dv algorithm
identifies the encryption algorithm for
.Nm rndc
-to use.
-Currently only HMAC-MD5 is supported.
+to use; currently only HMAC-MD5 is supported.
This is followed by a
.Dv secret
clause which contains the base-64 encoding of the
algorithm's encryption key.
The base-64 string is enclosed in double quotes.
+.Pp
+There are two common ways to generate the base-64 string for the
+.Dv secret .
+The BIND 9 program
+.Xr dnssec-keygen 8
+can be used to generate a random key, or the
+.Xr mmencode 1
+program, also known as
+.Xr mimencode 1 ,
+can be used to generate a base-64 string from known input.
+.Xr mmencode
+does not ship with BIND 9 but is available on many systems.
+See the
+.Sx EXAMPLES
+section for sample command lines for each.
+.Pp
+Normally it is not necessary to double quote host or key names, but
+host addresses must always be double quoted and both host and key
+names must be double quoted when they match another keyword, such as
+having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
- default-server localhost;
- default-key "samplekey";
+ default-server localhost;
+ default-key samplekey;
};
server localhost {
- key "samplekey";
+ key samplekey;
};
-key "samplekey" {
- algorithm hmac-md5;
- secret "strong enough for a man, but made for a woman";
+key samplekey {
+ algorithm hmac-md5;
+ secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
.Ed
.Pp
@@ -135,6 +156,49 @@ uses the HMAC-MD5 algorithm and its
.Dv secret
clause contains the base-64 encoding of the HMAC-MD5 secret enclosed
in double quotes.
+.Pp
+To generate a random secret with
+.Xr dnssec-keygen :
+.Bd -literal indent
+$ dnssec-keygen -a hmac-md5 -b 128 -n user rndc
+.Ed
+.Pp
+The base-64 string will appear in two files,
+.Pa Krndc.+157.+{random}.key
+and
+.Pa Krndc.+157.+{random}.private .
+After extracting the key to be
+placed in the
+.Nm rndc.conf
+and
+.Xr named.conf
+.Dv key{}
+statements, the
+.Pa .key
+and
+.Pa .private
+files can be removed.
+.Pp
+To generate a secret from known input with
+.Xr mmenode :
+.Bd -literal indent
+$ echo "known plaintext for a secret" | mmencode
+.Ed
+.Sh LIMITATIONS
+There is currently no way to specify the port for
+.Xr rndc
+to use. This will be remedied in future releases by allowing a
+.Dv port
+clause to the
+.Dv server{}
+statement and a
+.Dv default-port
+clause to the
+.Dv options{}
+statement.
.Sh SEE ALSO
.Xr rndc 8 ,
-"BIND9 Administrators Manual"
+.Xr named.conf 8 ,
+.Xr dnssec-keygen 8 ,
+.Xr mmencode 1 ,
+"BIND9 Administrators Manual".
diff --git a/doc/man/misc/rndc.conf.5 b/doc/man/misc/rndc.conf.5
index 218366d57b..5d9ac5b0e1 100644
--- a/doc/man/misc/rndc.conf.5
+++ b/doc/man/misc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.1 2000/06/29 06:14:18 jim Exp $
+.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -58,11 +58,8 @@ statement contains two clauses.
The
.Dv default-server
clause
-is followed by the name of a name server.
-This must be identified by a
-.Dv server{}
-statement elsewhere in the file.
-This server will
+is followed by the name or address of a name server.
+This host will
be used when no name server is given as an argument to
.Nm rndc .
The
@@ -71,52 +68,76 @@ clause
is followed by the name of a key which is identified by a
.Dv key{}
statement.
-If no other suitable key can be found in the file, this default key
-will be used to authenticate commands sent to the name
-server and its responses.
-The key name is enclosed in double quotes.
+If no
+.Fl k
+option is provided on the
+.Xr rndc
+command line, and no
+.Dv key
+clause is found in a a matching
+.Dv server{}
+statement, this default key will be used to authenticate the server's
+commands and responses.
.Pp
After the keyword
.Dv server ,
the
.Dv server{}
-statement is followed by a string which is the hostname for the
+statement is followed by a string which is the hostname or address for a
name server.
-The statement has a single clause:
+The statement has a single clause,
.Dv key .
-This contains the name of a key which is enclosed in double quotes.
The key name must match the name of a
.Dv key{}
statement in the file.
.Pp
The
.Dv key{}
-statement begins with an identifying string - the name of the key.
+statement begins with an identifying string, the name of the key.
The statement has two clauses.
.Dv algorithm
identifies the encryption algorithm for
.Nm rndc
-to use.
-Currently only HMAC-MD5 is supported.
+to use; currently only HMAC-MD5 is supported.
This is followed by a
.Dv secret
clause which contains the base-64 encoding of the
algorithm's encryption key.
The base-64 string is enclosed in double quotes.
+.Pp
+There are two common ways to generate the base-64 string for the
+.Dv secret .
+The BIND 9 program
+.Xr dnssec-keygen 8
+can be used to generate a random key, or the
+.Xr mmencode 1
+program, also known as
+.Xr mimencode 1 ,
+can be used to generate a base-64 string from known input.
+.Xr mmencode
+does not ship with BIND 9 but is available on many systems.
+See the
+.Sx EXAMPLES
+section for sample command lines for each.
+.Pp
+Normally it is not necessary to double quote host or key names, but
+host addresses must always be double quoted and both host and key
+names must be double quoted when they match another keyword, such as
+having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
- default-server localhost;
- default-key "samplekey";
+ default-server localhost;
+ default-key samplekey;
};
server localhost {
- key "samplekey";
+ key samplekey;
};
-key "samplekey" {
- algorithm hmac-md5;
- secret "strong enough for a man, but made for a woman";
+key samplekey {
+ algorithm hmac-md5;
+ secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
.Ed
.Pp
@@ -135,6 +156,49 @@ uses the HMAC-MD5 algorithm and its
.Dv secret
clause contains the base-64 encoding of the HMAC-MD5 secret enclosed
in double quotes.
+.Pp
+To generate a random secret with
+.Xr dnssec-keygen :
+.Bd -literal indent
+$ dnssec-keygen -a hmac-md5 -b 128 -n user rndc
+.Ed
+.Pp
+The base-64 string will appear in two files,
+.Pa Krndc.+157.+{random}.key
+and
+.Pa Krndc.+157.+{random}.private .
+After extracting the key to be
+placed in the
+.Nm rndc.conf
+and
+.Xr named.conf
+.Dv key{}
+statements, the
+.Pa .key
+and
+.Pa .private
+files can be removed.
+.Pp
+To generate a secret from known input with
+.Xr mmenode :
+.Bd -literal indent
+$ echo "known plaintext for a secret" | mmencode
+.Ed
+.Sh LIMITATIONS
+There is currently no way to specify the port for
+.Xr rndc
+to use. This will be remedied in future releases by allowing a
+.Dv port
+clause to the
+.Dv server{}
+statement and a
+.Dv default-port
+clause to the
+.Dv options{}
+statement.
.Sh SEE ALSO
.Xr rndc 8 ,
-"BIND9 Administrators Manual"
+.Xr named.conf 8 ,
+.Xr dnssec-keygen 8 ,
+.Xr mmencode 1 ,
+"BIND9 Administrators Manual".
From 7f2ac7414c0e40d215175db10d0f8ecc85b61cc2 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Tue, 11 Jul 2000 00:36:44 +0000
Subject: [PATCH 012/226] Test that a query for a security root succeeds.
---
bin/tests/system/dnssec/tests.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh
index f2c77fbc0d..15e1a9a3aa 100644
--- a/bin/tests/system/dnssec/tests.sh
+++ b/bin/tests/system/dnssec/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.20 2000/07/10 23:46:50 bwelling Exp $
+# $Id: tests.sh,v 1.21 2000/07/11 00:36:44 bwelling Exp $
#
# Perform tests
@@ -119,5 +119,16 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+# Check that the query for a security root is successful and has ad set
+
+echo "I:checking security root query"
+ret=0
+$DIG $DIGOPTS . @10.53.0.4 key > dig.out.ns4.test$n || ret=1
+grep "NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
+grep "flags:.*ad.*QUERY" dig.out.ns4.test$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
echo "I:exit status: $status"
exit $status
From 3734f3f1bad4160cdd7563bc4801bca7e82f8abd Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 00:37:58 +0000
Subject: [PATCH 013/226] -k flag changed to -y to be compatible with dig and
nsupdate. (... since I have to update the ARM anyway ...)
---
bin/rndc/rndc.8 | 15 +++++----------
bin/rndc/rndc.c | 14 +++++++-------
bin/rndc/rndc.conf.5 | 4 ++--
doc/man/bin/rndc.8 | 15 +++++----------
doc/man/bin/rndc.conf.5 | 4 ++--
doc/man/misc/rndc.conf.5 | 4 ++--
6 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/bin/rndc/rndc.8 b/bin/rndc/rndc.8
index 82778ad5d5..8185edf2a3 100644
--- a/bin/rndc/rndc.8
+++ b/bin/rndc/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.3 2000/07/10 23:04:42 tale Exp $
+.\" $Id: rndc.8,v 1.4 2000/07/11 00:37:57 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -25,12 +25,12 @@
.Sh SYNOPSIS
.Nm rndc
.Op Fl c Ar config-file
-.Op Fl k Ar key_id
.Op Fl M
.Op Fl m
.Op Fl p Ar port#
.Op Fl s Ar server
.Op Fl v
+.Op Fl y Ar key_id
.Ar command ....
.Sh DESCRIPTION
This command allows the system administrator to control the operation
@@ -89,7 +89,7 @@ on the system running the name server instead of BIND 9's
default control channel port of 953.
.Pp
The
-.Fl k
+.Fl y
option identifies the
.Ar key_id
to use from the configuration file. The
@@ -98,7 +98,7 @@ must be known by
.Xr named
with the same algorithm and secret string in order for
control message validation to succeed. If no
-.Fl k
+.Fl y
option is provided,
.Nm rndc
will first look for a
@@ -147,12 +147,7 @@ offers at least as many management capabilities as the old
utility.
.Pp
There is currently no way to provide the shared secret for a key_id
-without using the configuration file, and thus the
-.Fl c
-option is really required in order for
-.Nm rndc
-to issue validly signed commands to
-.Xr named .
+without using the configuration file.
.Pp
Several error messages could be clearer. For example, trying to connect
from an address that is not in the list of acceptable addresses
diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
index fc3e18ac5a..31e3ffae3a 100644
--- a/bin/rndc/rndc.c
+++ b/bin/rndc/rndc.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: rndc.c,v 1.15 2000/07/10 11:38:37 tale Exp $ */
+/* $Id: rndc.c,v 1.16 2000/07/11 00:37:56 tale Exp $ */
/*
* Principal Author: DCL
@@ -227,7 +227,7 @@ ndc_signalhandler(omapi_object_t *handle, const char *name, va_list ap) {
static void
usage(void) {
fprintf(stderr, "\
-Usage: %s [-c config] [-s server] [-p port] [-k key] command [command ...]\n\
+Usage: %s [-c config] [-s server] [-p port] [-y key] command [command ...]\n\
\n\
command is one of the following for named:\n\
\n\
@@ -285,16 +285,12 @@ main(int argc, char **argv) {
else
progname = *argv;
- while ((ch = isc_commandline_parse(argc, argv, "c:k:Mmp:s:v")) != -1) {
+ while ((ch = isc_commandline_parse(argc, argv, "c:Mmp:s:vy:")) != -1) {
switch (ch) {
case 'c':
conffile = isc_commandline_argument;
break;
- case 'k':
- keyname = isc_commandline_argument;
- break;
-
case 'M':
isc_mem_debugging = ISC_TRUE;
break;
@@ -323,6 +319,10 @@ main(int argc, char **argv) {
verbose = ISC_TRUE;
break;
+ case 'y':
+ keyname = isc_commandline_argument;
+ break;
+
case '?':
usage();
exit(1);
diff --git a/bin/rndc/rndc.conf.5 b/bin/rndc/rndc.conf.5
index 5d9ac5b0e1..8e37f976bf 100644
--- a/bin/rndc/rndc.conf.5
+++ b/bin/rndc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
+.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -69,7 +69,7 @@ is followed by the name of a key which is identified by a
.Dv key{}
statement.
If no
-.Fl k
+.Fl y
option is provided on the
.Xr rndc
command line, and no
diff --git a/doc/man/bin/rndc.8 b/doc/man/bin/rndc.8
index 82778ad5d5..8185edf2a3 100644
--- a/doc/man/bin/rndc.8
+++ b/doc/man/bin/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.3 2000/07/10 23:04:42 tale Exp $
+.\" $Id: rndc.8,v 1.4 2000/07/11 00:37:57 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -25,12 +25,12 @@
.Sh SYNOPSIS
.Nm rndc
.Op Fl c Ar config-file
-.Op Fl k Ar key_id
.Op Fl M
.Op Fl m
.Op Fl p Ar port#
.Op Fl s Ar server
.Op Fl v
+.Op Fl y Ar key_id
.Ar command ....
.Sh DESCRIPTION
This command allows the system administrator to control the operation
@@ -89,7 +89,7 @@ on the system running the name server instead of BIND 9's
default control channel port of 953.
.Pp
The
-.Fl k
+.Fl y
option identifies the
.Ar key_id
to use from the configuration file. The
@@ -98,7 +98,7 @@ must be known by
.Xr named
with the same algorithm and secret string in order for
control message validation to succeed. If no
-.Fl k
+.Fl y
option is provided,
.Nm rndc
will first look for a
@@ -147,12 +147,7 @@ offers at least as many management capabilities as the old
utility.
.Pp
There is currently no way to provide the shared secret for a key_id
-without using the configuration file, and thus the
-.Fl c
-option is really required in order for
-.Nm rndc
-to issue validly signed commands to
-.Xr named .
+without using the configuration file.
.Pp
Several error messages could be clearer. For example, trying to connect
from an address that is not in the list of acceptable addresses
diff --git a/doc/man/bin/rndc.conf.5 b/doc/man/bin/rndc.conf.5
index 5d9ac5b0e1..8e37f976bf 100644
--- a/doc/man/bin/rndc.conf.5
+++ b/doc/man/bin/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
+.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -69,7 +69,7 @@ is followed by the name of a key which is identified by a
.Dv key{}
statement.
If no
-.Fl k
+.Fl y
option is provided on the
.Xr rndc
command line, and no
diff --git a/doc/man/misc/rndc.conf.5 b/doc/man/misc/rndc.conf.5
index 5d9ac5b0e1..8e37f976bf 100644
--- a/doc/man/misc/rndc.conf.5
+++ b/doc/man/misc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.2 2000/07/11 00:23:38 tale Exp $
+.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -69,7 +69,7 @@ is followed by the name of a key which is identified by a
.Dv key{}
statement.
If no
-.Fl k
+.Fl y
option is provided on the
.Xr rndc
command line, and no
From ea01648cb950b8d4b5625a8a91a4c1c019dec885 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Tue, 11 Jul 2000 00:37:59 +0000
Subject: [PATCH 014/226] added missing CHANGES entry: 324. [func]
In the resolver, turn EDNS0 off if there is no
response after a number of retransmissions. This is
to allow queries some chance of succeeding even if
all the authoritative servers of a zone silently
discard EDNS0 requests instead of sending an error
response like they ought to.
---
CHANGES | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/CHANGES b/CHANGES
index 349b93e81b..6fa0dd4b32 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,11 @@
+ 324. [func] In the resolver, turn EDNS0 off if there is no
+ response after a number of retransmissions.
+ This is to allow queries some chance of succeeding
+ even if all the authoritative servers of a zone
+ silently discard EDNS0 requests instead of
+ sending an error response like they ought to.
+
323. [bug] dns_rbt_findname() did not ignore empty rbt nodes.
Because of this, servers authoritative for a parent
and grandchild zone but not authoritative for the
From 87983da955bf63128de85d180359bdc418516c3c Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 01:30:56 +0000
Subject: [PATCH 015/226] use configure-generated sysconfdir, add version
string
---
bin/rndc/Makefile.in | 6 +++++-
bin/rndc/rndc.c | 10 ++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/bin/rndc/Makefile.in b/bin/rndc/Makefile.in
index 5c3988b833..1526db1744 100644
--- a/bin/rndc/Makefile.in
+++ b/bin/rndc/Makefile.in
@@ -13,7 +13,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: Makefile.in,v 1.8 2000/06/28 16:27:17 tale Exp $
+# $Id: Makefile.in,v 1.9 2000/07/11 01:30:55 tale Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -49,6 +49,10 @@ SRCS = rndc.c
@BIND9_MAKE_RULES@
+rndc.@O@ rndc.c:
+ ${LIBTOOL} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
+ -DRNDC_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/rndc.c
+
rndc: ${OBJS} ${DEPLIBS}
${LIBTOOL} ${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS}
diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
index 31e3ffae3a..a3ebdf8f72 100644
--- a/bin/rndc/rndc.c
+++ b/bin/rndc/rndc.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: rndc.c,v 1.16 2000/07/11 00:37:56 tale Exp $ */
+/* $Id: rndc.c,v 1.17 2000/07/11 01:30:56 tale Exp $ */
/*
* Principal Author: DCL
@@ -40,7 +40,8 @@
#include
static const char *progname;
-static const char *conffile = "/etc/rndc.conf";
+static const char *conffile = RNDC_SYSCONFDIR "/rndc.conf";
+static const char *version = VERSION;
static isc_boolean_t verbose;
static isc_mem_t *mctx;
@@ -241,8 +242,9 @@ command is one of the following for named:\n\
*stop Stop the server.\n\
*restart Restart the server.\n\
\n\
-* == not yet implemented\n",
- progname);
+* == not yet implemented\n\
+Version: %s\n",
+ progname, version);
}
#undef DO
From 37ea500c8acc98372c0c498424fea32ea80d548b Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 01:31:06 +0000
Subject: [PATCH 016/226] use base64 for secret in sample config
---
bin/rndc/rndc.conf | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/bin/rndc/rndc.conf b/bin/rndc/rndc.conf
index a443745d57..a27bb4c67f 100644
--- a/bin/rndc/rndc.conf
+++ b/bin/rndc/rndc.conf
@@ -15,7 +15,11 @@
* SOFTWARE.
*/
-/* $Id: rndc.conf,v 1.3 2000/06/22 21:50:02 tale Exp $ */
+/* $Id: rndc.conf,v 1.4 2000/07/11 01:31:06 tale Exp $ */
+
+/*
+ * Sample rndc configuration file.
+ */
options {
default-server localhost;
@@ -28,5 +32,5 @@ server localhost {
key "key" {
algorithm hmac-md5;
- secret "strong enough for a man, but made for a woman";
+ secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
From 6c3371d89a9e7d928b86e076f37a1ea6b5433d94 Mon Sep 17 00:00:00 2001
From: Mark Andrews
Date: Tue, 11 Jul 2000 02:40:58 +0000
Subject: [PATCH 017/226] Add test for leading zero in SOA serial
---
bin/tests/master/dns_master_load_11_data | 12 ++++++++++++
bin/tests/master/master11.data | 6 ++++++
bin/tests/master/t_master.c | 17 ++++++++++++++++-
3 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 bin/tests/master/dns_master_load_11_data
create mode 100644 bin/tests/master/master11.data
diff --git a/bin/tests/master/dns_master_load_11_data b/bin/tests/master/dns_master_load_11_data
new file mode 100644
index 0000000000..7b667b273b
--- /dev/null
+++ b/bin/tests/master/dns_master_load_11_data
@@ -0,0 +1,12 @@
+#
+# test data for dns_master_load test 11
+#
+# format is:
+# masterfile origin class expected_result
+# where
+# masterfile name is the name of a file containing master data
+# origin is the origin
+# class is the zone's class
+# expected_result is a text representation of a dns_result_t
+#
+master11.data test in ISC_R_SUCCESS
diff --git a/bin/tests/master/master11.data b/bin/tests/master/master11.data
new file mode 100644
index 0000000000..0aaec25ecf
--- /dev/null
+++ b/bin/tests/master/master11.data
@@ -0,0 +1,6 @@
+;
+; The following serial number contains a leading 0 and a 9 so the
+; we can catch cases where it is incorrectly treated as a octal
+; number.
+;
+@ 300 IN SOA ns hostmaster 00090000 1200 3600 604800 300
diff --git a/bin/tests/master/t_master.c b/bin/tests/master/t_master.c
index d5e59eb566..c63cd94558 100644
--- a/bin/tests/master/t_master.c
+++ b/bin/tests/master/t_master.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: t_master.c,v 1.25 2000/07/09 12:48:43 marka Exp $ */
+/* $Id: t_master.c,v 1.26 2000/07/11 02:40:58 marka Exp $ */
#include
@@ -302,6 +302,20 @@ t10() {
t_result(result);
}
+static const char *a11 =
+ "dns_master_loadfile allow leading zeros in SOA";
+
+static void
+t11() {
+ int result;
+
+ t_assert("dns_master_loadfile", 11, T_REQUIRED, a11);
+ result = test_master_x("dns_master_load_11_data");
+
+ t_result(result);
+}
+
+
testspec_t T_testlist[] = {
{ t1, "ISC_R_SUCCESS" },
{ t2, "ISC_R_UNEXPECTEDEND" },
@@ -313,6 +327,7 @@ testspec_t T_testlist[] = {
{ t8, "$INCLUDE" },
{ t9, "$INCLUDE w/ DNS_BADCLASS" },
{ t10, "non empty blank lines" },
+ { t11, "leading zeros in serial" },
{ NULL, NULL }
};
From 5c0a406664065d54824675e3d2f795ea9e2a56b8 Mon Sep 17 00:00:00 2001
From: Mark Andrews
Date: Tue, 11 Jul 2000 02:44:54 +0000
Subject: [PATCH 018/226] 325. [bug] isc_lex_gettoken was
processing octal strings when ISC_LEXOPT_CNUMBER was
not set.
---
CHANGES | 2 ++
lib/isc/lex.c | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/CHANGES b/CHANGES
index 6fa0dd4b32..abe061d290 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 325. [bug] isc_lex_gettoken was processing octal strings when
+ ISC_LEXOPT_CNUMBER was not set.
324. [func] In the resolver, turn EDNS0 off if there is no
response after a number of retransmissions.
diff --git a/lib/isc/lex.c b/lib/isc/lex.c
index 5a838a9a77..2ee37d41d2 100644
--- a/lib/isc/lex.c
+++ b/lib/isc/lex.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: lex.c,v 1.32 2000/07/10 05:11:17 marka Exp $ */
+/* $Id: lex.c,v 1.33 2000/07/11 02:44:54 marka Exp $ */
#include
@@ -511,8 +511,13 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
if (c == ' ' || c == '\t' || c == '\r' ||
c == '\n' || c == EOF ||
lex->specials[c]) {
+ int base;
+ if ((options & ISC_LEXOPT_CNUMBER) != 0)
+ base = 0;
+ else
+ base = 10;
pushback(source, c);
- ulong = strtoul(lex->data, &e, 0);
+ ulong = strtoul(lex->data, &e, base);
if (ulong == ULONG_MAX &&
errno == ERANGE) {
return (ISC_R_RANGE);
From 6331b9a45efba4e4e71e66ce4e2613a3433d18b2 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Tue, 11 Jul 2000 17:35:49 +0000
Subject: [PATCH 019/226] Don't try and reset timers which aren't being used.
---
bin/dig/dig.c | 9 ++++++++-
bin/dig/dighost.c | 12 ++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index f8f1183420..fd60e1fead 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.57 2000/07/10 18:02:27 bwelling Exp $ */
+/* $Id: dig.c,v 1.58 2000/07/11 17:35:48 mws Exp $ */
#include
#include
@@ -644,6 +644,13 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
timeout = atoi(&rv[0][6]);
if (timeout <= 0)
timeout = 1;
+ debug ("timeout set to %d", timeout);
+ } else if (strncmp(rv[0], "+timeout=", 9) == 0) {
+ /* Global option always */
+ timeout = atoi(&rv[0][9]);
+ if (timeout <= 0)
+ timeout = 1;
+ debug ("timeout set to %d", timeout);
} else if (strncmp(rv[0], "+tries=", 7) == 0) {
if (have_host) {
lookup->retries = atoi(&rv[0][7]);
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index fe8f0399a7..c7d96458b8 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.73 2000/07/10 18:02:28 bwelling Exp $ */
+/* $Id: dighost.c,v 1.74 2000/07/11 17:35:49 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -1193,6 +1193,7 @@ send_udp(dig_lookup_t *lookup) {
local_timeout = UDP_TIMEOUT;
} else
local_timeout = timeout;
+ debug ("have local timeout of %d", local_timeout);
isc_interval_set(&lookup->interval, local_timeout, 0);
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
&lookup->interval, global_task,
@@ -1763,19 +1764,21 @@ recv_done(isc_task_t *task, isc_event_t *event) {
* the timeout to much longer, so brief network
* outages won't cause the XFR to abort
*/
- if (timeout != INT_MAX) {
+ if ((timeout != INT_MAX) &&
+ (query->lookup->timer != NULL)) {
if (timeout == 0) {
if (query->lookup->tcp_mode)
local_timeout = TCP_TIMEOUT;
else
local_timeout = UDP_TIMEOUT;
} else {
- if (((long)timeout * 4) <
- (long)INT_MAX)
+ if (timeout < (INT_MAX / 4))
local_timeout = timeout * 4;
else
local_timeout = INT_MAX;
}
+ debug ("have local timeout of %d",
+ local_timeout);
isc_interval_set(&query->lookup->interval,
local_timeout, 0);
result = isc_timer_reset(query->lookup->timer,
@@ -1953,6 +1956,7 @@ do_lookup_tcp(dig_lookup_t *lookup) {
local_timeout = UDP_TIMEOUT;
} else
local_timeout = timeout;
+ debug ("have local timeout of %d", local_timeout);
isc_interval_set(&lookup->interval, local_timeout, 0);
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
&lookup->interval, global_task,
From 1b4e3f88bb63d84fdca5464507d14180bae5cd40 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Tue, 11 Jul 2000 17:49:02 +0000
Subject: [PATCH 020/226] Minor typo in error result
---
bin/dig/dighost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index c7d96458b8..6a058a2c1a 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.74 2000/07/11 17:35:49 mws Exp $ */
+/* $Id: dighost.c,v 1.75 2000/07/11 17:49:02 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -1786,7 +1786,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
NULL,
&query->lookup->interval,
ISC_FALSE);
- check_result(result, "isc_timer_create");
+ check_result(result, "isc_timer_reset");
}
}
if (query->lookup->xfr_q == query) {
From adade77942b069127a7094df419b3ad39dafb385 Mon Sep 17 00:00:00 2001
From: James Brister
Date: Tue, 11 Jul 2000 19:09:10 +0000
Subject: [PATCH 021/226] 326. [func] 'keys' in an 'inet' control
statement is now required and must have at least one
item in it.
warning is issued if a 'unix' control channel is
defined (not supported).
---
CHANGES | 6 ++
bin/tests/named.conf | 12 ++-
lib/dns/config/confctl.c | 61 ++++++++++-
lib/dns/config/confctx.c | 11 +-
lib/dns/config/confkeys.c | 23 ++++-
lib/dns/include/dns/confctl.h | 18 +++-
lib/dns/include/dns/confkeys.h | 180 ++++++++++++++-------------------
7 files changed, 197 insertions(+), 114 deletions(-)
diff --git a/CHANGES b/CHANGES
index abe061d290..e3f7a294d3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+ 326. [func] 'keys' in an 'inet' control statement is now
+ required and must have at least one item in it.
+
+ warning is issued if a 'unix' control channel is
+ defined (not supported).
+
325. [bug] isc_lex_gettoken was processing octal strings when
ISC_LEXOPT_CNUMBER was not set.
diff --git a/bin/tests/named.conf b/bin/tests/named.conf
index 3e7c85e1f8..3887ae02bc 100644
--- a/bin/tests/named.conf
+++ b/bin/tests/named.conf
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: named.conf,v 1.40 2000/07/07 23:11:41 brister Exp $ */
+/* $Id: named.conf,v 1.41 2000/07/11 19:09:01 brister Exp $ */
/*
* This is a worthless, nonrunnable example of a named.conf file that has
@@ -198,10 +198,12 @@ options {
* Control listeners, for "ndc". Every nameserver needs at least one.
*/
controls {
- inet * port 52 allow { any; }; // a bad idea
- inet 10.0.0.1 allow { any; }; // a bad idea
- inet 10.0.0.2 allow { none; } keys { "key-1"; "key-2"; };// a bad idea
- unix "/var/run/ndc" perm 0600 owner 0 group 0; // the default
+ // 'inet' lines without a 'port' defaults to 'port 953'
+ // 'keys' must be used and the list must have at least one entry
+ inet * port 52 allow { any; } keys { "key2"; };
+ inet 10.0.0.1 allow { any; } keys { "key4";};
+ inet 10.0.0.2 allow { none; } keys { "key-1"; "key-2"; };
+ unix "/var/run/ndc" perm 0600 owner 0 group 0; // ignored by named.
};
zone "master.demo.zone" {
diff --git a/lib/dns/config/confctl.c b/lib/dns/config/confctl.c
index 8103db49b8..bf60f4f468 100644
--- a/lib/dns/config/confctl.c
+++ b/lib/dns/config/confctl.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confctl.c,v 1.24 2000/07/10 11:28:30 tale Exp $ */
+/* $Id: confctl.c,v 1.25 2000/07/11 19:09:02 brister Exp $ */
#include
@@ -23,6 +23,7 @@
#include
#include
+#include
isc_result_t
dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist) {
@@ -46,7 +47,30 @@ dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist) {
return (ISC_R_SUCCESS);
}
-
+
+
+isc_result_t
+dns_c_ctrllist_validate(dns_c_ctrllist_t *cl) {
+ dns_c_ctrl_t *ctl;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(DNS_C_CONFCTLLIST_VALID(cl));
+
+ ctl = dns_c_ctrllist_head(cl);
+ if (ctl == NULL) {
+ isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
+ DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
+ "empty control statement");
+ } else {
+ while (result == ISC_R_SUCCESS && ctl != NULL) {
+ result = dns_c_ctrl_validate(ctl);
+ ctl = dns_c_ctrl_next(ctl);
+ }
+ }
+
+ return (result);
+}
+
void
dns_c_ctrllist_print(FILE *fp, int indent, dns_c_ctrllist_t *cl) {
dns_c_ctrl_t *ctl;
@@ -102,6 +126,39 @@ dns_c_ctrllist_delete(dns_c_ctrllist_t **list) {
return (ISC_R_SUCCESS);
}
+
+isc_result_t
+dns_c_ctrl_validate(dns_c_ctrl_t *ctrl)
+{
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(DNS_C_CONFCTL_VALID(ctrl));
+
+ if (ctrl->control_type == dns_c_unix_control) {
+ isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
+ DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
+ "unix sockets are not not implmented for"
+ " control channels");
+ } else if (ctrl->keyidlist == NULL) {
+ isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
+ DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
+ "the KEYS clause of an INET control "
+ "channel must be used");
+ result = ISC_R_FAILURE;
+ } else if (dns_c_kidlist_keycount(ctrl->keyidlist) == 0) {
+ isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
+ DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
+ "the KEYS clause of an INET control "
+ "channel must not be empty");
+ result = ISC_R_FAILURE;
+ }
+
+
+ return (result);
+}
+
+
+
isc_result_t
dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control,
isc_sockaddr_t addr, in_port_t port,
diff --git a/lib/dns/config/confctx.c b/lib/dns/config/confctx.c
index e32cfe753f..169e3ffbf6 100644
--- a/lib/dns/config/confctx.c
+++ b/lib/dns/config/confctx.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confctx.c,v 1.72 2000/07/07 22:57:53 brister Exp $ */
+/* $Id: confctx.c,v 1.73 2000/07/11 19:09:04 brister Exp $ */
#include
@@ -229,6 +229,7 @@ dns_c_checkconfig(dns_c_ctx_t *cfg)
isc_result_t tmpres;
dns_c_rrsolist_t *olist;
dns_c_lstnlist_t *listenlist;
+ dns_c_ctrllist_t *controls;
if (dns_c_ctx_getnamedxfer(cfg, &cpval) != ISC_R_NOTFOUND) {
@@ -492,6 +493,14 @@ dns_c_checkconfig(dns_c_ctx_t *cfg)
}
}
+ if (dns_c_ctx_getcontrols(cfg, &controls) != ISC_R_NOTFOUND) {
+ tmpres = dns_c_ctrllist_validate(controls);
+ if (tmpres != ISC_R_SUCCESS) {
+ result = tmpres;
+ }
+ }
+
+
return (result);
}
diff --git a/lib/dns/config/confkeys.c b/lib/dns/config/confkeys.c
index f18cd908cb..638294242f 100644
--- a/lib/dns/config/confkeys.c
+++ b/lib/dns/config/confkeys.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confkeys.c,v 1.24 2000/07/07 23:11:43 brister Exp $ */
+/* $Id: confkeys.c,v 1.25 2000/07/11 19:09:06 brister Exp $ */
#include
@@ -450,6 +450,27 @@ dns_c_kidlist_delete(dns_c_kidlist_t **list)
}
+isc_uint32_t
+dns_c_kidlist_keycount(dns_c_kidlist_t *list)
+{
+ dns_c_kid_t *kid;
+ isc_uint32_t count = 0;
+
+ REQUIRE(DNS_C_KEYIDLIST_VALID(list));
+
+ kid = ISC_LIST_HEAD(list->keyids);
+ while (kid != NULL) {
+ count++;
+ kid = ISC_LIST_NEXT(kid, next);
+ }
+
+ return (count);
+}
+
+
+
+
+
static isc_result_t
keyid_delete(dns_c_kid_t **keyid)
{
diff --git a/lib/dns/include/dns/confctl.h b/lib/dns/include/dns/confctl.h
index a3982e884a..fbcaae801b 100644
--- a/lib/dns/include/dns/confctl.h
+++ b/lib/dns/include/dns/confctl.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confctl.h,v 1.18 2000/07/10 11:28:31 tale Exp $ */
+/* $Id: confctl.h,v 1.19 2000/07/11 19:09:07 brister Exp $ */
#ifndef DNS_CONFCTL_H
#define DNS_CONFCTL_H 1
@@ -161,6 +161,16 @@ dns_c_ctrl_delete(dns_c_ctrl_t **control);
* ISC_R_SUCCESS
*/
+
+isc_result_t
+dns_c_ctrl_validate(dns_c_ctrl_t *ctrl);
+/*
+ * Validates one control statement enty.
+ * The KEYS must be used. UNIX types are ignored (so we issue a warning for
+ * that.
+ */
+
+
void
dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl);
/*
@@ -187,6 +197,12 @@ dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist);
* ISC_R_NOMEMORY -- insufficient memory available.
*/
+isc_result_t
+dns_c_ctrllist_validate(dns_c_ctrllist_t *cl);
+/*
+ * Validates the subclauses of the control statement.
+ */
+
isc_result_t
dns_c_ctrllist_delete(dns_c_ctrllist_t **list);
/*
diff --git a/lib/dns/include/dns/confkeys.h b/lib/dns/include/dns/confkeys.h
index 379251724e..4ee4c9034d 100644
--- a/lib/dns/include/dns/confkeys.h
+++ b/lib/dns/include/dns/confkeys.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confkeys.h,v 1.17 2000/06/22 21:55:22 tale Exp $ */
+/* $Id: confkeys.h,v 1.18 2000/07/11 19:09:09 brister Exp $ */
#ifndef DNS_CONFKEYS_H
#define DNS_CONFKEYS_H 1
@@ -195,152 +195,124 @@ struct dns_c_kid_list {
ISC_LANG_BEGINDECLS
-isc_result_t
-dns_c_pklist_new(isc_mem_t *mem, dns_c_pklist_t **pklist);
+isc_result_t dns_c_pklist_new(isc_mem_t *mem, dns_c_pklist_t **pklist);
-isc_result_t
-dns_c_pklist_delete(dns_c_pklist_t **list);
+isc_result_t dns_c_pklist_delete(dns_c_pklist_t **list);
-isc_result_t
-dns_c_pklist_addpubkey(dns_c_pklist_t *list, dns_c_pubkey_t *pkey,
- isc_boolean_t deepcopy);
+isc_result_t dns_c_pklist_addpubkey(dns_c_pklist_t *list, dns_c_pubkey_t *pkey,
+ isc_boolean_t deepcopy);
-isc_result_t
-dns_c_pklist_findpubkey(dns_c_pklist_t *list, dns_c_pubkey_t **pubkey,
- isc_uint32_t flags, isc_uint32_t protocol,
- isc_uint32_t algorithm, const char *key);
+isc_result_t dns_c_pklist_findpubkey(dns_c_pklist_t *list,
+ dns_c_pubkey_t **pubkey,
+ isc_uint32_t flags, isc_uint32_t protocol,
+ isc_uint32_t algorithm, const char *key);
-isc_result_t
-dns_c_pklist_rmpubkey(dns_c_pklist_t *list, isc_uint32_t flags,
- isc_uint32_t protocol, isc_uint32_t algorithm,
- const char *key);
+isc_result_t dns_c_pklist_rmpubkey(dns_c_pklist_t *list, isc_uint32_t flags,
+ isc_uint32_t protocol,
+ isc_uint32_t algorithm, const char *key);
-void
-dns_c_pklist_print(FILE *fp, int indent, dns_c_pklist_t *pubkey);
+void dns_c_pklist_print(FILE *fp, int indent, dns_c_pklist_t *pubkey);
-isc_result_t
-dns_c_pubkey_new(isc_mem_t *mem, isc_uint32_t flags, isc_uint32_t protocol,
- isc_uint32_t algorithm, const char *key,
- dns_c_pubkey_t **pubkey);
+isc_result_t dns_c_pubkey_new(isc_mem_t *mem, isc_uint32_t flags,
+ isc_uint32_t protocol,
+ isc_uint32_t algorithm,
+ const char *key,
+ dns_c_pubkey_t **pubkey);
-isc_result_t
-dns_c_pubkey_delete(dns_c_pubkey_t **pubkey);
+isc_result_t dns_c_pubkey_delete(dns_c_pubkey_t **pubkey);
-isc_result_t
-dns_c_pubkey_copy(isc_mem_t *mem, dns_c_pubkey_t **dest, dns_c_pubkey_t *src);
+isc_result_t dns_c_pubkey_copy(isc_mem_t *mem, dns_c_pubkey_t **dest,
+ dns_c_pubkey_t *src);
-isc_boolean_t
-dns_c_pubkey_equal(dns_c_pubkey_t *k1, dns_c_pubkey_t *k2);
+isc_boolean_t dns_c_pubkey_equal(dns_c_pubkey_t *k1, dns_c_pubkey_t *k2);
-void
-dns_c_pubkey_print(FILE *fp, int indent, dns_c_pubkey_t *pubkey);
+void dns_c_pubkey_print(FILE *fp, int indent, dns_c_pubkey_t *pubkey);
-isc_result_t
-dns_c_kidlist_new(isc_mem_t *mem, dns_c_kidlist_t **list);
+isc_result_t dns_c_kidlist_new(isc_mem_t *mem, dns_c_kidlist_t **list);
-isc_result_t
-dns_c_kidlist_delete(dns_c_kidlist_t **list);
+isc_result_t dns_c_kidlist_delete(dns_c_kidlist_t **list);
-isc_result_t
-dns_c_kidlist_undef(dns_c_kidlist_t *list, const char *keyid);
+isc_uint32_t dns_c_kidlist_keycount(dns_c_kidlist_t *list);
-isc_result_t
-dns_c_kidlist_find(dns_c_kidlist_t *list, const char *keyid,
- dns_c_kid_t **retval);
+
+isc_result_t dns_c_kidlist_undef(dns_c_kidlist_t *list, const char *keyid);
-void
-dns_c_kidlist_append(dns_c_kidlist_t *list, dns_c_kid_t *keyid);
+isc_result_t dns_c_kidlist_find(dns_c_kidlist_t *list, const char *keyid,
+ dns_c_kid_t **retval);
-void
-dns_c_kidlist_print(FILE *fp, int indent, dns_c_kidlist_t *list);
+void dns_c_kidlist_append(dns_c_kidlist_t *list, dns_c_kid_t *keyid);
-isc_result_t
-dns_c_kid_new(isc_mem_t *mem, const char *name, dns_c_kid_t **keyid);
+void dns_c_kidlist_print(FILE *fp, int indent, dns_c_kidlist_t *list);
-isc_result_t
-dns_c_kdeflist_new(isc_mem_t *mem, dns_c_kdeflist_t **list);
+isc_result_t dns_c_kid_new(isc_mem_t *mem, const char *name,
+ dns_c_kid_t **keyid);
-isc_result_t
-dns_c_kdeflist_delete(dns_c_kdeflist_t **list);
+isc_result_t dns_c_kdeflist_new(isc_mem_t *mem, dns_c_kdeflist_t **list);
-isc_result_t
-dns_c_kdeflist_copy(isc_mem_t *mem, dns_c_kdeflist_t **dest,
- dns_c_kdeflist_t *src);
+isc_result_t dns_c_kdeflist_delete(dns_c_kdeflist_t **list);
-isc_result_t
-dns_c_kdeflist_append(dns_c_kdeflist_t *list, dns_c_kdef_t *key,
- isc_boolean_t copy);
+isc_result_t dns_c_kdeflist_copy(isc_mem_t *mem, dns_c_kdeflist_t **dest,
+ dns_c_kdeflist_t *src);
-isc_result_t
-dns_c_kdeflist_undef(dns_c_kdeflist_t *list, const char *keyid);
+isc_result_t dns_c_kdeflist_append(dns_c_kdeflist_t *list, dns_c_kdef_t *key,
+ isc_boolean_t copy);
-isc_result_t
-dns_c_kdeflist_find(dns_c_kdeflist_t *list, const char *keyid,
- dns_c_kdef_t **retval);
+isc_result_t dns_c_kdeflist_undef(dns_c_kdeflist_t *list, const char *keyid);
-void
-dns_c_kdeflist_print(FILE *fp, int indent, dns_c_kdeflist_t *list);
+isc_result_t dns_c_kdeflist_find(dns_c_kdeflist_t *list, const char *keyid,
+ dns_c_kdef_t **retval);
-isc_result_t
-dns_c_kdef_new(isc_mem_t *mem, const char *name, dns_c_kdef_t **keyid);
+void dns_c_kdeflist_print(FILE *fp, int indent, dns_c_kdeflist_t *list);
-isc_result_t
-dns_c_kdef_delete(dns_c_kdef_t **keydef);
+isc_result_t dns_c_kdef_new(isc_mem_t *mem, const char *name,
+ dns_c_kdef_t **keyid);
-isc_result_t
-dns_c_kdef_copy(isc_mem_t *mem, dns_c_kdef_t **dest, dns_c_kdef_t *src);
+isc_result_t dns_c_kdef_delete(dns_c_kdef_t **keydef);
-void
-dns_c_kdef_print(FILE *fp, int indent, dns_c_kdef_t *keydef);
+isc_result_t dns_c_kdef_copy(isc_mem_t *mem, dns_c_kdef_t **dest,
+ dns_c_kdef_t *src);
-isc_result_t
-dns_c_kdef_setalgorithm(dns_c_kdef_t *elem, const char *algorithm);
+void dns_c_kdef_print(FILE *fp, int indent, dns_c_kdef_t *keydef);
-isc_result_t
-dns_c_kdef_setsecret(dns_c_kdef_t *elem, const char *secret);
+isc_result_t dns_c_kdef_setalgorithm(dns_c_kdef_t *elem,
+ const char *algorithm);
-isc_result_t
-dns_c_tkeylist_new(isc_mem_t *mem, dns_c_tkeylist_t **newlist);
+isc_result_t dns_c_kdef_setsecret(dns_c_kdef_t *elem, const char *secret);
-isc_result_t
-dns_c_tkeylist_delete(dns_c_tkeylist_t **list);
+isc_result_t dns_c_tkeylist_new(isc_mem_t *mem, dns_c_tkeylist_t **newlist);
-isc_result_t
-dns_c_tkeylist_copy(isc_mem_t *mem, dns_c_tkeylist_t **dest,
- dns_c_tkeylist_t *src);
+isc_result_t dns_c_tkeylist_delete(dns_c_tkeylist_t **list);
-void
-dns_c_tkeylist_print(FILE *fp, int indent, dns_c_tkeylist_t *list);
+isc_result_t dns_c_tkeylist_copy(isc_mem_t *mem, dns_c_tkeylist_t **dest,
+ dns_c_tkeylist_t *src);
-isc_result_t
-dns_c_tkeylist_append(dns_c_tkeylist_t *list, dns_c_tkey_t *element,
- isc_boolean_t copy);
+void dns_c_tkeylist_print(FILE *fp, int indent, dns_c_tkeylist_t *list);
-isc_result_t
-dns_c_tkey_new(isc_mem_t *mem, const char *domain, isc_uint32_t flags,
- isc_uint32_t protocol, isc_uint32_t algorithm,
- const char *key, dns_c_tkey_t **newkey);
+isc_result_t dns_c_tkeylist_append(dns_c_tkeylist_t *list,
+ dns_c_tkey_t *element,
+ isc_boolean_t copy);
-isc_result_t
-dns_c_tkey_delete(dns_c_tkey_t **tkey);
+isc_result_t dns_c_tkey_new(isc_mem_t *mem, const char *domain,
+ isc_uint32_t flags,
+ isc_uint32_t protocol, isc_uint32_t algorithm,
+ const char *key, dns_c_tkey_t **newkey);
-isc_result_t
-dns_c_tkey_copy(isc_mem_t *mem, dns_c_tkey_t **dest, dns_c_tkey_t *src);
+isc_result_t dns_c_tkey_delete(dns_c_tkey_t **tkey);
-isc_result_t
-dns_c_tkey_getflags(dns_c_tkey_t *tkey, isc_uint32_t *flags);
+isc_result_t dns_c_tkey_copy(isc_mem_t *mem, dns_c_tkey_t **dest,
+ dns_c_tkey_t *src);
-isc_result_t
-dns_c_tkey_getprotocol(dns_c_tkey_t *tkey, isc_uint32_t *protocol);
+isc_result_t dns_c_tkey_getflags(dns_c_tkey_t *tkey, isc_uint32_t *flags);
-isc_result_t
-dns_c_tkey_getalgorithm(dns_c_tkey_t *tkey, isc_uint32_t *algorithm);
+isc_result_t dns_c_tkey_getprotocol(dns_c_tkey_t *tkey,
+ isc_uint32_t *protocol);
-isc_result_t
-dns_c_tkey_getkey(dns_c_tkey_t *tkey, const char **key);
+isc_result_t dns_c_tkey_getalgorithm(dns_c_tkey_t *tkey,
+ isc_uint32_t *algorithm);
-void
-dns_c_tkey_print(FILE *fp, int indent, dns_c_tkey_t *tkey);
+isc_result_t dns_c_tkey_getkey(dns_c_tkey_t *tkey, const char **key);
+
+void dns_c_tkey_print(FILE *fp, int indent, dns_c_tkey_t *tkey);
ISC_LANG_ENDDECLS
From 838f13fbdc513895d1826201a11531dbde9de04a Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Tue, 11 Jul 2000 19:18:05 +0000
Subject: [PATCH 022/226] Set default signal handlers for SIGINT and SIGTERM
(SIGHUP already had one). This doesn't appear to have an effect on any
platform, but it seems like a good idea.
---
lib/isc/unix/app.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c
index c936a91711..8a4283b7ee 100644
--- a/lib/isc/unix/app.c
+++ b/lib/isc/unix/app.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: app.c,v 1.19 2000/06/29 07:40:58 explorer Exp $ */
+/* $Id: app.c,v 1.20 2000/07/11 19:18:05 bwelling Exp $ */
#include
@@ -152,11 +152,17 @@ isc_app_start(void) {
/*
* On Solaris 2, delivery of a signal whose action is SIG_IGN
* will not cause sigwait() to return. We may have inherited
- * a SIG_IGN action for SIGHUP from our parent process,
- * (e.g, Solaris cron). Set an action of SIG_DFL to make
+ * unexpected actions for SIGHUP, SIGINT, and SIGTERM from our parent
+ * process, * (e.g, Solaris cron). Set an action of SIG_DFL to make
* sure sigwait() works as expected.
*/
result = handle_signal(SIGHUP, SIG_DFL);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ result = handle_signal(SIGTERM, SIG_DFL);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ result = handle_signal(SIGINT, SIG_DFL);
if (result != ISC_R_SUCCESS)
return (result);
From f4d9f465cd29963a99554bbe2936509ea3568c89 Mon Sep 17 00:00:00 2001
From: James Brister
Date: Tue, 11 Jul 2000 20:13:09 +0000
Subject: [PATCH 023/226] 327. [bug] rndc.conf parser wasn't
correctly recognising an IP address where a host
specification was required.
---
CHANGES | 3 ++
lib/dns/config/confndc.c | 90 ++++++++++++++++++++--------------------
2 files changed, 49 insertions(+), 44 deletions(-)
diff --git a/CHANGES b/CHANGES
index e3f7a294d3..ffced6322b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+ 327. [bug] rndc.conf parser wasn't correctly recognising an IP
+ address where a host specification was required.
+
326. [func] 'keys' in an 'inet' control statement is now
required and must have at least one item in it.
diff --git a/lib/dns/config/confndc.c b/lib/dns/config/confndc.c
index 72d57f00d0..a73c720391 100644
--- a/lib/dns/config/confndc.c
+++ b/lib/dns/config/confndc.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confndc.c,v 1.20 2000/07/10 11:27:11 tale Exp $ */
+/* $Id: confndc.c,v 1.21 2000/07/11 20:13:09 brister Exp $ */
/*
** options {
@@ -144,51 +144,39 @@ static struct keywordtoken misc_tokens[] = {
-static isc_result_t
-parse_file(ndcpcontext *pctx, dns_c_ndcctx_t **context);
+static isc_result_t parse_file(ndcpcontext *pctx, dns_c_ndcctx_t **context);
-static isc_result_t
-parse_statement(ndcpcontext *pctx);
-static isc_result_t
-parse_options(ndcpcontext *pctx, dns_c_ndcopts_t **opts);
-static isc_result_t
-parse_serverstmt(ndcpcontext *pctx, dns_c_ndcserver_t **server);
-static isc_result_t
-parse_keystmt(ndcpcontext *pctx, dns_c_kdeflist_t *keys);
+static isc_result_t parse_statement(ndcpcontext *pctx);
+static isc_result_t parse_options(ndcpcontext *pctx, dns_c_ndcopts_t **opts);
+static isc_result_t parse_serverstmt(ndcpcontext *pctx, dns_c_ndcserver_t **server);
+static isc_result_t parse_keystmt(ndcpcontext *pctx, dns_c_kdeflist_t *keys);
-static const char *
-keyword2str(isc_int32_t val);
-static isc_boolean_t
-eat(ndcpcontext *pctx, isc_uint32_t token);
-static isc_boolean_t
-eat_eos(ndcpcontext *pctx);
-static isc_boolean_t
-eat_lbrace(ndcpcontext *pctx);
-static isc_boolean_t
-eat_rbrace(ndcpcontext *pctx);
+static const char * keyword2str(isc_int32_t val);
+static isc_boolean_t eat(ndcpcontext *pctx, isc_uint32_t token);
+static isc_boolean_t eat_eos(ndcpcontext *pctx);
+static isc_boolean_t eat_lbrace(ndcpcontext *pctx);
+static isc_boolean_t eat_rbrace(ndcpcontext *pctx);
-static isc_boolean_t
-looking_at(ndcpcontext *pctx, isc_uint32_t token);
-static isc_boolean_t
-looking_at_anystring(ndcpcontext *pctx);
+static isc_boolean_t looking_at(ndcpcontext *pctx, isc_uint32_t token);
+static isc_boolean_t looking_at_anystring(ndcpcontext *pctx);
-static isc_result_t
-parser_setup(ndcpcontext *pctx, isc_mem_t *mem, const char *filename);
-static void
-parser_complain(isc_boolean_t is_warning, isc_boolean_t print_last_token,
- ndcpcontext *pctx, const char *format, va_list args);
-static void
-parser_error(ndcpcontext *pctx, isc_boolean_t lasttoken, const char *fmt, ...);
-static void
-parser_warn(ndcpcontext *pctx, isc_boolean_t lasttoken, const char *fmt, ...);
-static isc_boolean_t
-is_ip6addr(const char *string, struct in6_addr *addr);
-static isc_boolean_t
-is_ip4addr(const char *string, struct in_addr *addr);
-static isc_result_t
-getnexttoken(ndcpcontext *pctx);
-static void
-syntax_error(ndcpcontext *pctx, isc_uint32_t keyword);
+static isc_boolean_t looking_at_stringoripaddr(ndcpcontext *pctx);
+
+
+static isc_result_t parser_setup(ndcpcontext *pctx, isc_mem_t *mem,
+ const char *filename);
+static void parser_complain(isc_boolean_t is_warning,
+ isc_boolean_t print_last_token,
+ ndcpcontext *pctx, const char *format,
+ va_list args);
+static void parser_error(ndcpcontext *pctx, isc_boolean_t lasttoken,
+ const char *fmt, ...);
+static void parser_warn(ndcpcontext *pctx, isc_boolean_t lasttoken,
+ const char *fmt, ...);
+static isc_boolean_t is_ip6addr(const char *string, struct in6_addr *addr);
+static isc_boolean_t is_ip4addr(const char *string, struct in_addr *addr);
+static isc_result_t getnexttoken(ndcpcontext *pctx);
+static void syntax_error(ndcpcontext *pctx, isc_uint32_t keyword);
/* *********************************************************************** */
@@ -950,7 +938,7 @@ parse_options(ndcpcontext *pctx, dns_c_ndcopts_t **opts) {
switch (option) {
case L_DEFAULT_SERVER:
- if (!looking_at_anystring(pctx))
+ if (!looking_at_stringoripaddr(pctx))
return (result);
result = dns_c_ndcopts_setdefserver(newopts,
@@ -1067,7 +1055,7 @@ parse_serverstmt(ndcpcontext *pctx, dns_c_ndcserver_t **server) {
break;
case L_HOST:
- if (!looking_at_anystring(pctx)) {
+ if (!looking_at_stringoripaddr(pctx)) {
result = ISC_R_FAILURE;
goto done;
}
@@ -1347,6 +1335,20 @@ looking_at_anystring(ndcpcontext *pctx) {
return (ISC_TRUE);
}
+
+static isc_boolean_t
+looking_at_stringoripaddr(ndcpcontext *pctx) {
+ if (pctx->currtok != L_STRING && pctx->currtok != L_QSTRING &&
+ pctx->currtok != L_IP4ADDR && pctx->currtok != L_IP6ADDR) {
+ parser_error(pctx, ISC_TRUE,
+ "expected a hostname or an ip address");
+ return (ISC_FALSE);
+ }
+
+ return (ISC_TRUE);
+}
+
+
static isc_boolean_t
eat_lbrace(ndcpcontext *pctx) {
return (eat(pctx, L_LBRACE));
From 9bf765ab3a5203b854d32266e6162e547791383c Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 21:51:13 +0000
Subject: [PATCH 024/226] 328. [func] Added
isc_base64_decodestring().
(This is basically bin/named/server.c:base64_cstring_tobuffer(), which I
will remove in another revision that will not need to be pulled up. I also
would like to change isc_base64_totext() and isc_base64_tobuffer() to be
isc_base64_encoderegion() and isc_base64_decodelexer(), unless there are
exceptions. I find their existing names to be quite confusing with regard to
what translation function each performs.)
---
CHANGES | 7 ++++---
lib/isc/base64.c | 35 ++++++++++++++++++++++++++++++++++-
lib/isc/include/isc/base64.h | 26 ++++++++++++++++++++++++--
3 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/CHANGES b/CHANGES
index ffced6322b..2919ba89c2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,12 @@
+ 328. [func] Added isc_base64_decodestring().
+
327. [bug] rndc.conf parser wasn't correctly recognising an IP
address where a host specification was required.
326. [func] 'keys' in an 'inet' control statement is now
required and must have at least one item in it.
-
- warning is issued if a 'unix' control channel is
- defined (not supported).
+ A "not supported" warning is now issued if a 'unix'
+ control channel is defined.
325. [bug] isc_lex_gettoken was processing octal strings when
ISC_LEXOPT_CNUMBER was not set.
diff --git a/lib/isc/base64.c b/lib/isc/base64.c
index a6f01ba50f..29ae56b39e 100644
--- a/lib/isc/base64.c
+++ b/lib/isc/base64.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: base64.c,v 1.15 2000/06/21 21:56:29 tale Exp $ */
+/* $Id: base64.c,v 1.16 2000/07/11 21:51:12 tale Exp $ */
#include
@@ -160,6 +160,39 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
return (ISC_R_SUCCESS);
}
+isc_result_t
+isc_base64_decodestring(isc_mem_t *mctx, char *cstr, isc_buffer_t *target) {
+ isc_result_t result;
+ isc_buffer_t source;
+ isc_lex_t *lex = NULL;
+ isc_boolean_t isopen = ISC_FALSE;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(cstr != NULL);
+ REQUIRE(ISC_BUFFER_VALID(target));
+
+ isc_buffer_init(&source, cstr, strlen(cstr));
+ isc_buffer_add(&source, strlen(cstr));
+
+ result = isc_lex_create(mctx, 256, &lex);
+
+ if (result == ISC_R_SUCCESS)
+ result = isc_lex_openbuffer(lex, &source);
+
+ if (result == ISC_R_SUCCESS) {
+ isopen = ISC_TRUE;
+ result = isc_base64_tobuffer(lex, target, -1);
+ }
+
+ if (isopen)
+ (void)isc_lex_close(lex);
+ if (lex != NULL)
+ isc_lex_destroy(&lex);
+
+ return (result);
+}
+
+
static isc_result_t
str_totext(const char *source, isc_buffer_t *target) {
unsigned int l;
diff --git a/lib/isc/include/isc/base64.h b/lib/isc/include/isc/base64.h
index 7fe9b316c2..f3aec10e2a 100644
--- a/lib/isc/include/isc/base64.h
+++ b/lib/isc/include/isc/base64.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: base64.h,v 1.9 2000/06/06 17:50:38 gson Exp $ */
+/* $Id: base64.h,v 1.10 2000/07/11 21:51:13 tale Exp $ */
#ifndef ISC_BASE64_H
#define ISC_BASE64_H 1
@@ -53,10 +53,31 @@ isc_base64_totext(isc_region_t *source, int wordlength,
* necessary.
*/
+isc_result_t
+isc_base64_decodestring(isc_mem_t *mctx, char *cstr, isc_buffer_t *target);
+/*
+ * Decode a null-terminated base64 string.
+ *
+ * Requires:
+ * 'mctx' is non-null.
+ * 'cstr' is non-null.
+ * 'target' is a valid buffer.
+ *
+ * Returns:
+ * ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
+ * fit in 'target'.
+ * ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding.
+ *
+ * Other error returns are any possible error code from:
+ * isc_lex_create(),
+ * isc_lex_openbuffer(),
+ * isc_base64_tobuffer().
+ */
+
isc_result_t
isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
/*
- * Convert base64 encoded text into data.
+ * Convert base64 encoded text from a lexer context into data.
*
* Requires:
* 'lex' is a valid lexer context
@@ -71,6 +92,7 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
*/
+
ISC_LANG_ENDDECLS
#endif /* ISC_BASE64_H */
From ce2be9b7211ab5bacaa10fe74ef35def3a3f6089 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 22:03:12 +0000
Subject: [PATCH 025/226] 329. [func] omapi_auth_register() now
takes a size_t argument for the length of a key's secret
data. Previously OMAPI only stored secrets up to the
first NUL byte.
This change was made to cope with decoded base64 secrets, so in this
revision omapiconf.c and rndc.c also decode the secret.
---
CHANGES | 4 ++++
bin/named/omapiconf.c | 40 ++++++++++++++++++++++++++-------
bin/rndc/rndc.c | 15 +++++++++----
lib/omapi/auth.c | 19 +++++++++-------
lib/omapi/include/omapi/omapi.h | 6 ++---
5 files changed, 61 insertions(+), 23 deletions(-)
diff --git a/CHANGES b/CHANGES
index 2919ba89c2..0772b30444 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+ 329. [func] omapi_auth_register() now takes a size_t argument for
+ the length of a key's secret data. Previously
+ OMAPI only stored secrets up to the first NUL byte.
+
328. [func] Added isc_base64_decodestring().
327. [bug] rndc.conf parser wasn't correctly recognising an IP
diff --git a/bin/named/omapiconf.c b/bin/named/omapiconf.c
index 1a72729f2e..ebb31fcf85 100644
--- a/bin/named/omapiconf.c
+++ b/bin/named/omapiconf.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapiconf.c,v 1.4 2000/07/10 22:04:08 tale Exp $ */
+/* $Id: omapiconf.c,v 1.5 2000/07/11 22:03:09 tale Exp $ */
/*
* Principal Author: DCL
@@ -23,12 +23,16 @@
#include
+#include
+#include
#include
#include
#include
#include
#include
+#include
+
#include
#include
#include
@@ -195,6 +199,8 @@ register_keys(dns_c_ctrl_t *control, dns_c_kdeflist_t *keydeflist,
{
dns_c_kid_t *keyid;
dns_c_kdef_t *keydef;
+ const char secret[1024];
+ isc_buffer_t b;
isc_result_t result;
/*
@@ -221,9 +227,9 @@ register_keys(dns_c_ctrl_t *control, dns_c_kdeflist_t *keydeflist,
* the keys statement.
*/
keydef = NULL;
- (void)dns_c_kdeflist_find(keydeflist, keyid->keyid,
- &keydef);
- if (keydef == NULL)
+ result = dns_c_kdeflist_find(keydeflist, keyid->keyid,
+ &keydef);
+ if (result != ISC_R_SUCCESS)
isc_log_write(ns_g_lctx, ISC_LOGCATEGORY_GENERAL,
NS_LOGMODULE_OMAPI, ISC_LOG_WARNING,
"couldn't find key %s for"
@@ -237,13 +243,31 @@ register_keys(dns_c_ctrl_t *control, dns_c_kdeflist_t *keydeflist,
"command channel %s",
keydef->algorithm, keydef->keyid,
socktext);
- keydef = NULL;
+ result = DST_R_UNSUPPORTEDALG;
+ keydef = NULL; /* Prevent more error messages. */
}
- if (keydef != NULL)
+ if (result == ISC_R_SUCCESS) {
+ isc_buffer_init(&b, secret, sizeof(secret));
+ result = isc_base64_decodestring(ns_g_mctx,
+ keydef->secret,
+ &b);
+ }
+
+ if (keydef != NULL && result != ISC_R_SUCCESS) {
+ isc_log_write(ns_g_lctx, ISC_LOGCATEGORY_GENERAL,
+ NS_LOGMODULE_OMAPI, ISC_LOG_WARNING,
+ "can't use secret for key %s on "
+ "command channel %s: %s",
+ keydef->keyid, socktext,
+ isc_result_totext(result));
+ keydef = NULL; /* Prevent more error messages. */
+
+ } else if (result == ISC_R_SUCCESS)
result = omapi_auth_register(keydef->keyid,
- keydef->secret,
- OMAPI_AUTH_HMACMD5);
+ OMAPI_AUTH_HMACMD5,
+ isc_buffer_base(&b),
+ isc_buffer_usedlength(&b));
if (keydef != NULL && result != ISC_R_SUCCESS)
isc_log_write(ns_g_lctx, ISC_LOGCATEGORY_GENERAL,
diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
index a3ebdf8f72..4efa7846dd 100644
--- a/bin/rndc/rndc.c
+++ b/bin/rndc/rndc.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: rndc.c,v 1.17 2000/07/11 01:30:56 tale Exp $ */
+/* $Id: rndc.c,v 1.18 2000/07/11 22:03:08 tale Exp $ */
/*
* Principal Author: DCL
@@ -25,6 +25,8 @@
#include
+#include
+#include
#include
#include
#include
@@ -273,7 +275,8 @@ main(int argc, char **argv) {
dns_c_kdeflist_t *keys = NULL;
dns_c_kdef_t *key = NULL;
const char *keyname = NULL;
- const char *secret = NULL;
+ char secret[1024];
+ isc_buffer_t secretbuf;
char *command;
const char *servername = NULL;
const char *host = NULL;
@@ -396,7 +399,6 @@ main(int argc, char **argv) {
INSIST(key->secret != NULL);
INSIST(key->algorithm != NULL);
- secret = key->secret;
if (strcasecmp(key->algorithm, "hmac-md5") == 0)
algorithm = OMAPI_AUTH_HMACMD5;
else {
@@ -405,6 +407,10 @@ main(int argc, char **argv) {
exit(1);
}
+ isc_buffer_init(&secretbuf, secret, sizeof(secret));
+ DO("decode base64 secret",
+ isc_base64_decodestring(mctx, key->secret, &secretbuf));
+
if (server != NULL)
(void)dns_c_ndcserver_gethost(server, &host);
@@ -432,7 +438,8 @@ main(int argc, char **argv) {
ndc_g_ndc.type = ndc_type;
DO("register local authenticator",
- omapi_auth_register(keyname, secret, algorithm));
+ omapi_auth_register(keyname, algorithm, isc_buffer_base(&secretbuf),
+ isc_buffer_usedlength(&secretbuf)));
DO("create protocol manager", omapi_object_create(&omapimgr, NULL, 0));
diff --git a/lib/omapi/auth.c b/lib/omapi/auth.c
index 9d121b32d2..418320f628 100644
--- a/lib/omapi/auth.c
+++ b/lib/omapi/auth.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: auth.c,v 1.9 2000/06/28 03:09:44 tale Exp $ */
+/* $Id: auth.c,v 1.10 2000/07/11 22:03:10 tale Exp $ */
/* Principal Author: DCL */
@@ -58,6 +58,7 @@ struct auth {
unsigned int magic;
char *name;
char *secret;
+ size_t secretlen;
unsigned int algorithms;
ISC_LINK(auth_t) link;
@@ -133,10 +134,8 @@ auth_makekey(const char *name, unsigned int algorithm, dst_key_t **key) {
return (ISC_R_UNEXPECTED);
}
- length = strlen(auth->secret);
- isc_buffer_init(&secret, auth->secret, length);
- isc_buffer_add(&secret, length);
-
+ isc_buffer_init(&secret, auth->secret, auth->secretlen);
+ isc_buffer_add(&secret, auth->secretlen);
length = strlen(auth->name);
isc_buffer_init(&srcb, auth->name, length);
@@ -171,8 +170,8 @@ auth_delete(auth_t *a) {
}
isc_result_t
-omapi_auth_register(const char *name, const char *secret,
- unsigned int algorithms)
+omapi_auth_register(const char *name, unsigned int algorithms,
+ const unsigned char *secret, size_t secretlen)
{
auth_t *new = NULL;
isc_result_t result = ISC_R_SUCCESS;
@@ -199,9 +198,13 @@ omapi_auth_register(const char *name, const char *secret,
if (new->name == NULL)
result = ISC_R_NOMEMORY;
- new->secret = isc_mem_strdup(omapi_mctx, secret);
+ new->secret = isc_mem_allocate(omapi_mctx, secretlen);
if (new->secret == NULL)
result = ISC_R_NOMEMORY;
+ else {
+ memcpy(new->secret, secret, secretlen);
+ new->secretlen = secretlen;
+ }
new->algorithms = algorithms;
diff --git a/lib/omapi/include/omapi/omapi.h b/lib/omapi/include/omapi/omapi.h
index b10cc45e37..f0535890cc 100644
--- a/lib/omapi/include/omapi/omapi.h
+++ b/lib/omapi/include/omapi/omapi.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapi.h,v 1.14 2000/07/10 11:22:59 tale Exp $ */
+/* $Id: omapi.h,v 1.15 2000/07/11 22:03:12 tale Exp $ */
/*
* Definitions for the object management API and protocol.
@@ -94,8 +94,8 @@ struct omapi_object {
* Public functions defined in auth.c.
*/
isc_result_t
-omapi_auth_register(const char *name, const char *secret,
- unsigned int algorithms);
+omapi_auth_register(const char *name, unsigned int algorithms,
+ const unsigned char *secret, size_t secretlen);
void
omapi_auth_deregister(const char *name);
From 403cc93b27c43da09faf0e53d31709e2d5d9cbba Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Tue, 11 Jul 2000 22:44:33 +0000
Subject: [PATCH 026/226] typo in log message
---
lib/dns/zone.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/dns/zone.c b/lib/dns/zone.c
index 843b71ae6b..b68971cd9c 100644
--- a/lib/dns/zone.c
+++ b/lib/dns/zone.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: zone.c,v 1.155 2000/07/04 04:21:38 marka Exp $ */
+/* $Id: zone.c,v 1.156 2000/07/11 22:44:33 gson Exp $ */
#include
@@ -3917,7 +3917,7 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
xfrtype = dns_rdatatype_axfr;
} else {
zone_log(zone, me, ISC_LOG_DEBUG(3),
- "requesting IXFR form %s",
+ "requesting IXFR from %s",
mastertext);
xfrtype = dns_rdatatype_ixfr;
}
From eae2a15326c3cdd5ee0cb7b71736785349fa8bc0 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Tue, 11 Jul 2000 23:02:32 +0000
Subject: [PATCH 027/226] use ns_g_server->aclenv to match localhost and
localnets in the allow{} clause
---
bin/named/omapiconf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/named/omapiconf.c b/bin/named/omapiconf.c
index ebb31fcf85..051f499e15 100644
--- a/bin/named/omapiconf.c
+++ b/bin/named/omapiconf.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapiconf.c,v 1.5 2000/07/11 22:03:09 tale Exp $ */
+/* $Id: omapiconf.c,v 1.6 2000/07/11 23:02:32 tale Exp $ */
/*
* Principal Author: DCL
@@ -137,7 +137,7 @@ verify_connection(isc_sockaddr_t *sockaddr, void *arg) {
listener = arg;
result = dns_acl_match(&netaddr, NULL, listener->acl,
- NULL, &match, NULL);
+ &ns_g_server->aclenv, &match, NULL);
if (result != ISC_R_SUCCESS || match <= 0)
return (ISC_FALSE);
From b95b59db2637a72cf6553c42cc7c27813c7ae3a9 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Tue, 11 Jul 2000 23:42:56 +0000
Subject: [PATCH 028/226] Increase max wait time for transfer to Retry time + 1
minute, since some OS's appear to drop UDP packets and not get the initial
SOA reply.
---
bin/tests/system/xferquota/tests.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh
index 810a7c5b57..c27fba206a 100644
--- a/bin/tests/system/xferquota/tests.sh
+++ b/bin/tests/system/xferquota/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.15 2000/07/07 23:18:51 gson Exp $
+# $Id: tests.sh,v 1.16 2000/07/11 23:42:56 mws Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@@ -26,7 +26,7 @@ SYSTEMTESTTOP=..
count=0
ticks=0
-while [ $count != 300 ]; do
+while [ $count != 360 ]; do
if [ $ticks = 1 ]; then
echo "I:Changing test zone..."
cp ns1/changing2.db ns1/changing.db
@@ -35,7 +35,7 @@ while [ $count != 300 ]; do
sleep 1
ticks=`expr $ticks + 1`
seconds=`expr $ticks \* 1`
- if [ $ticks = 60 ]; then
+ if [ $ticks = 300 ]; then
echo "I:Took too long to load zones"
exit 1
fi
From 969b3374ed8c5ba3a65556d9823ce832c98b5336 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 00:22:57 +0000
Subject: [PATCH 029/226] no space between function name and arg list
---
bin/dig/dig.c | 8 ++++----
bin/dig/dighost.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index fd60e1fead..b3d3ec4f95 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.58 2000/07/11 17:35:48 mws Exp $ */
+/* $Id: dig.c,v 1.59 2000/07/12 00:22:56 gson Exp $ */
#include
#include
@@ -644,13 +644,13 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
timeout = atoi(&rv[0][6]);
if (timeout <= 0)
timeout = 1;
- debug ("timeout set to %d", timeout);
+ debug("timeout set to %d", timeout);
} else if (strncmp(rv[0], "+timeout=", 9) == 0) {
/* Global option always */
timeout = atoi(&rv[0][9]);
if (timeout <= 0)
timeout = 1;
- debug ("timeout set to %d", timeout);
+ debug("timeout set to %d", timeout);
} else if (strncmp(rv[0], "+tries=", 7) == 0) {
if (have_host) {
lookup->retries = atoi(&rv[0][7]);
@@ -1250,7 +1250,7 @@ main(int argc, char **argv) {
*/
#if 0
if (taskmgr != NULL) {
- debug ("Freeing taskmgr");
+ debug("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 6a058a2c1a..9a754997bf 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.75 2000/07/11 17:49:02 mws Exp $ */
+/* $Id: dighost.c,v 1.76 2000/07/12 00:22:57 gson Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -1193,7 +1193,7 @@ send_udp(dig_lookup_t *lookup) {
local_timeout = UDP_TIMEOUT;
} else
local_timeout = timeout;
- debug ("have local timeout of %d", local_timeout);
+ debug("have local timeout of %d", local_timeout);
isc_interval_set(&lookup->interval, local_timeout, 0);
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
&lookup->interval, global_task,
@@ -1777,7 +1777,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
else
local_timeout = INT_MAX;
}
- debug ("have local timeout of %d",
+ debug("have local timeout of %d",
local_timeout);
isc_interval_set(&query->lookup->interval,
local_timeout, 0);
@@ -1956,7 +1956,7 @@ do_lookup_tcp(dig_lookup_t *lookup) {
local_timeout = UDP_TIMEOUT;
} else
local_timeout = timeout;
- debug ("have local timeout of %d", local_timeout);
+ debug("have local timeout of %d", local_timeout);
isc_interval_set(&lookup->interval, local_timeout, 0);
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
&lookup->interval, global_task,
From de73f221e6f0941a12aa2ab91ef7c1ffa321632b Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Wed, 12 Jul 2000 00:42:54 +0000
Subject: [PATCH 030/226] Parenthesis error in trace mode. (To see delegations
in +trace, you need to do +trace +authority in dig. Should this be
defaulted?)
---
bin/dig/dighost.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 9a754997bf..df7561240e 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.76 2000/07/12 00:22:57 gson Exp $ */
+/* $Id: dighost.c,v 1.77 2000/07/12 00:42:54 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -1793,11 +1793,11 @@ recv_done(isc_task_t *task, isc_event_t *event) {
if ((query->lookup->trace)||
(query->lookup->ns_search_only)) {
debug("in TRACE code");
- if ((show_details ||
- ((dns_message_firstname(msg,
- DNS_SECTION_ANSWER)
- == ISC_R_SUCCESS))) &&
- !query->lookup->trace_root ) {
+ if (show_details ||
+ (((dns_message_firstname(msg,
+ DNS_SECTION_ANSWER)
+ == ISC_R_SUCCESS)) &&
+ !query->lookup->trace_root)) {
printmessage(query, msg, ISC_TRUE);
}
if ((msg->rcode != 0) &&
From 931e154a1e597ab183b2a0cece9401f361a47f06 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Wed, 12 Jul 2000 00:46:50 +0000
Subject: [PATCH 031/226] Change ticks to 360, not zones...
---
bin/tests/system/xferquota/tests.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh
index c27fba206a..3a99e23f55 100644
--- a/bin/tests/system/xferquota/tests.sh
+++ b/bin/tests/system/xferquota/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.16 2000/07/11 23:42:56 mws Exp $
+# $Id: tests.sh,v 1.17 2000/07/12 00:46:50 mws Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@@ -26,7 +26,7 @@ SYSTEMTESTTOP=..
count=0
ticks=0
-while [ $count != 360 ]; do
+while [ $count != 300 ]; do
if [ $ticks = 1 ]; then
echo "I:Changing test zone..."
cp ns1/changing2.db ns1/changing.db
@@ -35,7 +35,7 @@ while [ $count != 360 ]; do
sleep 1
ticks=`expr $ticks + 1`
seconds=`expr $ticks \* 1`
- if [ $ticks = 300 ]; then
+ if [ $ticks = 360 ]; then
echo "I:Took too long to load zones"
exit 1
fi
From 42833075debe1b1d4c4d39e94cb8f66e3fba2a0f Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 01:15:00 +0000
Subject: [PATCH 032/226] typo in dependency statement
---
bin/rndc/Makefile.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/rndc/Makefile.in b/bin/rndc/Makefile.in
index 1526db1744..5c444d41b6 100644
--- a/bin/rndc/Makefile.in
+++ b/bin/rndc/Makefile.in
@@ -13,7 +13,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: Makefile.in,v 1.9 2000/07/11 01:30:55 tale Exp $
+# $Id: Makefile.in,v 1.10 2000/07/12 01:15:00 bwelling Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -49,7 +49,7 @@ SRCS = rndc.c
@BIND9_MAKE_RULES@
-rndc.@O@ rndc.c:
+rndc.@O@: rndc.c
${LIBTOOL} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
-DRNDC_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/rndc.c
From e7a99528b496636fffb6948b24b33f22ec134c0b Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 01:15:34 +0000
Subject: [PATCH 033/226] The third parameter to dst_lib_init is an integer, so
should be 0, not NULL.
---
bin/rndc/rndc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
index 4efa7846dd..725491071b 100644
--- a/bin/rndc/rndc.c
+++ b/bin/rndc/rndc.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: rndc.c,v 1.18 2000/07/11 22:03:08 tale Exp $ */
+/* $Id: rndc.c,v 1.19 2000/07/12 01:15:34 bwelling Exp $ */
/*
* Principal Author: DCL
@@ -355,7 +355,7 @@ main(int argc, char **argv) {
DO("create entropy pool", isc_entropy_create(mctx, &entropy));
/* XXXDCL probably should use ISC_ENTROPY_GOOD. talk with graff. */
DO("initialize digital signatures",
- dst_lib_init(mctx, entropy, NULL));
+ dst_lib_init(mctx, entropy, 0));
DO(conffile, dns_c_ndcparseconf(conffile, mctx, &config));
From 473cb90680ac3404147c3a0934a77d0dffaac998 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Wed, 12 Jul 2000 01:41:35 +0000
Subject: [PATCH 034/226] Choose reasonable default values for +trace mode.
---
bin/dig/dig.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index b3d3ec4f95..6bd4b43cd0 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.59 2000/07/12 00:22:56 gson Exp $ */
+/* $Id: dig.c,v 1.60 2000/07/12 01:41:35 mws Exp $ */
#include
#include
@@ -157,7 +157,7 @@ show_usage(void) {
" +domain=### (Set default domainname)\n"
" +bufsize=### (Set EDNS0 Max UDP packet size)\n"
" +[no]search (Set whether to use searchlist)\n"
-" +[no]defname (Set whether to use default domaon)\n"
+" +[no]defname (Set whether to use default domain)\n"
" +[no]recursive (Recursive mode)\n"
" +[no]aaonly (Set AA flag in query)\n"
" +[no]details (Show details of all requests)\n"
@@ -214,8 +214,9 @@ received(int bytes, int frmsize, char *frm, dig_query_t *query) {
puts("");
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&now, &query->time_sent);
- printf(";; Received %u bytes from %.*s in %d ms\n",
- bytes, frmsize, frm, (int)diff/1000);
+ printf(";; Received %u bytes from %.*s(%s) in %d ms\n\n",
+ bytes, frmsize, frm, query->servname,
+ (int)diff/1000);
}
}
@@ -773,7 +774,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->stats = ISC_FALSE;
}
lookup->section_additional = ISC_FALSE;
- lookup->section_authority = ISC_FALSE;
+ lookup->section_authority = ISC_TRUE;
lookup->section_question = ISC_FALSE;
show_details = ISC_TRUE;
} else {
@@ -785,7 +786,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
stats = ISC_FALSE;
}
section_additional = ISC_FALSE;
- section_authority = ISC_FALSE;
+ section_authority = ISC_TRUE;
section_question = ISC_FALSE;
show_details = ISC_TRUE;
}
From a6f31a3fd079f37ad0a7c75ef2d50842cd01811c Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 01:46:57 +0000
Subject: [PATCH 035/226] Only install default handlers for SIGTERM and SIGWAIT
if we haven't installed other handlers already.
---
lib/isc/unix/app.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c
index 8a4283b7ee..1bbcaade23 100644
--- a/lib/isc/unix/app.c
+++ b/lib/isc/unix/app.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: app.c,v 1.20 2000/07/11 19:18:05 bwelling Exp $ */
+/* $Id: app.c,v 1.21 2000/07/12 01:46:57 bwelling Exp $ */
#include
@@ -154,17 +154,22 @@ isc_app_start(void) {
* will not cause sigwait() to return. We may have inherited
* unexpected actions for SIGHUP, SIGINT, and SIGTERM from our parent
* process, * (e.g, Solaris cron). Set an action of SIG_DFL to make
- * sure sigwait() works as expected.
+ * sure sigwait() works as expected. Only do this for SIGTERM and
+ * SIGINT if we don't have sigwait(), since a different handler is
+ * installed above.
*/
result = handle_signal(SIGHUP, SIG_DFL);
if (result != ISC_R_SUCCESS)
return (result);
+
+#ifdef HAVE_SIGWAIT
result = handle_signal(SIGTERM, SIG_DFL);
if (result != ISC_R_SUCCESS)
return (result);
result = handle_signal(SIGINT, SIG_DFL);
if (result != ISC_R_SUCCESS)
return (result);
+#endif
/*
* Block SIGHUP, SIGINT, SIGTERM.
From 52eae74966c3a0b96e95f73db0545301f934fdbb Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 02:07:32 +0000
Subject: [PATCH 036/226] reviewed and edited
---
bin/named/named.8 | 46 +++++++++++++++++++++------------------------
doc/man/bin/named.8 | 46 +++++++++++++++++++++------------------------
2 files changed, 42 insertions(+), 50 deletions(-)
diff --git a/bin/named/named.8 b/bin/named/named.8
index d6eef1d892..51d464e943 100644
--- a/bin/named/named.8
+++ b/bin/named/named.8
@@ -14,7 +14,7 @@
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named.8,v 1.2 2000/06/28 02:51:46 jim Exp $
+.\" $Id: named.8,v 1.3 2000/07/12 02:07:32 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt NAMED 8
@@ -39,7 +39,7 @@ is the ISC implementation of an Internet domain name server.
See RFCs 1033, 1034, and 1035 for more information on the Internet
domain name system.
For historical reasons, the ISC's DNS software is known as BIND -
-Berkeley Internet Nameserver Distribution - because it was originally
+Berkeley Internet Name Daemon - because it was originally
supplied with BSD
.Ux
releases.
@@ -61,7 +61,7 @@ More information can be found in
.Pp
Although some command-line options can be used with
.Nm named ,
-the name server's behaviour is controlled by its configuration file,
+the name server's behaviour is mainly controlled by its configuration file,
.Pa /etc/named.conf .
Refer to the BIND9 Administrator Reference Manual for further details.
.Pp
@@ -73,7 +73,7 @@ are as follows:
use
.Ar config-file
as the configuration file instead of the default,
-.Pa /etc/resolv.conf .
+.Pa /etc/named.conf .
.It Fl d
set the daemon's debug level to
.Ar debuglevel .
@@ -85,19 +85,21 @@ run
.Nm named
in the foreground.
.It Fl g
-also runs the name server in the foreground, but
-logs to
+run
+.Nm named
+in the foreground and force all logging to
.Dv stderr .
.It Fl n
-create threads that use
+create
.Ar #cpus
-CPUs if the hardware and software permits this.
-When
-.Ar #cpus
-is set to zero,
+worker threads to take advantage of multiple CPUs.
+If no option is given,
.Nm named
-will try to determine the number of CPUs present and use 1 if this
-attempt fails.
+will try to determine the number of CPUs present and create
+one thread per CPU. If
+.Nm named
+is unable to determine the number of CPUs, a single worker thread
+is created.
.It Fl p
listen for queries on port
.Ar port#
@@ -106,7 +108,7 @@ instead of the default port number, 53.
write memory usage statistics to
.Dv stdout
on exit.
-This option is only of interest
+This option is mainly of interest
to BIND9 developers and may be removed or changed in a future release.
.It Fl t
tells
@@ -121,11 +123,12 @@ as UID
.Ar user-id .
.Nm named
will change its UID after it has
-carried out any privileged operations, such as writing the PID file
-or creating a socket that listens on port number 53.
+carried out any privileged operations, such as
+creating sockets that listen on privileged ports.
.It Fl x
-load DNS data from
+load data from
.Ar cache-file .
+into the cache of the default view.
This option must not be used.
It is only of interest
to BIND9 developers and may be removed or changed in a future release.
@@ -143,15 +146,8 @@ A
or
.Dv SIGTERM
signal can be used to gracefully shut down the server.
-With the exception of
-.Dv SIGPIPE
-which
-.Nm named
-uses internally, sending any other signals to the name server
+Sending any other signals to the name server
will have an undefined outcome.
-The most likely result will be for the name server to terminate.
-It could hang because an internal deadlock was created when the name
-server took delivery of the signal.
.\".Sh CONFIGURATION FILE FORMAT
.\".Nm named 's
.\"configuration file is too complex to describe in detail here.
diff --git a/doc/man/bin/named.8 b/doc/man/bin/named.8
index d6eef1d892..51d464e943 100644
--- a/doc/man/bin/named.8
+++ b/doc/man/bin/named.8
@@ -14,7 +14,7 @@
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named.8,v 1.2 2000/06/28 02:51:46 jim Exp $
+.\" $Id: named.8,v 1.3 2000/07/12 02:07:32 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt NAMED 8
@@ -39,7 +39,7 @@ is the ISC implementation of an Internet domain name server.
See RFCs 1033, 1034, and 1035 for more information on the Internet
domain name system.
For historical reasons, the ISC's DNS software is known as BIND -
-Berkeley Internet Nameserver Distribution - because it was originally
+Berkeley Internet Name Daemon - because it was originally
supplied with BSD
.Ux
releases.
@@ -61,7 +61,7 @@ More information can be found in
.Pp
Although some command-line options can be used with
.Nm named ,
-the name server's behaviour is controlled by its configuration file,
+the name server's behaviour is mainly controlled by its configuration file,
.Pa /etc/named.conf .
Refer to the BIND9 Administrator Reference Manual for further details.
.Pp
@@ -73,7 +73,7 @@ are as follows:
use
.Ar config-file
as the configuration file instead of the default,
-.Pa /etc/resolv.conf .
+.Pa /etc/named.conf .
.It Fl d
set the daemon's debug level to
.Ar debuglevel .
@@ -85,19 +85,21 @@ run
.Nm named
in the foreground.
.It Fl g
-also runs the name server in the foreground, but
-logs to
+run
+.Nm named
+in the foreground and force all logging to
.Dv stderr .
.It Fl n
-create threads that use
+create
.Ar #cpus
-CPUs if the hardware and software permits this.
-When
-.Ar #cpus
-is set to zero,
+worker threads to take advantage of multiple CPUs.
+If no option is given,
.Nm named
-will try to determine the number of CPUs present and use 1 if this
-attempt fails.
+will try to determine the number of CPUs present and create
+one thread per CPU. If
+.Nm named
+is unable to determine the number of CPUs, a single worker thread
+is created.
.It Fl p
listen for queries on port
.Ar port#
@@ -106,7 +108,7 @@ instead of the default port number, 53.
write memory usage statistics to
.Dv stdout
on exit.
-This option is only of interest
+This option is mainly of interest
to BIND9 developers and may be removed or changed in a future release.
.It Fl t
tells
@@ -121,11 +123,12 @@ as UID
.Ar user-id .
.Nm named
will change its UID after it has
-carried out any privileged operations, such as writing the PID file
-or creating a socket that listens on port number 53.
+carried out any privileged operations, such as
+creating sockets that listen on privileged ports.
.It Fl x
-load DNS data from
+load data from
.Ar cache-file .
+into the cache of the default view.
This option must not be used.
It is only of interest
to BIND9 developers and may be removed or changed in a future release.
@@ -143,15 +146,8 @@ A
or
.Dv SIGTERM
signal can be used to gracefully shut down the server.
-With the exception of
-.Dv SIGPIPE
-which
-.Nm named
-uses internally, sending any other signals to the name server
+Sending any other signals to the name server
will have an undefined outcome.
-The most likely result will be for the name server to terminate.
-It could hang because an internal deadlock was created when the name
-server took delivery of the signal.
.\".Sh CONFIGURATION FILE FORMAT
.\".Nm named 's
.\"configuration file is too complex to describe in detail here.
From d8417b5f3406f4ace0f3bdb228b05a7b701976d6 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 05:06:33 +0000
Subject: [PATCH 037/226] added notes about dotted serial numbers and
unbalanced quotes
---
doc/misc/migration | 43 ++++++++++++++++++++++++++++++++++---------
1 file changed, 34 insertions(+), 9 deletions(-)
diff --git a/doc/misc/migration b/doc/misc/migration
index a5d290eebf..ab20894abb 100644
--- a/doc/misc/migration
+++ b/doc/misc/migration
@@ -10,16 +10,24 @@ there is still a number of caveats you should be aware of when
upgrading an existing BIND 8 installation to use BIND 9.
-Unimplemented Options and Changed Defaults
+1. Configuration File Compatibility
-Some BIND 8 configuration options are still unimplemented in BIND 9,
-and the default values of some options have changed. If your
-named.conf file uses an unimplemented option, named will log a warning
-message. A message is also logged about each option whose default has
-changed unless the option is set explicitly in named.conf.
+1.1. Unimplemented Options and Changed Defaults
+
+BIND 9.0.0 supports most, but not all but not of the named.conf
+options of BIND 8. Unimplemented options include those for selective
+(per-domain) forwarding, sortlists, statistics, and process limits;
+for a complete list, see doc/misc/options. We plan to implement most
+of these in in BIND 9.1.
+
+If your named.conf file uses an unimplemented option, named will log a
+warning message. A message is also logged about each option whose
+default has changed unless the option is set explicitly in named.conf.
-Strict RFC1035 Interpretation of TTLs in Zone Files
+2. Zone File Compatibility
+
+2.1. Strict RFC1035 Interpretation of TTLs in Zone Files
BIND 8 allowed you to omit all TTLs from a zone file, and used the
value of the SOA MINTTL field as a default for missing TTL values.
@@ -34,7 +42,24 @@ logged and loading the zone file fails.
To avoid problems, use a $TTL directive in each zone file.
-Interoperability Impact of New Query Features
+2.2. Periods in SOA Serial Numbers Deprecated
+
+Some versions of BIND allow SOA serial numbers with an embedded
+period, like "3.002", and convert them into integers in a rather
+unintuitive way. This feature is not supported by BIND 9; serial
+numbers must be integers.
+
+
+2.3. Handling of Unbalanced Quotes
+
+TXT records with unbalanced quotes, like 'host TXT "foo', were not
+treated as errors in some versions of BIND. If your zone files
+contain such records, you will get potentially confusing error
+messages like "unexpected end of file" because BIND 9 will interpret
+everything up to the next quote character as a literal string.
+
+
+3. Interoperability Impact of New Protocol Features
BIND 9 uses EDNS0 (RFC2671) to advertise its receive buffer size. It
also sets the AD bit in queries to indicate that it wishes to receive
@@ -54,4 +79,4 @@ completely. We have contacted the manufacturer of the name server in
case and are trying to resolve the issue with them.
-$Id: migration,v 1.1 2000/06/30 22:44:08 gson Exp $
+$Id: migration,v 1.2 2000/07/12 05:06:33 gson Exp $
From b9db5f75cf75029230bea6297f3512634472f288 Mon Sep 17 00:00:00 2001
From: Jim Reid
Date: Wed, 12 Jul 2000 13:49:07 +0000
Subject: [PATCH 038/226] fixed some typos and incorrect troff macro calls put
the text into our (as yet undocumented) manpage canonical format
---
bin/rndc/rndc.8 | 33 +++++++++++++++++++--------------
doc/man/bin/rndc.8 | 33 +++++++++++++++++++--------------
2 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/bin/rndc/rndc.8 b/bin/rndc/rndc.8
index 8185edf2a3..83c5646adb 100644
--- a/bin/rndc/rndc.8
+++ b/bin/rndc/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.4 2000/07/11 00:37:57 tale Exp $
+.\" $Id: rndc.8,v 1.5 2000/07/12 13:49:07 jim Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -54,7 +54,8 @@ and
the only supported encryption algorithm is HMAC-MD5, which uses a
shared secret on each end of the connection.
This provides TSIG-style authentication for the command request
-and the name server's response. All commands sent over the channel
+and the name server's response.
+All commands sent over the channel
must be signed by a key_id known to the server.
.Pp
.Nm rndc
@@ -62,8 +63,10 @@ reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-An alternate configuration file can be specified with the
-.Ar c
+.Ar config-file
+is the pathname for an alternate configuration file which can be supplied
+with the
+.Fl c
option.
.Pp
.Ar server
@@ -92,12 +95,13 @@ The
.Fl y
option identifies the
.Ar key_id
-to use from the configuration file. The
+to use from the configuration file.
.Ar key_id
must be known by
.Xr named
with the same algorithm and secret string in order for
-control message validation to succeed. If no
+control message validation to succeed.
+If no
.Fl y
option is provided,
.Nm rndc
@@ -111,12 +115,12 @@ statement is present for that host, then the
.Dv default-key
clause of the
.Dv options{}
-statement. Note that .Pp
-The configuration file for
+statement.
+Note that the configuration file for
.Nm rdnc
contains shared secrets which are used to send authenticated
-control commands to name servers, and should therefore not have
-general read or write access.
+control commands to name servers.
+It should therefore not have general read or write access.
.Pp
The
.Fl M ,
@@ -124,8 +128,8 @@ The
and
.Fl v
options provided debugging information and are primarily of interest
-only to the BIND 9 developers. They might be changed or removed in
-future releases.
+only to the BIND 9 developers.
+They might be changed or removed in future releases.
.Pp
The only valid value for
.Ar command
@@ -149,12 +153,13 @@ utility.
There is currently no way to provide the shared secret for a key_id
without using the configuration file.
.Pp
-Several error messages could be clearer. For example, trying to connect
+Several error messages could be clearer.
+For example, trying to connect
from an address that is not in the list of acceptable addresses
configured into
.Xr named
will result in the error message "end of file" when the server just
-unceremonisously closes the connection.
+unceremoniously closes the connection.
.Sh SEE ALSO
.Xr rndc.conf 5 ,
.Xr named 8 ,
diff --git a/doc/man/bin/rndc.8 b/doc/man/bin/rndc.8
index 8185edf2a3..83c5646adb 100644
--- a/doc/man/bin/rndc.8
+++ b/doc/man/bin/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.4 2000/07/11 00:37:57 tale Exp $
+.\" $Id: rndc.8,v 1.5 2000/07/12 13:49:07 jim Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -54,7 +54,8 @@ and
the only supported encryption algorithm is HMAC-MD5, which uses a
shared secret on each end of the connection.
This provides TSIG-style authentication for the command request
-and the name server's response. All commands sent over the channel
+and the name server's response.
+All commands sent over the channel
must be signed by a key_id known to the server.
.Pp
.Nm rndc
@@ -62,8 +63,10 @@ reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-An alternate configuration file can be specified with the
-.Ar c
+.Ar config-file
+is the pathname for an alternate configuration file which can be supplied
+with the
+.Fl c
option.
.Pp
.Ar server
@@ -92,12 +95,13 @@ The
.Fl y
option identifies the
.Ar key_id
-to use from the configuration file. The
+to use from the configuration file.
.Ar key_id
must be known by
.Xr named
with the same algorithm and secret string in order for
-control message validation to succeed. If no
+control message validation to succeed.
+If no
.Fl y
option is provided,
.Nm rndc
@@ -111,12 +115,12 @@ statement is present for that host, then the
.Dv default-key
clause of the
.Dv options{}
-statement. Note that .Pp
-The configuration file for
+statement.
+Note that the configuration file for
.Nm rdnc
contains shared secrets which are used to send authenticated
-control commands to name servers, and should therefore not have
-general read or write access.
+control commands to name servers.
+It should therefore not have general read or write access.
.Pp
The
.Fl M ,
@@ -124,8 +128,8 @@ The
and
.Fl v
options provided debugging information and are primarily of interest
-only to the BIND 9 developers. They might be changed or removed in
-future releases.
+only to the BIND 9 developers.
+They might be changed or removed in future releases.
.Pp
The only valid value for
.Ar command
@@ -149,12 +153,13 @@ utility.
There is currently no way to provide the shared secret for a key_id
without using the configuration file.
.Pp
-Several error messages could be clearer. For example, trying to connect
+Several error messages could be clearer.
+For example, trying to connect
from an address that is not in the list of acceptable addresses
configured into
.Xr named
will result in the error message "end of file" when the server just
-unceremonisously closes the connection.
+unceremoniously closes the connection.
.Sh SEE ALSO
.Xr rndc.conf 5 ,
.Xr named 8 ,
From e9729674d69e6f120c7fbaeda0e82830f82a6a5d Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Wed, 12 Jul 2000 15:33:41 +0000
Subject: [PATCH 039/226] don't warn about missing keys{} clause or non-inet
type, since the config parser will have already warned about that.
---
bin/named/omapiconf.c | 44 ++++++++++++-------------------------------
1 file changed, 12 insertions(+), 32 deletions(-)
diff --git a/bin/named/omapiconf.c b/bin/named/omapiconf.c
index 051f499e15..0f4e0e18a1 100644
--- a/bin/named/omapiconf.c
+++ b/bin/named/omapiconf.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapiconf.c,v 1.6 2000/07/11 23:02:32 tale Exp $ */
+/* $Id: omapiconf.c,v 1.7 2000/07/12 15:33:41 tale Exp $ */
/*
* Principal Author: DCL
@@ -443,42 +443,22 @@ ns_omapi_configure(isc_mem_t *mctx, dns_c_ctx_t *cctx,
for (control = dns_c_ctrllist_head(controls);
control != NULL;
control = dns_c_ctrl_next(control)) {
- if (keydeflist == NULL)
+ /*
+ * The parser handles BIND 8 configuration file syntax,
+ * so it allows a control_type of dns_c_unix_control,
+ * as well as an inet phrase with no keys{} clause.
+ * However, it already warned that those were
+ * unsupported, so there is no need to do so again.
+ * The keydeflist == NULL case was already warned
+ * about a few lines above.
+ */
+ if (control->control_type != dns_c_inet_control ||
+ keydeflist == NULL || control->keyidlist == NULL)
continue;
- if (control->control_type != dns_c_inet_control) {
- /*
- * The only other type coming out of the
- * configuration system is dns_c_unix_control.
- */
- isc_log_write(ns_g_lctx,
- ISC_LOGCATEGORY_GENERAL,
- NS_LOGMODULE_OMAPI,
- ISC_LOG_WARNING,
- "unix control channel type is "
- "not supported");
- continue;
- }
-
isc_sockaddr_format(&control->u.inet_v.addr,
socktext, sizeof(socktext));
- /*
- * XXXDCL confparser.y currently allows the keys clause
- * to be absent, which is pointless. it needs to be
- * required.
- */
- if (control->keyidlist == NULL) {
- isc_log_write(ns_g_lctx,
- ISC_LOGCATEGORY_GENERAL,
- NS_LOGMODULE_OMAPI,
- ISC_LOG_WARNING,
- "missing keys clause for "
- "control channel %s",
- socktext);
- continue;
- }
-
isc_log_write(ns_g_lctx, ISC_LOGCATEGORY_GENERAL,
NS_LOGMODULE_OMAPI, ISC_LOG_DEBUG(9),
"processing control channel %s",
From 8af589aea39af11339c317259b88b5e666e55ca0 Mon Sep 17 00:00:00 2001
From: James Brister
Date: Wed, 12 Jul 2000 15:36:09 +0000
Subject: [PATCH 040/226] It's no longer a fatal error if a keys{} clause is
missing on a control channel definition, nor if the keys{} clause is empty.
Warnings are issued.
---
lib/dns/config/confctl.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/dns/config/confctl.c b/lib/dns/config/confctl.c
index bf60f4f468..d1f6465bd5 100644
--- a/lib/dns/config/confctl.c
+++ b/lib/dns/config/confctl.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confctl.c,v 1.25 2000/07/11 19:09:02 brister Exp $ */
+/* $Id: confctl.c,v 1.26 2000/07/12 15:36:09 brister Exp $ */
#include
@@ -144,16 +144,13 @@ dns_c_ctrl_validate(dns_c_ctrl_t *ctrl)
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
"the KEYS clause of an INET control "
"channel must be used");
- result = ISC_R_FAILURE;
} else if (dns_c_kidlist_keycount(ctrl->keyidlist) == 0) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
"the KEYS clause of an INET control "
"channel must not be empty");
- result = ISC_R_FAILURE;
}
-
return (result);
}
From 4034406393893f4d07ab07b56da3541155493855 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 15:55:10 +0000
Subject: [PATCH 041/226] inet control channels are supported, unix ones are
not
---
doc/misc/options | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/doc/misc/options b/doc/misc/options
index 68405a3035..dfe3b8a633 100644
--- a/doc/misc/options
+++ b/doc/misc/options
@@ -1,7 +1,7 @@
Copyright (C) 2000 Internet Software Consortium.
See COPYRIGHT in the source root or http://www.isc.org/copyright for terms.
-$Id: options,v 1.30 2000/07/10 22:13:17 gson Exp $
+$Id: options,v 1.31 2000/07/12 15:55:10 gson Exp $
This is a summary of the implementation status of the various named.conf
options in BIND 9.
@@ -111,7 +111,10 @@ key Yes
logging Yes
-controls Yes
+controls {
+ [ inet ... ] Yes%
+ [ unix ... ] Obsolete
+};
server ip_addr {
[ bogus yes_or_no; ] No
From 2c24bbb10b479cc7024defc208bca74c7389f756 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 16:17:38 +0000
Subject: [PATCH 042/226] clarified warning messages
---
lib/dns/config/confctl.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/dns/config/confctl.c b/lib/dns/config/confctl.c
index d1f6465bd5..22567d7e83 100644
--- a/lib/dns/config/confctl.c
+++ b/lib/dns/config/confctl.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: confctl.c,v 1.26 2000/07/12 15:36:09 brister Exp $ */
+/* $Id: confctl.c,v 1.27 2000/07/12 16:17:38 gson Exp $ */
#include
@@ -137,18 +137,18 @@ dns_c_ctrl_validate(dns_c_ctrl_t *ctrl)
if (ctrl->control_type == dns_c_unix_control) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
- "unix sockets are not not implmented for"
- " control channels");
+ "type 'unix' control channels are "
+ "not implemented");
} else if (ctrl->keyidlist == NULL) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
- "the KEYS clause of an INET control "
- "channel must be used");
+ "type 'inet' control channel has no 'keys' "
+ "clause; control channel will be disabled");
} else if (dns_c_kidlist_keycount(ctrl->keyidlist) == 0) {
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
- "the KEYS clause of an INET control "
- "channel must not be empty");
+ "type 'inet' control channel has no keys; "
+ "control channel will be disabled");
}
return (result);
From 2831bea28e254c0691fa938fd1325d40f7341508 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Wed, 12 Jul 2000 16:43:03 +0000
Subject: [PATCH 043/226] make rndc output appear as I: lines
---
bin/tests/system/views/tests.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/tests/system/views/tests.sh b/bin/tests/system/views/tests.sh
index 29ea2c138f..24167f8399 100644
--- a/bin/tests/system/views/tests.sh
+++ b/bin/tests/system/views/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.17 2000/07/10 11:39:46 tale Exp $
+# $Id: tests.sh,v 1.18 2000/07/12 16:43:03 tale Exp $
#
# Perform tests
@@ -44,8 +44,8 @@ cp ns2/example2.db ns2/example.db
echo "I:sleeping five seconds then reloading ns2 and ns3 with rndc"
sleep 5
-$RNDC -c rndc.conf -s 10.53.0.2 -p 9953 reload
-$RNDC -c rndc.conf -s 10.53.0.3 -p 9953 reload
+$RNDC -c rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
+$RNDC -c rndc.conf -s 10.53.0.3 -p 9953 reload 2>&1 | sed 's/^/I:ns3 /'
echo "I:sleeping one minute"
sleep 60
From 00148ffb6beab48b15755841d728abbacc1461ba Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 16:48:19 +0000
Subject: [PATCH 044/226] reviewed; made minor stylistic changes
---
bin/rndc/rndc.8 | 16 +++++++---------
doc/man/bin/rndc.8 | 16 +++++++---------
2 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/bin/rndc/rndc.8 b/bin/rndc/rndc.8
index 83c5646adb..5518d13d81 100644
--- a/bin/rndc/rndc.8
+++ b/bin/rndc/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.5 2000/07/12 13:49:07 jim Exp $
+.\" $Id: rndc.8,v 1.6 2000/07/12 16:48:19 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -45,8 +45,8 @@ prints a short summary of the supported commands and the available
options and their arguments.
.Pp
.Nm rndc
-uses a secure channel with digital signatures to communicate
-with the name server.
+communicates with the name server over a TCP connection,
+sending commands authenticated with digital signatures.
In the current versions of
.Nm rndc
and
@@ -63,11 +63,9 @@ reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-.Ar config-file
-is the pathname for an alternate configuration file which can be supplied
-with the
+The
.Fl c
-option.
+option can be used to specify an alternate configuration file.
.Pp
.Ar server
is the name or address of the server which matches a
@@ -84,7 +82,7 @@ statement of the configuration file will be used.
.Pp
The
.Fl p
-option is used to make
+option can be used to make
.Nm rndc
send commands to TCP port number
.Ar port#
@@ -158,7 +156,7 @@ For example, trying to connect
from an address that is not in the list of acceptable addresses
configured into
.Xr named
-will result in the error message "end of file" when the server just
+will result in the error message "end of file" when the server
unceremoniously closes the connection.
.Sh SEE ALSO
.Xr rndc.conf 5 ,
diff --git a/doc/man/bin/rndc.8 b/doc/man/bin/rndc.8
index 83c5646adb..5518d13d81 100644
--- a/doc/man/bin/rndc.8
+++ b/doc/man/bin/rndc.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.5 2000/07/12 13:49:07 jim Exp $
+.\" $Id: rndc.8,v 1.6 2000/07/12 16:48:19 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC 8
@@ -45,8 +45,8 @@ prints a short summary of the supported commands and the available
options and their arguments.
.Pp
.Nm rndc
-uses a secure channel with digital signatures to communicate
-with the name server.
+communicates with the name server over a TCP connection,
+sending commands authenticated with digital signatures.
In the current versions of
.Nm rndc
and
@@ -63,11 +63,9 @@ reads its default configuration file,
.Pa /etc/rndc.conf
to determine how to contact the name server and decide what algorithm
and keys is should use.
-.Ar config-file
-is the pathname for an alternate configuration file which can be supplied
-with the
+The
.Fl c
-option.
+option can be used to specify an alternate configuration file.
.Pp
.Ar server
is the name or address of the server which matches a
@@ -84,7 +82,7 @@ statement of the configuration file will be used.
.Pp
The
.Fl p
-option is used to make
+option can be used to make
.Nm rndc
send commands to TCP port number
.Ar port#
@@ -158,7 +156,7 @@ For example, trying to connect
from an address that is not in the list of acceptable addresses
configured into
.Xr named
-will result in the error message "end of file" when the server just
+will result in the error message "end of file" when the server
unceremoniously closes the connection.
.Sh SEE ALSO
.Xr rndc.conf 5 ,
From 94b74284684fc3586fe4256100639dfdd9c1a20b Mon Sep 17 00:00:00 2001
From: Jim Reid
Date: Wed, 12 Jul 2000 17:17:03 +0000
Subject: [PATCH 045/226] first drafts of the nsupdate and host man pages
---
bin/dig/host.1 | 218 +++++++++++++++++++++++++++++
bin/nsupdate/nsupdate.8 | 301 ++++++++++++++++++++++++++++++++++++++++
doc/man/bin/host.1 | 218 +++++++++++++++++++++++++++++
doc/man/bin/nsupdate.8 | 301 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 1038 insertions(+)
create mode 100644 bin/dig/host.1
create mode 100644 bin/nsupdate/nsupdate.8
create mode 100644 doc/man/bin/host.1
create mode 100644 doc/man/bin/nsupdate.8
diff --git a/bin/dig/host.1 b/bin/dig/host.1
new file mode 100644
index 0000000000..14d1497645
--- /dev/null
+++ b/bin/dig/host.1
@@ -0,0 +1,218 @@
+.\" Copyright (C) @YEARS@ Internet Software Consortium.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+.\" SOFTWARE.
+.\"
+.\" $Id: host.1,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\"
+.Dd Jun 30, 2000
+.Dt HOST 1
+.Os BIND9 9
+.ds vT BIND9 Programmer's Manual
+.Sh NAME
+.Nm host
+.Nd DNS lookup utility
+.Sh SYNOPSIS
+.Nm host
+.Op Fl aCdlrTwv
+.Op Fl c Ar class
+.Op Fl N Ar ndots
+.Op Fl R Ar number
+.Op Fl t Ar type
+.Op Fl W Ar wait
+.Ar name
+.Op Ar server
+.Sh DESCRIPTION
+.Nm host
+is a simple utility for performing DNS lookups.
+It is normally used to convert names to IP addresses and vice versa.
+When no arguments or options are given,
+.Nm host
+prints a short summary of its command line arguments and options.
+.Pp
+.Ar name
+is the domain name that is to be looked up.
+It can also be a dotted-decimal string representing an IPv4 address,
+in which case
+.Nm host
+will by default perform a reverse lookup for that address.
+.Ar server
+is an optional argument which is either the name or IP address of the
+name server that
+.Nm host
+should query instead of the server or servers listed in
+.Pa /etc/resolv.conf .
+.Pp
+The
+.Fl a
+(all) option is equivalent to setting the
+.Fl v
+option and asking
+.Nm host
+to make a query of type ANY.
+.Pp
+When the
+.Fl C
+option is used,
+.Nm host
+will attempt to display the SOA records for zone
+.Ar name
+from all the listed authoritative name servers for that zone.
+The list of name servers is defined by the NS records that are found for
+the zone.
+.Pp
+The
+.Fl c
+option instructs to make a DNS query of class
+.Ar class .
+This can be used to lookup Hesiod or Chaosnet class resource records.
+The default class is IN: Internet.
+.Pp
+Verbose output is generated by
+.Nm host
+when the
+.Fl d
+or
+.Fl v
+option is used.
+The two options are equivalent.
+They have been provided for backwards compatibility.
+In previous versions, the
+.Fl d
+option switched on debugging traces and
+.Fl v
+enabled verbose output.
+.Pp
+List mode is selected by the
+.Fl l
+option.
+This makes
+.Nm host
+perform a zone transfer for zone
+.Ar name .
+The argument is provided for compatibility with older implemementations.
+This option is equivalent to making a query of type AXFR.
+.Pp
+The
+.Fl N
+option sets the number of dots that have to be in
+.Ar name
+before the root name servers are queried for that name.
+The default number of dots is zero.
+Unlike previous versions of
+.Nm host ,
+the BIND9 implementation does not append domain names from the
+.Dv domain
+or
+.Dv search
+directives in
+.Pa /etc/resolv.conf .
+Therefore
+.Ar name
+should be a fully-qualified domain name.
+.Pp
+The number of UDP retries for a lookup can be changed with the
+.Fl R
+option.
+.Ar number
+indicates how many times
+.Nm host
+will repeat a query that does not get answered.
+The default number of retries is 1.
+If
+.Ar number
+is negative or zero, the number of retries will default to 1.
+.Pp
+Non-recursive queries can be made via the
+.Fl r
+option.
+Setting this option clears the
+.Dv RD
+- recursion desired - bit in the query which
+.Nm host
+makes.
+This should mean that the name server receiving the query will not attemp
+to resolve
+.Ar name .
+The
+.Fl r
+option enables
+.Nm host
+to mimic the behaviour of a name server by making non-recursive queries
+and expecting to receive answers to those queries that are usually
+referrals to other name servers.
+.Pp
+By default
+.Nm host
+uses UDP when making queries.
+The
+.Fl T
+option makes it use a TCP connection when querying the name server.
+TCP queries will be automatically made when the query type requires
+that a TCP connection: zone transfer (AXFR) requests for example.
+.Pp
+The
+.Fl t
+option is used to select the query type.
+.Ar type
+can be any recognised query type: CNAME, NS, SOA, SIG, KEY, AXFR, etc.
+When no query type is specified,
+.Nm host
+automatically selects an appropriate query type.
+By default it looks for A records unless the
+.Fl C
+option is supplied or
+.Ar name
+is a dotted-decimal IPv4 address.
+These will make
+.Nm host
+look for SOA and PTR records respectively.
+.Pp
+The time to wait for a reply can be controlled through the
+.Fl W
+and
+.Fl w
+options.
+The
+.Fl W
+option makes
+.Nm host
+wait for
+.Ar wait
+seconds.
+If
+.Ar wait
+is less than one,
+the wait interval is set to one second.
+When the
+.Fl w
+option is used,
+.Nm host
+will effectively wait forever for a reply.
+The time to wait for a response will be set to the number of seconds
+given by the hardware's maximum value for an integer quantity.
+.Sh FILES
+.Pa /etc/resolv.conf
+.Sh SEE ALSO
+.Xr dig 1 ,
+.Xr resolver 5
+.Xr named 8 .
+.Sh BUGS
+.Nm host
+does not yet know how to handle command line arguments that are IPv6
+addresses, even though the record types for those addresses are
+fully supported by the BIND9 DNS library.
+.Pp
+Apart from this self-contradicting sentence, the
+.Fl D
+option is undocumented.
diff --git a/bin/nsupdate/nsupdate.8 b/bin/nsupdate/nsupdate.8
new file mode 100644
index 0000000000..75b1205c2a
--- /dev/null
+++ b/bin/nsupdate/nsupdate.8
@@ -0,0 +1,301 @@
+.\" Copyright (C) @YEARS@ Internet Software Consortium.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+.\" SOFTWARE.
+.\"
+.\" $Id: nsupdate.8,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\"
+.Dd Jun 30, 2000
+.Dt NSUPDATE 8
+.Os BIND9 9
+.ds vT BIND9 Programmer's Manual
+.Sh NAME
+.Nm nsupdate
+.Nd Dynamic DNS update utility
+.Sh SYNOPSIS
+.Nm nsupdate
+.Op Fl d
+.Oo
+.Fl y Ar keyname:secret |
+.Fl k Ar keyfile
+.Oc
+.Op Fl v
+.Sh DESCRIPTION
+.Nm nsupdate
+is used to submit Dynamic DNS Update requests as defined in RFC2136
+to a name server.
+This allows resource records to be added or removed from a zone
+without manually editing the zone file.
+A single update request could contain requests to add or remove more than one
+resource record.
+.Pp
+Zones that are under dynamic control via
+.Nm nsupdate
+or a DHCP server should not be edited by hand.
+Manual edits could
+conflict with dynamic updates or the name server's transaction log
+activities which keep the file copy of the zone consistent with its
+internal representation in the name server's memory.
+.Pp
+The names of resource records that are dynamically added or removed with
+.Nm nsupdate
+have to be in the same zone.
+Requests are sent to the zone's master server.
+This is identified by the MNAME field of the zone's SOA record.
+.Pp
+The
+.Fl d
+option makes
+.Nm nsupdate
+operate in debug mode.
+This provides tracing information about the update requests that are
+made and the replies received from the name server.
+.Pp
+Transaction signatures can be used to authenticate the Dynamic DNS
+updates.
+These use the TSIG resource record type described in RFC2845.
+The signatures rely on a shared secret that should only be known to
+.Nm nsupdate
+and the name server.
+Currently, the only supported encryption algorithm for TSIG is
+HMAC-MD5, which is defined in RFC 2104.
+Once other algorithms are defined for TSIG, applications will need to
+ensure they select the appropriate algorithm as well as the key when
+authenticating each other.
+Suitable
+.Dv key{}
+and
+.Dv server{}
+statements will be added to
+.Pa /etc/named.conf
+so that the appropriate secret key and algorithm can be associated
+with the IP address of the
+client application that will be using TSIG authentication.
+.Pp
+.Nm nsupdate
+uses the
+.Fl y
+and
+.Fl k
+options to provide the shared secret needed to generate a TSIG record
+for authenticating Dynamic DNS update requests.
+These options are mutually exclusive.
+The
+.Fl k
+option gets
+.Nm nsupdate
+to read the shared secret from the file
+.Ar keyfile .
+When the
+.Fl y
+is used, a signature is generated from
+.Ar keyname:secret.
+.Ar keyname
+is the name of the key,
+and
+.Ar secret
+is a string comprising the shared secret.
+Use of the
+.Fl y
+option is discouraged because the shared secret is supplied as a command
+line argument in clear text.
+This may be visible in the output from
+.Xr ps 1
+or in a history file maintained by the user's shell.
+.Pp
+By default
+.Nm nsupdate
+uses UDP to send update requests to the name server.
+The
+.Fl v
+option makes
+.Nm nsupdate
+use a TCP connection.
+This may be preferable when a batch of update requests are made.
+.Sh INPUT FORMAT
+.Nm nsupdate
+reads commands from its standard input.
+Each command is supplied on exactly one line of input.
+Commands can be update instructions or prerequisite checks on the
+contents of the zone.
+These checks set conditions that some name or set of
+resource records (RRset) either exists or is absent from the zone.
+These conditions must be met if the entire update request is to succeed.
+Updates will be rejected if the tests for the prerequisite conditions fail.
+Every update request consists of zero or more prerequisites
+and one or more updates.
+This allows a suitably authenticated update request to proceed if some
+specified resource records are present or missing from the zone.
+A blank input line causes the accumulated commands to be sent as one Dynamic
+DNS update request to the name server.
+.Pp
+The command formats and their meaning are as follows:
+.Bl -ohang indent
+.It Xo
+.Ic prereq nxdomain Va domain-name
+.Xc
+.sp 1
+Requires that no resource record of any type exists with name
+.Va domain-name .
+.It Xo
+.Ic prereq yxdomain Va domain-name
+.Xc
+.sp 1
+Requires that
+.Va domain-name
+exists as at least one resource record of any type.
+.It Xo
+.Ic prereq nxrrset Va domain-name Op class
+.Va type
+.Xc
+.sp 1
+Requires that no resource record exists of the specified
+.Va type ,
+.Va class
+and
+.Va domain-name .
+If
+.Va class
+is omitted, IN (internet) is assumed.
+.It Xo
+.Ic prereq yxrrset
+.Va domain-name Op class
+.Va type Op data...
+.Xc
+.sp 1
+This requires that a resource record of the specified type
+.Va type ,
+.Va class
+and name
+.Va domain-name
+must exist.
+If
+.Va class
+is omitted, IN (internet) is assumed.
+If
+.Va data
+is supplied, it has to exactly match the corresponding RDATA for
+.Va name .
+.Va data
+is written in the standard text representation of the resource record's
+RDATA.
+.It Xo
+.Ic update delete
+.Va domain-name Op class
+.Va Op type Op data...
+.Xc
+.sp 1
+Deletes any resource records named
+.Va domain-name .
+If
+.Va type
+and
+.Va data
+is provided, only matching resource records will be removed.
+The internet class is assumed if
+.Va class
+is not supplied.
+.It Xo
+.Ic update add
+.Va domain-name ttl Op class
+.Va type data..
+.Xc
+.sp 1
+Adds a new resource record with the specified
+.Va ttl ,
+.Va class
+and
+.Va data .
+.El
+.Sh EXAMPLES
+The examples below show how
+.Nm nsupdate
+could be used to insert and delete resource records from the
+.Dv example.com
+zone.
+Notice that the input in each example contains a trailing blank line so that
+a group of commands are sent as one dynamic update request to the
+master name server for
+.Dv example.com .
+.Bd -literal -offset indent
+# nsupdate
+> update delete oldhost.example.com A
+> update add newhost.example.com 86400 A 172.16.1.1
+>
+.Ed
+.Pp
+Any A records for
+.Dv oldhost.example.com
+are deleted.
+and an A record for
+.Dv newhost.example.com
+it IP address 172.16.1.1 is added.
+The newly-added record has a 1 day TTL (86400 seconds)
+.Bd -literal -offset indent
+# nsupdate
+> prereq nxdomain nickname.example.com
+> update add nickname.example.com CNAME somehost.example.com
+>
+.Ed
+.Pp
+The prerequisite condition gets the name server to check that there
+are no resource records of any type for
+.Dv nickname.example.com .
+If there are, the update request fails.
+If this name does not exist, a CNAME for it is added.
+This ensures that when the CNAME is added, it cannot conflict with the
+long-standing rule in RFC1034 that a name must not exist as any other
+record type if it exists as a CNAME.
+(The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
+SIG, KEY and NXT records.)
+.Sh NAME SERVER PROCESSING
+.Pp
+When a successful update request is made, the BIND9 name server
+increments the serial number in the zone's SOA record.
+A transaction log file is written containing details of the resource
+records that have been added or removed.
+This allows the name server to roll forward to the current state of the
+zone if it is restarted before a fresh copy of the zone file is written
+out by the name server.
+XXXJR WHEN DOES IT DO THAT???
+It then sends a NOTIFY message to the zone's slave servers to inform
+them that the zone's contents have changed.
+.Sh FILES
+.Bl -tag -width Kname.+157.+{random}.private -compact
+.It Pa /etc/named.conf
+name server configuration file
+.It Pa Kname.+157.+{random}.key
+base-64 encoding of HMAC-MD5 key created by
+.Xr dnssec-keygen 8 .
+.It Pa Kname.+157.+{random}.private
+base-64 encoding of HMAC-MD5 key created by
+.Xr dnssec-keygen 8 .
+.El
+.Sh SEE ALSO
+.Xr RFC2136 ,
+.Xr RFC2137 ,
+.Xr RFC2104 ,
+.Xr RFC2845 ,
+.Xr RFC1034 ,
+.Xr RFC2535 ,
+.Xr named 8 ,
+.Xr dnssec-keygen 8 .
+.Sh BUGS
+The
+.Fl D
+and
+.Fl M
+options are not documented apart from this self-referential paragraph.
+They provide additional debugging information which is primarily of interest
+to the BIND9 developers.
+These options might be changed or removed in future releases.
diff --git a/doc/man/bin/host.1 b/doc/man/bin/host.1
new file mode 100644
index 0000000000..14d1497645
--- /dev/null
+++ b/doc/man/bin/host.1
@@ -0,0 +1,218 @@
+.\" Copyright (C) @YEARS@ Internet Software Consortium.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+.\" SOFTWARE.
+.\"
+.\" $Id: host.1,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\"
+.Dd Jun 30, 2000
+.Dt HOST 1
+.Os BIND9 9
+.ds vT BIND9 Programmer's Manual
+.Sh NAME
+.Nm host
+.Nd DNS lookup utility
+.Sh SYNOPSIS
+.Nm host
+.Op Fl aCdlrTwv
+.Op Fl c Ar class
+.Op Fl N Ar ndots
+.Op Fl R Ar number
+.Op Fl t Ar type
+.Op Fl W Ar wait
+.Ar name
+.Op Ar server
+.Sh DESCRIPTION
+.Nm host
+is a simple utility for performing DNS lookups.
+It is normally used to convert names to IP addresses and vice versa.
+When no arguments or options are given,
+.Nm host
+prints a short summary of its command line arguments and options.
+.Pp
+.Ar name
+is the domain name that is to be looked up.
+It can also be a dotted-decimal string representing an IPv4 address,
+in which case
+.Nm host
+will by default perform a reverse lookup for that address.
+.Ar server
+is an optional argument which is either the name or IP address of the
+name server that
+.Nm host
+should query instead of the server or servers listed in
+.Pa /etc/resolv.conf .
+.Pp
+The
+.Fl a
+(all) option is equivalent to setting the
+.Fl v
+option and asking
+.Nm host
+to make a query of type ANY.
+.Pp
+When the
+.Fl C
+option is used,
+.Nm host
+will attempt to display the SOA records for zone
+.Ar name
+from all the listed authoritative name servers for that zone.
+The list of name servers is defined by the NS records that are found for
+the zone.
+.Pp
+The
+.Fl c
+option instructs to make a DNS query of class
+.Ar class .
+This can be used to lookup Hesiod or Chaosnet class resource records.
+The default class is IN: Internet.
+.Pp
+Verbose output is generated by
+.Nm host
+when the
+.Fl d
+or
+.Fl v
+option is used.
+The two options are equivalent.
+They have been provided for backwards compatibility.
+In previous versions, the
+.Fl d
+option switched on debugging traces and
+.Fl v
+enabled verbose output.
+.Pp
+List mode is selected by the
+.Fl l
+option.
+This makes
+.Nm host
+perform a zone transfer for zone
+.Ar name .
+The argument is provided for compatibility with older implemementations.
+This option is equivalent to making a query of type AXFR.
+.Pp
+The
+.Fl N
+option sets the number of dots that have to be in
+.Ar name
+before the root name servers are queried for that name.
+The default number of dots is zero.
+Unlike previous versions of
+.Nm host ,
+the BIND9 implementation does not append domain names from the
+.Dv domain
+or
+.Dv search
+directives in
+.Pa /etc/resolv.conf .
+Therefore
+.Ar name
+should be a fully-qualified domain name.
+.Pp
+The number of UDP retries for a lookup can be changed with the
+.Fl R
+option.
+.Ar number
+indicates how many times
+.Nm host
+will repeat a query that does not get answered.
+The default number of retries is 1.
+If
+.Ar number
+is negative or zero, the number of retries will default to 1.
+.Pp
+Non-recursive queries can be made via the
+.Fl r
+option.
+Setting this option clears the
+.Dv RD
+- recursion desired - bit in the query which
+.Nm host
+makes.
+This should mean that the name server receiving the query will not attemp
+to resolve
+.Ar name .
+The
+.Fl r
+option enables
+.Nm host
+to mimic the behaviour of a name server by making non-recursive queries
+and expecting to receive answers to those queries that are usually
+referrals to other name servers.
+.Pp
+By default
+.Nm host
+uses UDP when making queries.
+The
+.Fl T
+option makes it use a TCP connection when querying the name server.
+TCP queries will be automatically made when the query type requires
+that a TCP connection: zone transfer (AXFR) requests for example.
+.Pp
+The
+.Fl t
+option is used to select the query type.
+.Ar type
+can be any recognised query type: CNAME, NS, SOA, SIG, KEY, AXFR, etc.
+When no query type is specified,
+.Nm host
+automatically selects an appropriate query type.
+By default it looks for A records unless the
+.Fl C
+option is supplied or
+.Ar name
+is a dotted-decimal IPv4 address.
+These will make
+.Nm host
+look for SOA and PTR records respectively.
+.Pp
+The time to wait for a reply can be controlled through the
+.Fl W
+and
+.Fl w
+options.
+The
+.Fl W
+option makes
+.Nm host
+wait for
+.Ar wait
+seconds.
+If
+.Ar wait
+is less than one,
+the wait interval is set to one second.
+When the
+.Fl w
+option is used,
+.Nm host
+will effectively wait forever for a reply.
+The time to wait for a response will be set to the number of seconds
+given by the hardware's maximum value for an integer quantity.
+.Sh FILES
+.Pa /etc/resolv.conf
+.Sh SEE ALSO
+.Xr dig 1 ,
+.Xr resolver 5
+.Xr named 8 .
+.Sh BUGS
+.Nm host
+does not yet know how to handle command line arguments that are IPv6
+addresses, even though the record types for those addresses are
+fully supported by the BIND9 DNS library.
+.Pp
+Apart from this self-contradicting sentence, the
+.Fl D
+option is undocumented.
diff --git a/doc/man/bin/nsupdate.8 b/doc/man/bin/nsupdate.8
new file mode 100644
index 0000000000..75b1205c2a
--- /dev/null
+++ b/doc/man/bin/nsupdate.8
@@ -0,0 +1,301 @@
+.\" Copyright (C) @YEARS@ Internet Software Consortium.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+.\" SOFTWARE.
+.\"
+.\" $Id: nsupdate.8,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\"
+.Dd Jun 30, 2000
+.Dt NSUPDATE 8
+.Os BIND9 9
+.ds vT BIND9 Programmer's Manual
+.Sh NAME
+.Nm nsupdate
+.Nd Dynamic DNS update utility
+.Sh SYNOPSIS
+.Nm nsupdate
+.Op Fl d
+.Oo
+.Fl y Ar keyname:secret |
+.Fl k Ar keyfile
+.Oc
+.Op Fl v
+.Sh DESCRIPTION
+.Nm nsupdate
+is used to submit Dynamic DNS Update requests as defined in RFC2136
+to a name server.
+This allows resource records to be added or removed from a zone
+without manually editing the zone file.
+A single update request could contain requests to add or remove more than one
+resource record.
+.Pp
+Zones that are under dynamic control via
+.Nm nsupdate
+or a DHCP server should not be edited by hand.
+Manual edits could
+conflict with dynamic updates or the name server's transaction log
+activities which keep the file copy of the zone consistent with its
+internal representation in the name server's memory.
+.Pp
+The names of resource records that are dynamically added or removed with
+.Nm nsupdate
+have to be in the same zone.
+Requests are sent to the zone's master server.
+This is identified by the MNAME field of the zone's SOA record.
+.Pp
+The
+.Fl d
+option makes
+.Nm nsupdate
+operate in debug mode.
+This provides tracing information about the update requests that are
+made and the replies received from the name server.
+.Pp
+Transaction signatures can be used to authenticate the Dynamic DNS
+updates.
+These use the TSIG resource record type described in RFC2845.
+The signatures rely on a shared secret that should only be known to
+.Nm nsupdate
+and the name server.
+Currently, the only supported encryption algorithm for TSIG is
+HMAC-MD5, which is defined in RFC 2104.
+Once other algorithms are defined for TSIG, applications will need to
+ensure they select the appropriate algorithm as well as the key when
+authenticating each other.
+Suitable
+.Dv key{}
+and
+.Dv server{}
+statements will be added to
+.Pa /etc/named.conf
+so that the appropriate secret key and algorithm can be associated
+with the IP address of the
+client application that will be using TSIG authentication.
+.Pp
+.Nm nsupdate
+uses the
+.Fl y
+and
+.Fl k
+options to provide the shared secret needed to generate a TSIG record
+for authenticating Dynamic DNS update requests.
+These options are mutually exclusive.
+The
+.Fl k
+option gets
+.Nm nsupdate
+to read the shared secret from the file
+.Ar keyfile .
+When the
+.Fl y
+is used, a signature is generated from
+.Ar keyname:secret.
+.Ar keyname
+is the name of the key,
+and
+.Ar secret
+is a string comprising the shared secret.
+Use of the
+.Fl y
+option is discouraged because the shared secret is supplied as a command
+line argument in clear text.
+This may be visible in the output from
+.Xr ps 1
+or in a history file maintained by the user's shell.
+.Pp
+By default
+.Nm nsupdate
+uses UDP to send update requests to the name server.
+The
+.Fl v
+option makes
+.Nm nsupdate
+use a TCP connection.
+This may be preferable when a batch of update requests are made.
+.Sh INPUT FORMAT
+.Nm nsupdate
+reads commands from its standard input.
+Each command is supplied on exactly one line of input.
+Commands can be update instructions or prerequisite checks on the
+contents of the zone.
+These checks set conditions that some name or set of
+resource records (RRset) either exists or is absent from the zone.
+These conditions must be met if the entire update request is to succeed.
+Updates will be rejected if the tests for the prerequisite conditions fail.
+Every update request consists of zero or more prerequisites
+and one or more updates.
+This allows a suitably authenticated update request to proceed if some
+specified resource records are present or missing from the zone.
+A blank input line causes the accumulated commands to be sent as one Dynamic
+DNS update request to the name server.
+.Pp
+The command formats and their meaning are as follows:
+.Bl -ohang indent
+.It Xo
+.Ic prereq nxdomain Va domain-name
+.Xc
+.sp 1
+Requires that no resource record of any type exists with name
+.Va domain-name .
+.It Xo
+.Ic prereq yxdomain Va domain-name
+.Xc
+.sp 1
+Requires that
+.Va domain-name
+exists as at least one resource record of any type.
+.It Xo
+.Ic prereq nxrrset Va domain-name Op class
+.Va type
+.Xc
+.sp 1
+Requires that no resource record exists of the specified
+.Va type ,
+.Va class
+and
+.Va domain-name .
+If
+.Va class
+is omitted, IN (internet) is assumed.
+.It Xo
+.Ic prereq yxrrset
+.Va domain-name Op class
+.Va type Op data...
+.Xc
+.sp 1
+This requires that a resource record of the specified type
+.Va type ,
+.Va class
+and name
+.Va domain-name
+must exist.
+If
+.Va class
+is omitted, IN (internet) is assumed.
+If
+.Va data
+is supplied, it has to exactly match the corresponding RDATA for
+.Va name .
+.Va data
+is written in the standard text representation of the resource record's
+RDATA.
+.It Xo
+.Ic update delete
+.Va domain-name Op class
+.Va Op type Op data...
+.Xc
+.sp 1
+Deletes any resource records named
+.Va domain-name .
+If
+.Va type
+and
+.Va data
+is provided, only matching resource records will be removed.
+The internet class is assumed if
+.Va class
+is not supplied.
+.It Xo
+.Ic update add
+.Va domain-name ttl Op class
+.Va type data..
+.Xc
+.sp 1
+Adds a new resource record with the specified
+.Va ttl ,
+.Va class
+and
+.Va data .
+.El
+.Sh EXAMPLES
+The examples below show how
+.Nm nsupdate
+could be used to insert and delete resource records from the
+.Dv example.com
+zone.
+Notice that the input in each example contains a trailing blank line so that
+a group of commands are sent as one dynamic update request to the
+master name server for
+.Dv example.com .
+.Bd -literal -offset indent
+# nsupdate
+> update delete oldhost.example.com A
+> update add newhost.example.com 86400 A 172.16.1.1
+>
+.Ed
+.Pp
+Any A records for
+.Dv oldhost.example.com
+are deleted.
+and an A record for
+.Dv newhost.example.com
+it IP address 172.16.1.1 is added.
+The newly-added record has a 1 day TTL (86400 seconds)
+.Bd -literal -offset indent
+# nsupdate
+> prereq nxdomain nickname.example.com
+> update add nickname.example.com CNAME somehost.example.com
+>
+.Ed
+.Pp
+The prerequisite condition gets the name server to check that there
+are no resource records of any type for
+.Dv nickname.example.com .
+If there are, the update request fails.
+If this name does not exist, a CNAME for it is added.
+This ensures that when the CNAME is added, it cannot conflict with the
+long-standing rule in RFC1034 that a name must not exist as any other
+record type if it exists as a CNAME.
+(The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
+SIG, KEY and NXT records.)
+.Sh NAME SERVER PROCESSING
+.Pp
+When a successful update request is made, the BIND9 name server
+increments the serial number in the zone's SOA record.
+A transaction log file is written containing details of the resource
+records that have been added or removed.
+This allows the name server to roll forward to the current state of the
+zone if it is restarted before a fresh copy of the zone file is written
+out by the name server.
+XXXJR WHEN DOES IT DO THAT???
+It then sends a NOTIFY message to the zone's slave servers to inform
+them that the zone's contents have changed.
+.Sh FILES
+.Bl -tag -width Kname.+157.+{random}.private -compact
+.It Pa /etc/named.conf
+name server configuration file
+.It Pa Kname.+157.+{random}.key
+base-64 encoding of HMAC-MD5 key created by
+.Xr dnssec-keygen 8 .
+.It Pa Kname.+157.+{random}.private
+base-64 encoding of HMAC-MD5 key created by
+.Xr dnssec-keygen 8 .
+.El
+.Sh SEE ALSO
+.Xr RFC2136 ,
+.Xr RFC2137 ,
+.Xr RFC2104 ,
+.Xr RFC2845 ,
+.Xr RFC1034 ,
+.Xr RFC2535 ,
+.Xr named 8 ,
+.Xr dnssec-keygen 8 .
+.Sh BUGS
+The
+.Fl D
+and
+.Fl M
+options are not documented apart from this self-referential paragraph.
+They provide additional debugging information which is primarily of interest
+to the BIND9 developers.
+These options might be changed or removed in future releases.
From 8d6c369232229e6f42be52cc14d6349570e9dc01 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Wed, 12 Jul 2000 17:29:58 +0000
Subject: [PATCH 046/226] work with new omapi_protocol_listen and
omapi_auth_register APIs
---
bin/tests/omapi_test.c | 44 ++++++++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 10 deletions(-)
diff --git a/bin/tests/omapi_test.c b/bin/tests/omapi_test.c
index 4728ddfe04..f20db38a70 100644
--- a/bin/tests/omapi_test.c
+++ b/bin/tests/omapi_test.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapi_test.c,v 1.24 2000/06/28 03:37:47 tale Exp $ */
+/* $Id: omapi_test.c,v 1.25 2000/07/12 17:29:58 tale Exp $ */
/*
* Test code for OMAPI.
@@ -409,6 +409,8 @@ do_connect(const char *host, int port) {
client_object_t *client = NULL;
isc_result_t result;
const char *key;
+ const char *bad_secret1 = "this secret is wrong";
+ const char *bad_secret2 = "Yet Another Secret";
RUNTIME_CHECK(omapi_object_register(&client_type, "client",
client_setvalue,
@@ -446,13 +448,15 @@ do_connect(const char *host, int port) {
omapi_auth_deregister(KEY1_NAME);
RUNTIME_CHECK(omapi_auth_register(KEY1_NAME,
- "this secret is wrong",
- OMAPI_AUTH_HMACMD5)
+ OMAPI_AUTH_HMACMD5,
+ bad_secret1,
+ strlen(bad_secret1))
== ISC_R_SUCCESS);
} else if (error_unknownsig) {
RUNTIME_CHECK(omapi_auth_register(KEY2_NAME,
- "Yet Another Secret",
- OMAPI_AUTH_HMACMD5)
+ OMAPI_AUTH_HMACMD5,
+ bad_secret2,
+ strlen(bad_secret2))
== ISC_R_SUCCESS);
key = KEY2_NAME;
@@ -538,6 +542,25 @@ listen_done(isc_task_t *task, isc_event_t *event) {
omapi_lib_destroy();
}
+static isc_boolean_t
+verify_connection(isc_sockaddr_t *sockaddr, void *arg) {
+ /* XXXDCL test the connection verification code */
+ UNUSED(sockaddr);
+ UNUSED(arg);
+
+ return (ISC_TRUE);
+}
+
+static isc_boolean_t
+verify_key(const char *name, unsigned int algorithm, void *arg) {
+ /* XXXDCL test the key verification code */
+ UNUSED(name);
+ UNUSED(algorithm);
+ UNUSED(arg);
+
+ return (ISC_TRUE);
+}
+
static void
do_listen(int port) {
omapi_object_t *listener = NULL;
@@ -591,7 +614,8 @@ do_listen(int port) {
*/
inaddr.s_addr = INADDR_ANY;
isc_sockaddr_fromin(&sockaddr, &inaddr, port);
- RUNTIME_CHECK(omapi_protocol_listen(listener, &sockaddr, acl, 1,
+ RUNTIME_CHECK(omapi_protocol_listen(listener, &sockaddr,
+ verify_connection, verify_key,
listen_done, listener)
== ISC_R_SUCCESS);
@@ -623,6 +647,7 @@ main(int argc, char **argv) {
isc_socketmgr_t *socketmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_entropy_t *entropy = NULL;
+ const char *secret = "shhh, this is a secret";
int ch;
progname = strrchr(*argv, '/');
@@ -683,14 +708,13 @@ main(int argc, char **argv) {
* Initialize the signature library.
*/
RUNTIME_CHECK(isc_entropy_create(mctx, &entropy) == ISC_R_SUCCESS);
- RUNTIME_CHECK(dst_lib_init(mctx, entropy, ISC_ENTROPY_BLOCKING)
- == ISC_R_SUCCESS);
+ RUNTIME_CHECK(dst_lib_init(mctx, entropy, 0) == ISC_R_SUCCESS);
/*
* The secret key is shared on both the client and server side.
*/
- RUNTIME_CHECK(omapi_auth_register(KEY1_NAME, "shhh, this is a secret",
- OMAPI_AUTH_HMACMD5)
+ RUNTIME_CHECK(omapi_auth_register(KEY1_NAME, OMAPI_AUTH_HMACMD5,
+ secret, strlen(secret))
== ISC_R_SUCCESS);
if (argc >= 1 && strcmp(argv[0], "listen") == 0) {
From 0d3bf3c5f1608229244e0a455d6e0fd7f0434abe Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 17:37:57 +0000
Subject: [PATCH 047/226] reviewed; removed requirement to always quote host
addresses
---
bin/rndc/rndc.conf.5 | 8 +++-----
doc/man/bin/rndc.conf.5 | 8 +++-----
doc/man/misc/rndc.conf.5 | 8 +++-----
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/bin/rndc/rndc.conf.5 b/bin/rndc/rndc.conf.5
index 8e37f976bf..010b5e1dc2 100644
--- a/bin/rndc/rndc.conf.5
+++ b/bin/rndc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
+.\" $Id: rndc.conf.5,v 1.4 2000/07/12 17:37:57 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -120,10 +120,8 @@ See the
.Sx EXAMPLES
section for sample command lines for each.
.Pp
-Normally it is not necessary to double quote host or key names, but
-host addresses must always be double quoted and both host and key
-names must be double quoted when they match another keyword, such as
-having a key named "key".
+Host and key names must be quoted using double quotes if they
+match a keyword, such as having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
diff --git a/doc/man/bin/rndc.conf.5 b/doc/man/bin/rndc.conf.5
index 8e37f976bf..010b5e1dc2 100644
--- a/doc/man/bin/rndc.conf.5
+++ b/doc/man/bin/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
+.\" $Id: rndc.conf.5,v 1.4 2000/07/12 17:37:57 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -120,10 +120,8 @@ See the
.Sx EXAMPLES
section for sample command lines for each.
.Pp
-Normally it is not necessary to double quote host or key names, but
-host addresses must always be double quoted and both host and key
-names must be double quoted when they match another keyword, such as
-having a key named "key".
+Host and key names must be quoted using double quotes if they
+match a keyword, such as having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
diff --git a/doc/man/misc/rndc.conf.5 b/doc/man/misc/rndc.conf.5
index 8e37f976bf..010b5e1dc2 100644
--- a/doc/man/misc/rndc.conf.5
+++ b/doc/man/misc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.3 2000/07/11 00:37:58 tale Exp $
+.\" $Id: rndc.conf.5,v 1.4 2000/07/12 17:37:57 gson Exp $
.\"
.Dd Jun 30, 2000
.Dt RDNC.CONF 5
@@ -120,10 +120,8 @@ See the
.Sx EXAMPLES
section for sample command lines for each.
.Pp
-Normally it is not necessary to double quote host or key names, but
-host addresses must always be double quoted and both host and key
-names must be double quoted when they match another keyword, such as
-having a key named "key".
+Host and key names must be quoted using double quotes if they
+match a keyword, such as having a key named "key".
.Sh EXAMPLE
.Bd -literal indent
options {
From a8ea4d2e3fc4bb2e46daaa76f10325d0b8637e8f Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 17:41:24 +0000
Subject: [PATCH 048/226] moved rndc.conf.5 from doc/man/misc to doc/man/bin
for inclusion in RC1 (by repository copy)
---
doc/man/misc/rndc.conf.5 | 202 ---------------------------------------
1 file changed, 202 deletions(-)
delete mode 100644 doc/man/misc/rndc.conf.5
diff --git a/doc/man/misc/rndc.conf.5 b/doc/man/misc/rndc.conf.5
deleted file mode 100644
index 010b5e1dc2..0000000000
--- a/doc/man/misc/rndc.conf.5
+++ /dev/null
@@ -1,202 +0,0 @@
-.\" Copyright (C) @YEARS@ Internet Software Consortium.
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
-.\" ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
-.\" CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
-.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-.\" SOFTWARE.
-.\"
-.\" $Id: rndc.conf.5,v 1.4 2000/07/12 17:37:57 gson Exp $
-.\"
-.Dd Jun 30, 2000
-.Dt RDNC.CONF 5
-.Os BIND9 9
-.ds vT BIND9 Programmer's Manual
-.Sh NAME
-.Nm rdnc.conf
-.Nd rdnc configuration file
-.Sh SYNOPSIS
-.Nm rdnc.conf
-.Sh DESCRIPTION
-The BIND9 utility for controlling the name server,
-.Nm rndc ,
-has its own configuration file
-.Pa /etc/rndc.conf .
-This file has a similar structure and syntax to
-.Pa named.conf ,
-the file used to configure the name server.
-Statements are enclosed in braces and terminated with a semi-colon.
-Clauses in the statements are also semi-colon terminated.
-The usual comment styles are supported:
-.Bl -tag -width UNIX-style:
-.It C style: /* */
-.It C++ style: // to end of line
-.It Unix style: # to end of line
-.El
-.Pp
-.Pa rndc.conf
-is much simpler than
-.Pa named.conf .
-The file uses three statements: an
-.Dv options{}
-statement, a
-.Dv server{}
-statement and a
-.Dv key{}
-statement.
-.Pp
-The
-.Dv options{}
-statement contains two clauses.
-The
-.Dv default-server
-clause
-is followed by the name or address of a name server.
-This host will
-be used when no name server is given as an argument to
-.Nm rndc .
-The
-.Dv default-key
-clause
-is followed by the name of a key which is identified by a
-.Dv key{}
-statement.
-If no
-.Fl y
-option is provided on the
-.Xr rndc
-command line, and no
-.Dv key
-clause is found in a a matching
-.Dv server{}
-statement, this default key will be used to authenticate the server's
-commands and responses.
-.Pp
-After the keyword
-.Dv server ,
-the
-.Dv server{}
-statement is followed by a string which is the hostname or address for a
-name server.
-The statement has a single clause,
-.Dv key .
-The key name must match the name of a
-.Dv key{}
-statement in the file.
-.Pp
-The
-.Dv key{}
-statement begins with an identifying string, the name of the key.
-The statement has two clauses.
-.Dv algorithm
-identifies the encryption algorithm for
-.Nm rndc
-to use; currently only HMAC-MD5 is supported.
-This is followed by a
-.Dv secret
-clause which contains the base-64 encoding of the
-algorithm's encryption key.
-The base-64 string is enclosed in double quotes.
-.Pp
-There are two common ways to generate the base-64 string for the
-.Dv secret .
-The BIND 9 program
-.Xr dnssec-keygen 8
-can be used to generate a random key, or the
-.Xr mmencode 1
-program, also known as
-.Xr mimencode 1 ,
-can be used to generate a base-64 string from known input.
-.Xr mmencode
-does not ship with BIND 9 but is available on many systems.
-See the
-.Sx EXAMPLES
-section for sample command lines for each.
-.Pp
-Host and key names must be quoted using double quotes if they
-match a keyword, such as having a key named "key".
-.Sh EXAMPLE
-.Bd -literal indent
-options {
- default-server localhost;
- default-key samplekey;
-};
-
-server localhost {
- key samplekey;
-};
-
-key samplekey {
- algorithm hmac-md5;
- secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
-};
-.Ed
-.Pp
-In the above example,
-.Nm rndc
-will by default use the server at localhost (127.0.0.1) and the key called
-.Dv samplekey .
-Commands to the localhost server will use the
-.Dv samplekey
-key.
-The
-.Dv key{}
-statement indicates that
-.Dv samplekey
-uses the HMAC-MD5 algorithm and its
-.Dv secret
-clause contains the base-64 encoding of the HMAC-MD5 secret enclosed
-in double quotes.
-.Pp
-To generate a random secret with
-.Xr dnssec-keygen :
-.Bd -literal indent
-$ dnssec-keygen -a hmac-md5 -b 128 -n user rndc
-.Ed
-.Pp
-The base-64 string will appear in two files,
-.Pa Krndc.+157.+{random}.key
-and
-.Pa Krndc.+157.+{random}.private .
-After extracting the key to be
-placed in the
-.Nm rndc.conf
-and
-.Xr named.conf
-.Dv key{}
-statements, the
-.Pa .key
-and
-.Pa .private
-files can be removed.
-.Pp
-To generate a secret from known input with
-.Xr mmenode :
-.Bd -literal indent
-$ echo "known plaintext for a secret" | mmencode
-.Ed
-.Sh LIMITATIONS
-There is currently no way to specify the port for
-.Xr rndc
-to use. This will be remedied in future releases by allowing a
-.Dv port
-clause to the
-.Dv server{}
-statement and a
-.Dv default-port
-clause to the
-.Dv options{}
-statement.
-.Sh SEE ALSO
-.Xr rndc 8 ,
-.Xr named.conf 8 ,
-.Xr dnssec-keygen 8 ,
-.Xr mmencode 1 ,
-"BIND9 Administrators Manual".
From 76959783dd4beab35f5c3b560bf9f81a3b0e10a3 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Wed, 12 Jul 2000 17:44:03 +0000
Subject: [PATCH 049/226] Documentation changes in usage message.
---
bin/dig/dig.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index 6bd4b43cd0..1d8943fde5 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.60 2000/07/12 01:41:35 mws Exp $ */
+/* $Id: dig.c,v 1.61 2000/07/12 17:44:03 mws Exp $ */
#include
#include
@@ -160,6 +160,8 @@ show_usage(void) {
" +[no]defname (Set whether to use default domain)\n"
" +[no]recursive (Recursive mode)\n"
" +[no]aaonly (Set AA flag in query)\n"
+" +[no]adflag (Set AD flag in query)\n"
+" +[no]cdflag (Set CD flag in query)\n"
" +[no]details (Show details of all requests)\n"
" +ndots=### (Set NDOTS value)\n"
" +[no]comments (Control display of comment lines)\n"
@@ -169,6 +171,7 @@ show_usage(void) {
" +[no]additional (Control display of additional)\n"
" +[no]short (Disable everything except short\n"
" form of answer)\n"
+" +[no]all (Set or clear all display flags)\n"
" +qr (Print question before sending)\n"
" +[no]cdflag (Set or clear CD flag in query)\n"
" +[no]adflag (Set or clear AD flag in query)\n"
From f83bad6f7890281b90c9595198f88b88a1ea69f6 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Wed, 12 Jul 2000 17:54:40 +0000
Subject: [PATCH 050/226] imported new ARM from Mary
---
doc/arm/Bv9ARM.1.html | 51 +-
doc/arm/Bv9ARM.2.html | 3 +-
doc/arm/Bv9ARM.3.html | 523 +---------------
doc/arm/Bv9ARM.4.html | 104 ++--
doc/arm/Bv9ARM.5.html | 3 +-
doc/arm/Bv9ARM.6.html | 1079 ++++++++++++++++-----------------
doc/arm/Bv9ARM.7.html | 3 +-
doc/arm/Bv9ARM.8.html | 12 +-
doc/arm/Bv9ARM.9.html | 161 ++---
doc/arm/Bv9ARM.css | 19 -
doc/arm/Bv9ARM.html | 5 +-
doc/arm/Bv9ARM.txt | 1320 +++++++++++++++++++++++------------------
12 files changed, 1423 insertions(+), 1860 deletions(-)
diff --git a/doc/arm/Bv9ARM.1.html b/doc/arm/Bv9ARM.1.html
index 6a495e7a9d..99f44fd118 100644
--- a/doc/arm/Bv9ARM.1.html
+++ b/doc/arm/Bv9ARM.1.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
@@ -91,7 +92,7 @@ Bibliography
In this document, we use the following general typographic conventions:
-
+
@@ -99,7 +100,7 @@ In this document, we use the following general typographic conventions:
To describe:
-
+
@@ -109,14 +110,14 @@ We use the style:
-
+
a pathname, filename, URL, hostname,
mailing list name, or new term or concept
-
+
@@ -126,13 +127,13 @@ Italic
-
+
literal user input
-
+
@@ -142,13 +143,13 @@ Fixed Width Bold
-
+
variable user input
-
+
@@ -158,13 +159,13 @@ Fixed Width Italic
-
+
program output
-
+
@@ -180,7 +181,7 @@ Fixed Width
The following conventions are used in descriptions of the BIND configuration file:
-
+
@@ -188,7 +189,7 @@ The following conventions are used in descriptions of the BIND configuration fil
To describe:
-
+
@@ -198,13 +199,13 @@ We use the style:
-
+
keywords
-
+
@@ -214,13 +215,13 @@ Sans Serif Bold
-
+
variables
-
+
@@ -230,13 +231,13 @@ Sans Serif Italic
-
+
"meta-syntactic" information (within brackets when optional)
-
-
-In this section we provide some suggested configurations along with guidelines for their use. We also address the topic of reasonable option setting.
-
-
-The following sample configuration is appropriate for a caching-only name server for use by clients internal to a corporation. All queries from outside clients are refused.
-
-
-
-// Two corporate subnets we wish to allow queries from.
-acl "corpnets" { 192.168.4.0/24; 192.168.7.0/24; };
-options {
- directory "/etc/namedb"; // Working directory
- pid-file "named.pid"; // Put pid file in working dir
- allow-query { "corpnets "; };
-};
-// Root server hints
-zone "." { type hint; file "root.hint"; };
-// Provide a reverse mapping for the loopback address 127.0.0.1
-zone "0.0.127.in-addr.arpa" {
- type master;
- file "localhost.rev";
- notify no;
-
-};
-
-
-
-This sample configuration is for an authoritative-only server that is the master server for "
-example.com
-" and a slave for the subdomain "
-eng.example.com
-".
-
-
-options {
- directory "/etc/namedb"; // Working directory
- pid-file "named.pid"; // Put pid file in working dir
- allow-query { any; }; // This is the default
- recursion no; // Do not provide recursive service
-};
-// Root server hints
-zone "." { type hint; file "root.hint"; };
-
-// Provide a reverse mapping for the loopback address 127.0.0.1
- zone "0.0.127.in-addr.arpa" {
- type master;
- file "localhost.rev";
- notify no;
-};
-// We are the master server for example.com
-zone "example.com" {
- type master;
- file "example.com.db";
- // IP addresses of slave servers allowed to transfer example.com
- allow-transfer {
- 192.168.4.14;
- 192.168.5.53;
- };
-};
-
-// We are a slave server for eng.example.com
-zone "eng.example.com" {
- type slave;
- file "eng.example.com.bk";
- // IP address of eng.example.com master server
- masters { 192.168.4.12; };
-};
-
-
-
-Primitive load balancing can be achieved in DNS using multiple A records for one name.
-
-
-
-For example, if you have three WWW servers with network addresses of 10.0.0.1, 10.0.0.2 and 10.0.0.3, a set of records such as the following means that clients will connect to each machine one third of the time:
-
-
-When a resolver queries for these records, BIND will rotate them and respond to the query with the records in a different order. In the example above, clients will randomly receive records in the order 1, 2, 3; 2, 3, 1; and 3, 1, 2. Most clients will use the first record returned and discard the rest.
-
-
-
-For more detail on ordering responses, check the
-rrset-order
- substatement in the
-options
- statement under RRset Ordering. This substatement is not supported in BIND 9, and only the ordering scheme described above is available.
-
-
-DNS Notify is a mechanism that allows master nameservers to notify their slave servers of changes to a zone's data. In response to a
-NOTIFY
- from a master server, the slave will check to see that its version of the zone is the current version and, if not, initiate a transfer.
-
-
-
-DNS Notify is fully documented in RFC 1996. See also the description of the zone option
-also-notify
- under Zone Transfers
-. More information about
-notify
- can be found under Boolean Options
-.
-
-
-3.4.1 Tools for Use With the Nameserver Daemon
-
-
-
-
-There are several indispensable diagnostic, administrative and monitoring tools available to the system administrator for controlling and debugging the nameserver daemon. We describe several in this section
-
-
-The domain information groper (
-dig
-) is a command line tool that can be used to gather information from the Domain Name System servers. Dig has two modes: simple interactive mode for a single query, and batch mode which executes a query for each in a list of several query lines. All query options are accessible from the command line.
-
-
-The
-
-
-host
-
-
-utility provides a simple DNS lookup using a command-line interface for looking up Internet hostnames. By default, the utility converts between host names and Internet addresses, but its functionality can be extended with the use of options.
-
-
-
-nslookup
- is a program used to query Internet domain nameservers.
-nslookup
- has two modes: interactive and non-interactive. Interactive mode allows the user to query nameservers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.
-
-
-Interactive mode is entered when no arguments are given (the default nameserver will be used) or when the first argument is a hyphen (`-') and the second argument is the host name or Internet address of a nameserver.
-
-
-
-Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a nameserver.
-
-
-
-The options listed under the "set" command (see the
-nslookup
- man page for details) can be specified in the
-.nslookuprc
- file in the user's home directory if they are listed one per line. Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial time-out to 10 seconds, type:
-
-
-nslookup -query=hinfo -timeout=10
-
-
-
-
-For more information and a list of available commands and options, see the
-nslookup
- man page.
-
-
-
-Due to its arcane user interface and frequently inconsistent behavior, we do not recommend the use of
-nslookup
-, and it is not installed by default when installing BIND 9. Use
-dig
- instead.
-
-
-The remote name daemon control (
-rndc
-) program is a program that allows the system administrator to control the operation of a nameserver. If you run
-rndc
- without any options it will display a usage message.
In this section we provide some suggested configurations along with guidelines for their use. We also address the topic of reasonable option setting.
3.1
Sample Configurations
3.1.1 A Caching-only Nameserver
The following sample configuration is appropriate for a caching-only name server for use by clients internal to a corporation. All queries from outside clients are refused.
// Two corporate subnets we wish to allow queries from.
acl "corpnets" { 192.168.4.0/24; 192.168.7.0/24; };
options {
directory "/etc/namedb"; // Working directory
pid-file "named.pid"; // Put pid file in working dir
allow-query { "corpnets "; };
};
// Root server hints
zone "." { type hint; file "root.hint"; };
// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};
3.1.2 An Authoritative-only Nameserver
This sample configuration is for an authoritative-only server that is the master server for "
example.com
" and a slave for the subdomain "
eng.example.com
".
options {
directory "/etc/namedb"; // Working directory
pid-file "named.pid"; // Put pid file in working dir
allow-query { any; }; // This is the default
recursion no; // Do not provide recursive service
};
// Root server hints
zone "." { type hint; file "root.hint"; };
// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};
// We are the master server for example.com
zone "example.com" {
type master;
file "example.com.db";
// IP addresses of slave servers allowed to transfer example.com
allow-transfer {
192.168.4.14;
192.168.5.53;
};
};
// We are a slave server for eng.example.com
zone "eng.example.com" {
type slave;
file "eng.example.com.bk";
// IP address of eng.example.com master server
masters { 192.168.4.12; };
};
3.2 Load Balancing
Primitive load balancing can be achieved in DNS using multiple A records for one name.
For example, if you have three WWW servers with network addresses of 10.0.0.1, 10.0.0.2 and 10.0.0.3, a set of records such as the following means that clients will connect to each machine one third of the time:
Name
TTL
CLASS
TYPE
Resource Record (RR) Data
www
600
IN
A
10.0.0.1
600
IN
A
10.0.0.2
600
IN
A
10.0.0.3
When a resolver queries for these records, BIND will rotate them and respond to the query with the records in a different order. In the example above, clients will randomly receive records in the order 1, 2, 3; 2, 3, 1; and 3, 1, 2. Most clients will use the first record returned and discard the rest.
For more detail on ordering responses, check the
rrset-order
substatement in the
options
statement under RRset Ordering. This substatement is not supported in BIND 9, and only the ordering scheme described above is available.
3.3
Notify
DNS Notify is a mechanism that allows master nameservers to notify their slave servers of changes to a zone's data. In response to a
NOTIFY
from a master server, the slave will check to see that its version of the zone is the current version and, if not, initiate a transfer.
DNS Notify is fully documented in RFC 1996. See also the description of the zone option
also-notify
under Zone Transfers
. More information about
notify
can be found under Boolean Options
.
3.4 Nameserver Operations
3.4.1 Tools for Use With the Nameserver Daemon
There are several indispensable diagnostic, administrative and monitoring tools available to the system administrator for controlling and debugging the nameserver daemon. We describe several in this section
3.4.1.1 Diagnostic Tools
dig
The domain information groper (
dig
) is a command line tool that can be used to gather information from the Domain Name System servers. Dig has two modes: simple interactive mode for a single query, and batch mode which executes a query for each in a list of several query lines. All query options are accessible from the command line.
For more information and a list of available commands and options, see the
dig man page.
host
The
host
utility provides a simple DNS lookup using a command-line interface for looking up Internet hostnames. By default, the utility converts between host names and Internet addresses, but its functionality can be extended with the use of options.
For more information and a list of available commands and options, see the
host man page.
nslookup
nslookup
is a program used to query Internet domain nameservers.
nslookup
has two modes: interactive and non-interactive. Interactive mode allows the user to query nameservers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.
Usage
nslookup [-option ...] [host-to-find | -[server]]
Interactive mode is entered when no arguments are given (the default nameserver will be used) or when the first argument is a hyphen (`-') and the second argument is the host name or Internet address of a nameserver.
Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a nameserver.
The options listed under the "set" command (see the
nslookup
man page for details) can be specified in the
.nslookuprc
file in the user's home directory if they are listed one per line. Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial time-out to 10 seconds, type:
nslookup -query=hinfo -timeout=10
For more information and a list of available commands and options, see the
nslookup
man page.
Due to its arcane user interface and frequently inconsistent behavior, we do not recommend the use of
nslookup
, and it is not installed by default when installing BIND 9. Use
dig
instead.
3.4.1.2 Administrative Tools
Administrative tools play an integral part in the management of a server.
rndc
The remote name
daemon control (rndc) program allows
the system administrator to control the operation of a nameserver. If
you run (rndc) without any options
it will display a usage message as follows:
Dump database and cache to /var/tmp/named_dump.db.
reload
Reload configuration file and zones.
*stats
Dump statistics to /var/tmp/named.stats.
*trace
Increment debugging level by one.
*notrace
Set debugging level to 0.
*querylog
Toggle query logging.
*stop
Stop the server.
*restart
Restart the server.
* == not yet implemented
As noted above, "reload" is the only command available for BIND 9.0.0.
The other commands, and more, are planned to be implemented for future
releases.
A configuration file is required, since all communication with the
server is authenticated with digital signatures that rely on a shared
secret, and there is no way to provide that secret other than with a
configuration file. The default location for the rndc configuration
file is /etc/rndc.conf, but an alternate location can be specified with
the "-c" option.
The format of the configuration file is similar to that of named.conf,
but limited to only three statements, the options{}, key{} and server{}
statements. These statements are what associate the secret keys to the
servers with which they are meant to be shared. The order of statements
is not significant.
The options{} statement has two clauses: default-server and default-key.
default-server takes a host name or address argument and represents the server that will be contacted if
no "-s" option is provided on the command line. default-key takes the
name of the key as its argument, as defined by a key{} statement. In
the future a default-port clause will be added to specify the port to
which rndc should connect.
The key{} statement names a key with its string argument. The string
is required by the server to be a valid domain name, though it need
not actually be hierarchical; thus, a string like "rndc_key" is a valid
name. The key{} statement has two clauses: algorithm and secret. While
the configuration parser will accept any string as the argument to algorithm,
currently only the string "hmac-md5" has any meaning. The secret is
a base-64 encoded string, typically generated with either dnssec-keygen
or mmencode.
The server{} statement uses the key clause to associate a key{}-defined
key with a server. The argument to the server{} statement is a host
name or address (addresses must be double quoted). The argument to the
key clause is the name of key as defined by the key{} statement. A port
clause will be added to a future release to specify the port to which
rndc should connect on the given server.
A sample minimal configuration file is as follows:
This file, if installed as /etc/rndc.conf, would allow the command:
$ rndc reload
to connect to 127.0.0.1 port 953 and cause the nameserver to reload,
if a nameserver on the local machine were running with following controls
statements:
and it had an identical key statement for rndc_key.
3.4.2 Signals
Certain UNIX signals cause the name server to take specific actions, as described in the following table. These signals can be sent using the
kill
command.
SIGHUP
Causes the server to read
named.conf
and reload the database.
\ No newline at end of file
diff --git a/doc/arm/Bv9ARM.4.html b/doc/arm/Bv9ARM.4.html
index e63145e715..83c36f2f6e 100644
--- a/doc/arm/Bv9ARM.4.html
+++ b/doc/arm/Bv9ARM.4.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
@@ -60,7 +61,7 @@ Updating of secure zones (zones using DNSSEC) is modelled after the
-http://www.ietf.org/html.charters/dnsext-charter.html
+http://www.ietf.org/html.charters/dnsext-charter.html
for information about the DNS Extensions working group.) SIG and NXT records affected by updates are automatically regenerated by the server using an online zone key. Update authorization is based on transaction signatures and an explicit server policy.
@@ -164,11 +165,8 @@ site2.internal
To protect the
- site1.interna
-
-l
- and
-
+ site1.internal
+ and
site2.internal
domains, the internal nameservers must be configured to disallow all queries to these domains from any external hosts, including the bastion hosts.
@@ -195,7 +193,7 @@ In addition, the public
site1
and
site2.example.com
- zones should have special MX records that contain wildcard (`*') records pointing to the bastion hosts. This is needed because external mail servers do not have any other way of looking up how to deliver mail to those internal hosts. With the wildcard records, the mail will be delivered to the bastion host, which can then forward it on to internal hosts.
+ zones should have special MX records that contain wildcard ('*') records pointing to the bastion hosts. This is needed because external mail servers do not have any other way of looking up how to deliver mail to those internal hosts. With the wildcard records, the mail will be delivered to the bastion host, which can then forward it on to internal hosts.
@@ -347,9 +345,9 @@ bastion-ips-go-here; };
options {
...
...
- allow-transfer { none; }; // sample allow-transfer (no one)
- allow-query { internals; externals; }; // restrict query access
- allow-recursion { internals; externals; }; // restrict recursion
+ allow-transfer { none; }; // sample allow-transfer (no one)
+ allow-query { internals; externals; }; // restrict query access
+ allow-recursion { internals; externals; }; // restrict recursion
...
...
};
@@ -406,9 +404,11 @@ BIND primarily supports TSIG for server to server communication. This includes z
TSIG might be most useful for dynamic update. A primary server for a dynamic zone should use access control to control updates, but IP-based access control is insufficient. Key-based access control is far superior. See RFC 2845 in the Proposed Standards
section of the Appendix. The
nsupdate
- program that is shipped with BIND 8 supports TSIG via the "
+ program supports TSIG via the "
-k
-" command line option.
+" and "
+-y
+"command line options.
@@ -800,7 +800,7 @@ dnssec-makekeyset
The following command generates a key set containing the above key and another key similarly generated, with a TTL of 3600 and a signature validity period of 10 days starting from now.
@@ -1117,62 +1117,46 @@ To replicate the previous example using bitstrings:
4.8.5 Using DNAME for Delegation of IPv6 Reverse Addresses
-
-
-
-Delegation of reverse addresses is done through the new DNAME RR. In the example above, where
-\[x2/3].ip6.int.
- needs to delegate
-
-
-\[xFFF0]
-
-
-to an organization (
-example2.com
-), the domain administrator would insert a line similar to the following in the
-\[x2/3].ip6.int.
- zone:
+In IPV6, the same host may have many addresses from many network providers. Since the trailing portion of the address usually remains constant, DNAME can help reduce the number of zone files used for reverse mapping that need to be maintained.
+
+For example, consider a host which has two providers (example.net and example2.net) and therefore two IPv6 addresses. Since the host chooses its own 64 bit host address portion, the provider address is the only part that changes:
-
-
-We suggest that the top of your administrative control (
-example.com
-, in this case) provide all the bits required for reverse and forward resolution to allow name resolution even if the network is disconnected from the Internet. This will also allow operation with DNSSEC if you set up a false trusted server for "." containing only delegations for your forward and reverse zones directly to the top of your administrative control. This should be signed with a key trusted by all of your clients, equivalent to the real key for ".".
+
diff --git a/doc/arm/Bv9ARM.5.html b/doc/arm/Bv9ARM.5.html
index 73137da636..0ec12ef76b 100644
--- a/doc/arm/Bv9ARM.5.html
+++ b/doc/arm/Bv9ARM.5.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
diff --git a/doc/arm/Bv9ARM.6.html b/doc/arm/Bv9ARM.6.html
index a1381e2a9f..d38394114b 100644
--- a/doc/arm/Bv9ARM.6.html
+++ b/doc/arm/Bv9ARM.6.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
@@ -60,7 +61,7 @@ Following is a list of elements used throughout the BIND configuration file docu
-
+
@@ -68,7 +69,7 @@ Following is a list of elements used throughout the BIND configuration file docu
acl_name
-
+
@@ -80,7 +81,7 @@ acl
-
+
@@ -88,7 +89,7 @@ acl
address_match_list
-
+
@@ -112,7 +113,7 @@ Address Match Lists
-
+
@@ -120,7 +121,7 @@ Address Match Lists
domain_name
-
+
@@ -130,7 +131,7 @@ my.test.domain
-
+
@@ -138,7 +139,7 @@ my.test.domain
dotted_decimal
-
+
@@ -152,7 +153,7 @@ One or more integers valued 0 through 255 separated only by dots (`.'), such as
-
+
@@ -160,7 +161,7 @@ One or more integers valued 0 through 255 separated only by dots (`.'), such as
ip4_addr
@@ -924,44 +939,42 @@ controls
The
controls
statement declares control channels to be used by system administrators to affect the operation of the local nameserver. These control channels are used by the
-ndc
+rndc
utility to send commands to and retrieve non-DNS results from a nameserver.
-
+
-A UNIX control channel is a "first in first out" (FIFO) named pipe in the file system, and access to it is controlled by normal file system permissions. It is created by
-named
- with the specified file mode bits (see the
-chmod(1)
- manual page), user and group owner. Note that, unlike
-chmod
-, the mode bits specified for
-permission
- will normally have a leading
-0
- so the number is interpreted as octal. Also note that the user and group ownership specified as owner and group must be given as numbers, not names. It is recommended that the permissions be restricted to administrative personnel only to prevent random users on the system from having the ability to manage the local nameserver.
+An inet control channel is a TCP/IP socket accessible to the Internet,
+created at the specified ip_port on the specified ip_addr. If no port
+is specified, port 953 is used by default. "*" cannot be used for
+ip_port.
-
+
-An
-inet
- control channel is a TCP/IP socket accessible to the Internet, created at the specified
-ip_port
- on the specified
-ip_addr
-. It is recommended that 127.0.0.1 be the only
-ip_addr
- used, and this only if you trust all non-privileged users on the local host to manage your nameserver.
+The ability to issue commands over the control channel is restricted
+by the allow and keys clauses. Connections to the control channel are
+permitted based on the address permissions in address_match_list.
+key_id members of the address_match_list are ignored, and instead are
+interpreted independently based the key_list. Each key_id in the
+key_list is allowed to be used to authenticate commands and responses
+given over the control channel by digitally signing each message
+between the server and a command client (see rndc in Section 3.4.1.2).
+All commands to the control channel must be signed by one of its
+specified keys to be honored.
-
+
-
-The
-
-controls
-
- statement is not yet implemented in BIND 9. The server always listens for control connections on IP address 127.0.0.1, port 953.
-
+For the initial release of BIND 9.0.0, only one command is possible
+over the command channel, the command to reload the server. We will
+expand command set in future releases.
+
+
+
+The UNIX control channel type of BIND 8 is not supported in BIND
+9.0.0, and is not expected to be added in future releases. If it is
+present in the controls statement from a BIND 8 configuration file, a
+non-fatal warning will be logged.
trusted-keys {
- string number number number string ;
- [ string number number number string ; [...]]
+ string number number number string ;
+ [ string number number number string ; [...]]}; }
@@ -4308,7 +4313,7 @@ Update forwarding is not yet implemented.
-
+
@@ -4316,7 +4321,7 @@ Update forwarding is not yet implemented.
also-notify
-
+
@@ -4335,7 +4340,7 @@ also-notify
-
+
@@ -4343,7 +4348,7 @@ also-notify
check-names
-
+
@@ -4356,7 +4361,7 @@ Not yet implemented in BIND 9.
-
+
@@ -4364,7 +4369,7 @@ Not yet implemented in BIND 9.
dialup
-
+
@@ -4379,7 +4384,7 @@ Not yet implemented in BIND 9.
-
+
@@ -4387,7 +4392,7 @@ Not yet implemented in BIND 9.
forward
-
+
@@ -4402,7 +4407,7 @@ Not yet implemented in BIND 9.
-
+
@@ -4410,7 +4415,7 @@ Not yet implemented in BIND 9.
forwarders
-
+
@@ -4426,7 +4431,7 @@ Not yet implemented in BIND 9.
-
+
@@ -4434,7 +4439,7 @@ Not yet implemented in BIND 9.
ixfr-base
-
+
@@ -4444,7 +4449,7 @@ jnl
-
+
@@ -4452,7 +4457,7 @@ jnl
max-transfer-time-in
-
+
@@ -4465,7 +4470,7 @@ Zone Transfers
-
+
@@ -4473,7 +4478,7 @@ Zone Transfers
max-transfer-idle-in
-
+
@@ -4486,7 +4491,7 @@ Zone Transfers
-
+
@@ -4494,7 +4499,7 @@ Zone Transfers
max-transfer-time-out
-
+
@@ -4507,7 +4512,7 @@ Zone Transfers
-
+
@@ -4515,7 +4520,7 @@ Zone Transfers
max-transfer-idle-out
-
+
@@ -4528,7 +4533,7 @@ Zone Transfers
-
+
@@ -4536,7 +4541,7 @@ Zone Transfers
notify
-
+
@@ -4548,7 +4553,7 @@ Boolean Options
-
+
@@ -4556,7 +4561,7 @@ Boolean Options
pubkey
-
+
@@ -4564,7 +4569,7 @@ In BIND 8, this option was intended for specifying a public zone key for verific
-
+
@@ -4572,7 +4577,7 @@ In BIND 8, this option was intended for specifying a public zone key for verific
sig-validity-interval
-
+
@@ -4584,7 +4589,7 @@ Tuning
-
+
@@ -4592,23 +4597,21 @@ Tuning
transfer-source
-
+
-Determines which local address will be bound to the IPv4 TCP connection used to fetch this zone. If not set, it defaults to a system controlled value which will usually be the address of the interface "closest to" the remote end. This address must appear in the remote end's
-allow-transfer
- option for this zone if one is specified.
+Determines which local address will be bound to the IPv4 TCP connection used to fetch this zone. If not set, it defaults to a system controlled value which will usually be the address of the interface "closest to" the remote end. If the remote end user is an allow-transfer option for this zone, the address, supplied by the transfer-source option, needs to be specified in that allow-transfer option.
-
+
transfer-source-v6
-
+
@@ -4688,7 +4691,7 @@ self
.
-
+
@@ -4696,7 +4699,7 @@ self
name
-
+
@@ -4704,7 +4707,7 @@ Matches when the updated name is the same as the name in the name field.
-
+
@@ -4712,7 +4715,7 @@ Matches when the updated name is the same as the name in the name field.
subdomain
-
+
@@ -4720,7 +4723,7 @@ Matches when the updated name is a subdomain of the name in the name field.
-
+
@@ -4728,7 +4731,7 @@ Matches when the updated name is a subdomain of the name in the name field.
wildcard
-
+
@@ -4736,7 +4739,7 @@ Matches when the updated name is a valid expansion of the wildcard name in the n
-
+
@@ -4744,7 +4747,7 @@ Matches when the updated name is a valid expansion of the wildcard name in the n
self
-
+
@@ -4800,13 +4803,13 @@ RRset Ordering
The components of a Resource Record are
-
+
owner name
-
+
@@ -4814,13 +4817,13 @@ the domain name where the RR is found.
-
+
type
-
+
@@ -4828,13 +4831,13 @@ an encoded 16 bit value that specifies the type of the resource in this resource
-
+
TTL
-
+
@@ -4842,13 +4845,13 @@ the time to live of the RR. This field is a 32 bit integer in units of seconds,
-
+
class
-
+
@@ -4856,13 +4859,13 @@ an encoded 16 bit value that identifies a protocol family or instance of a proto
-
+
RDATA
-
+
@@ -4878,13 +4881,13 @@ types
of valid RRs (some of these listed, although not obsolete, are experimental (x) or historical (h) and no longer in general use):
-
+
A
-
+
@@ -4892,13 +4895,13 @@ a host address.
-
+
A6
-
+
@@ -4906,13 +4909,13 @@ an IPv6 address.
-
+
AAAA
-
+
@@ -4920,13 +4923,13 @@ Obsolete format of IPv6 address
-
+
AFSDB
-
+
@@ -4934,13 +4937,13 @@ AFSDB
-
+
CNAME
-
+
@@ -4948,13 +4951,13 @@ identifies the canonical name of an alias.
-
+
DNAME
-
+
@@ -4962,13 +4965,13 @@ for delegation of reverse addresses. Replaces the domain name specified with ano
-
+
HINFO
-
+
@@ -4976,13 +4979,13 @@ identifies the CPU and OS used by a host.
-
+
ISDN
-
+
@@ -4990,13 +4993,13 @@ ISDN
-
+
KEY
-
+
@@ -5004,13 +5007,13 @@ stores a public key associated with a DNS name.
-
+
LOC
-
+
@@ -5018,13 +5021,13 @@ LOC
-
+
MX
-
+
@@ -5032,13 +5035,13 @@ identifies a mail exchange for the domain. See RFC 974 for details.
-
+
NS
-
+
@@ -5046,13 +5049,13 @@ the authoritative nameserver for the domain.
-
+
NXT
-
+
@@ -5060,13 +5063,13 @@ used in DNSSEC to securely indicate that RRs with an owner name in a certain nam
-
+
PTR
-
+
@@ -5074,13 +5077,13 @@ a pointer to another part of the domain name space.
-
+
RP
-
+
@@ -5088,13 +5091,13 @@ RP
-
+
RT
-
+
@@ -5102,13 +5105,13 @@ RT
-
+
SIG
-
+
@@ -5116,13 +5119,13 @@ SIG
-
+
SOA
-
+
@@ -5130,13 +5133,13 @@ identifies the start of a zone of authority.
-
+
SRV
-
+
@@ -5144,13 +5147,13 @@ information about well known network services (replaces WKS).
-
+
WKS
-
+
@@ -5158,13 +5161,13 @@ WKS
-
+
X25
-
+
@@ -5180,13 +5183,13 @@ classes
of resource records are currently valid in the DNS:
-
+
IN
-
+
@@ -5212,13 +5215,13 @@ RDATA
is the type-dependent or class-dependent data that describes the resource:
-
+
A
-
+
@@ -5226,13 +5229,13 @@ for the IN class, a 32 bit IP address.
-
+
A6
-
+
@@ -5240,13 +5243,13 @@ maps a domain name to an IPv6 address, with a provision for indirection for lead
-
+
CNAME
-
+
@@ -5254,13 +5257,13 @@ a domain name.
-
+
DNAME
-
+
@@ -5268,13 +5271,13 @@ provides alternate naming to an entire subtree of the domain name space, rather
-
+
MX
-
+
@@ -5282,13 +5285,13 @@ a 16 bit preference value (lower is better) followed by a host name willing to a
-
+
NS
-
+
@@ -5296,13 +5299,13 @@ a fully qualified domain name.
-
+
PTR
-
+
@@ -5310,13 +5313,13 @@ a fully qualified domain name.
-
+
SOA
-
+
@@ -5366,7 +5369,7 @@ The resource data or RDATA section of the RR are given using knowledge of the ty
For example, we might show the RRs carried in a message as:
-
+
@@ -5374,7 +5377,7 @@ For example, we might show the RRs carried in a message as:
ISI.EDU.
-
+
@@ -5382,7 +5385,7 @@ ISI.EDU.
MX
-
+
@@ -5392,7 +5395,7 @@ MX
-
+
@@ -5400,7 +5403,7 @@ MX
-
+
@@ -5408,7 +5411,7 @@ MX
MX
-
+
@@ -5418,7 +5421,7 @@ MX
-
+
@@ -5426,7 +5429,7 @@ MX
VENERA.ISI.EDU
-
+
@@ -5434,7 +5437,7 @@ VENERA.ISI.EDU
A
-
+
@@ -5444,7 +5447,7 @@ A
-
+
@@ -5452,7 +5455,7 @@ A
-
+
@@ -5460,7 +5463,7 @@ A
A
-
+
@@ -5470,7 +5473,7 @@ A
-
+
@@ -5478,7 +5481,7 @@ A
VAXA.ISI.EDU
-
+
@@ -5486,7 +5489,7 @@ VAXA.ISI.EDU
A
-
+
@@ -5496,7 +5499,7 @@ A
-
+
@@ -5504,7 +5507,7 @@ A
-
+
@@ -5512,7 +5515,7 @@ A
A
-
+
@@ -5536,7 +5539,7 @@ This example shows six RRs, with two RRs at each of three domain names.
Similarly we might see:
-
+
@@ -5544,7 +5547,7 @@ Similarly we might see:
XX.LCS.MIT.EDU. IN
-
+
@@ -5552,7 +5555,7 @@ XX.LCS.MIT.EDU. IN
A
-
+
@@ -5562,7 +5565,7 @@ A
-
+
@@ -5570,7 +5573,7 @@ A
CH
-
+
@@ -5578,7 +5581,7 @@ CH
A
-
+
@@ -5623,7 +5626,7 @@ For a given domain, if there is both a CNAME record and an MX record, the MX rec
For example:
-
-
-Certain UNIX signals cause the name server to take specific actions, as described in the following table. These signals can be sent using the
-kill
- command.
diff --git a/doc/arm/Bv9ARM.7.html b/doc/arm/Bv9ARM.7.html
index 84f34c0c07..c8fc9f2e32 100644
--- a/doc/arm/Bv9ARM.7.html
+++ b/doc/arm/Bv9ARM.7.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
diff --git a/doc/arm/Bv9ARM.8.html b/doc/arm/Bv9ARM.8.html
index 8f29c488c9..3752bed20f 100644
--- a/doc/arm/Bv9ARM.8.html
+++ b/doc/arm/Bv9ARM.8.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
@@ -84,14 +85,13 @@ The Internet Software Consortium (ISC) offers a wide range of support and servic
-To discuss arrangements for support, contact
-info@isc.org
+To discuss arrangements for support, contact
+info@isc.org
or visit the ISC web page at
-
-http://www.isc.org/services/support/
- to read more.
@@ -444,7 +450,7 @@ Public Topology
network
section of the address range. The
Site Topology
- is where you can subnet this space, much the same as subnetting an IPv4 class A or B network into class Cs. The
+ is where you can subnet this space, much the same as subnetting an IPv4 /16 network into /24 subnets. The
Interface Identifier
is the address of an individual interface on a given network. (With IPv6, addresses belong to interfaces rather than machines.)
@@ -461,25 +467,25 @@ The internal structure of the Public Topology for an A6 global unicast address c
-
+
3
-
+
13
-
+
8
-
+
@@ -487,25 +493,25 @@ The internal structure of the Public Topology for an A6 global unicast address c
-
+
FP
-
+
TLA ID
-
+
RES
-
+
@@ -532,7 +538,7 @@ A 3 bit FP (Format Prefix) of 001 indicates this is a global Unicast address. FP
-There is no particular structure for the Site topology section. Organizations can allocate these bits in any way they desire, in the same way as they would subnet an IPv4 class A (8-bit prefix) network.
+There is no particular structure for the Site topology section. Organizations can allocate these bits in any way they desire.
@@ -550,35 +556,34 @@ IPv6 address specifications are likely to contain long strings of zeros, so the
-
+
-Bibliography (and Suggested Reading)
+Appendix D. Bibliography (and Suggested Reading)
-
+
-Request for Comments (RFCs)
+Request for Comments (RFCs)
Specification documents for the Internet protocol suite, including the DNS, are published as part of the Request for Comments (RFCs) series of technical notes. The standards themselves are defined by the Internet Engineering Task Force (IETF) and the Internet Engineering Steering Group (IESG). RFCs can be obtained online via FTP at
-
-ftp://www.isi.edu/in-notes/RFCxxx.txt
- (where
-xxx
+ftp://www.isi.edu/in-notes/RFCxxx.txt
+ (where
+xxx
is the number of the RFC). RFCs are also available via the Web at
-http://www.ietf.org/rfc/
+http://www.ietf.org/rfc/
.
-
+
-Standards
+Standards
diff --git a/doc/arm/Bv9ARM.css b/doc/arm/Bv9ARM.css
index 487d04744a..21c7aebe23 100644
--- a/doc/arm/Bv9ARM.css
+++ b/doc/arm/Bv9ARM.css
@@ -1,22 +1,3 @@
-/*
- * Copyright (C) 2000 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/* $Id: Bv9ARM.css,v 1.6 2000/06/29 00:13:47 gson Exp $ */
-
A:link {
color: blue;
text-decoration: underline;
diff --git a/doc/arm/Bv9ARM.html b/doc/arm/Bv9ARM.html
index 925153244c..553fc20f81 100644
--- a/doc/arm/Bv9ARM.html
+++ b/doc/arm/Bv9ARM.html
@@ -16,8 +16,9 @@
- SOFTWARE.
-->
-
+
+
@@ -31,7 +32,7 @@
BIND 9 Administrator Reference Manual
-June, 2000
+
July, 2000
diff --git a/doc/arm/Bv9ARM.txt b/doc/arm/Bv9ARM.txt
index 89ec68a66b..884c776151 100644
--- a/doc/arm/Bv9ARM.txt
+++ b/doc/arm/Bv9ARM.txt
@@ -1,14 +1,12 @@
-Copyright (C) 2000 Internet Software Consortium.
-See COPYRIGHT in the source root or http://www.isc.org/copyright for terms.
-
-$Id: Bv9ARM.txt,v 1.5 2000/06/29 00:13:49 gson Exp $
-
BIND 9 Administrator Reference Manual
-June 2000
+July 2000
Copyright (c) 2000 Internet Software Consortium
--------------------------------------------------------------------
+
+ BIND 9 ADMINISTRATOR REFERENCE MANUAL
+
Table of Contents
Section 1 : Introduction
@@ -45,6 +43,7 @@ Section 3 : Nameserver Configuration
3.4.1 Tools for Use With the Nameserver Daemon
3.4.1.1 Diagnostic Tools
3.4.1.2 Administrative Tools
+3.4.2 Signals
Section 4 : Advanced Concepts
@@ -144,7 +143,7 @@ Section 6 : BIND 9 Configuration Reference
6.3.5.2 The $INCLUDE Directive
6.3.5.3 The $TTL Directive
6.3.6 BIND Master File Extension: the $GENERATE Directive
-6.3.7 Signals 69
+6.3.7 Signals 69
Section 7 : BIND 9 Security Considerations
@@ -216,7 +215,7 @@ In this document, Section 1 introduces the basic DNS and BIND concepts.
Section 2 describes resource requirements for running BIND in various
environments. Information in Section 3 is task-oriented in its presentation
and is organized functionally, to aid in the process of installing the
-BIND 9 software. The task-oriented section is followed by Section 4 , which
+BIND 9 software. The task-oriented section is followed by Section 4, which
contains more advanced concepts that the system administrator may need for
implementing certain options. Section 5 describes the BIND 9 lightweight
resolver. The contents of Section 6 are organized as in a reference manual
@@ -262,7 +261,7 @@ nameserver (or "daemon") called named and a resolver library. The BIND
server runs in the background, servicing queries on a well known network
port. The standard port for the User Datagram Protocol (UDP) and
Transmission Control Protocol (TCP), usually port 53, is specified in
-/etc/services . The resolver is a set of routines residing in a system
+/etc/services. The resolver is a set of routines residing in a system
library that provides the interface that programs can use to access the
domain name services.
@@ -280,7 +279,7 @@ a label. The name of the domain is the concatenation of all the labels of
the domains from the root to the current domain. This is represented in
written form as a string of labels listed from right to left and separated
by dots. A label need only be unique within its domain. The whole name space
-is partitioned into areas called zones , each starting at a domain and
+is partitioned into areas called zones, each starting at a domain and
extending down to the leaf domains or to domains where other zones start.
Zones usually represent administrative boundaries. For example, a domain
name for a host at the company Example, Inc. would be:
@@ -288,16 +287,15 @@ name for a host at the company Example, Inc. would be:
ourhost.example.com
where com is the top level domain to which ourhost.example.com belongs,
-example is a subdomain of com , and ourhost is the name of the host.
+example is a subdomain of com, and ourhost is the name of the host.
-The specifications for the domain nameserver are defined in the RFC 1034,
-RFC 1035 and RFC 974. These documents can be found in
-/usr/src/etc/named/doc in 4.4BSD or are available via File Transfer Protocol
-(FTP) from
-ftp://www.isi.edu/in-notes/ or via the Web at http://www.ietf.org/rfc/ .
-(See Appendix C for complete information on finding and retrieving RFCs.) It
-is also recommended that you read the related man pages: named and resolver
-.
+The specifications for the domain nameserver are defined in the RFC
+1034, RFC 1035 and RFC 974. These documents can be found in
+/usr/src/etc/named/doc in 4.4BSD or are available via File Transfer
+Protocol (FTP) from ftp://www.isi.edu/in-notes/ or via the Web at
+http://www.ietf.org/rfc/. (See Appendix C for complete information
+on finding and retrieving RFCs.) It is also recommended that you read
+the related man pages: named and resolver.
1.4.2 Types of Zones
@@ -310,15 +308,15 @@ or more NS records in the parent zone, which should be matched by equivalent
NS records at the root of the delegated zone.
To properly operate a nameserver, it is important to understand the
-difference between a zone and a domain .
+difference between a zone and a domain.
For instance, consider the example.com domain which includes names such as
host.aaa.example.com and host.bbb.example.com even though the example.com
zone includes only delegations for the aaa.example.com and bbb.example.com
zones. A zone can map exactly to a single domain, but could also include
only part of a domain, the rest of which could be delegated to other
-nameservers. Every name in the DNS tree is a domain , even if it is terminal
-, that is, has no subdomains . Every subdomain is a domain and every domain
+nameservers. Every name in the DNS tree is a domain, even if it is terminal
+, that is, has no subdomains. Every subdomain is a domain and every domain
except the root is also a subdomain. The terminology is not intuitive and we
suggest that you read RFCs 1033, 1034 and 1035 to gain a complete
understanding of this difficult and subtle topic.
@@ -326,22 +324,22 @@ understanding of this difficult and subtle topic.
Though BIND is a Domain Nameserver, it deals primarily in terms of zones.
The master and slave declarations in the named.conf file specify zones, not
domains. When you ask some other site if it is willing to be a slave server
-for your domain , you are actually asking for slave service for some
+for your domain, you are actually asking for slave service for some
collection of zones.
-Each zone will have one primary master (also called primary ) server which
+Each zone will have one primary master (also called primary) server which
loads the zone contents from some local file edited by humans or perhaps
generated mechanically from some other local file which is edited by humans.
There there will be some number of slave (also called secondary) servers,
which load the zone contents using the DNS protocol (that is, the secondary
servers will contact the primary and fetch the zone data using TCP). This
set of servers--the primary and all of its secondaries--should be listed in
-the NS records in the parent zone and will constitute a delegation . This
+the NS records in the parent zone and will constitute a delegation. This
set of servers must also be listed in the zone file itself, usually under
the @ name which indicates the top level or root of the current zone. You
can list servers in the zone's top-level @ NS records that are not in the
parent's NS delegation, but you cannot list servers in the parent's
-delegation that are not present in the zone's @ .
+delegation that are not present in the zone's @.
Any servers listed in the NS records must be configured as authoritative for
the zone. A server is authoritative for a zone when it has been configured
@@ -363,8 +361,8 @@ the AA bit.
A DNS server can be master for some zones and slave for others or can be
only a master, or only a slave, or can serve no zones and just answer
-queries via its cache . Master servers are often also called primaries and
-slave servers are often also called secondaries . Both master/primary and
+queries via its cache. Master servers are often also called primaries and
+slave servers are often also called secondaries. Both master/primary and
slave/secondary servers are authoritative for a zone.
All servers keep data in their cache until the data expires, based on a Time
@@ -379,7 +377,7 @@ master server obtains data for the zone from a file on disk.
1.4.3.2 Slave Server
-A slave server , also called a secondary server , is an authoritative server
+A slave server, also called a secondary server, is an authoritative server
that uses zone transfers from the primary master server to retrieve the zone
data. Optionally, the slave server obtains zone data from a cache on disk.
Slave servers provide necessary redundancy. All secondary/slave servers are
@@ -387,7 +385,7 @@ named in the NS RRs for the zone.
1.4.3.3 Caching Only Server
-Some servers are caching only servers . This means that the server caches
+Some servers are caching only servers. This means that the server caches
the information that it receives and uses it until the data expires. A
caching only server is a server that is not authoritative for any zone. This
server services queries and asks other servers, who have the authority, for
@@ -398,7 +396,7 @@ the information it needs.
Instead of interacting with the nameservers for the root and other domains,
a forwarding server always forwards queries it cannot satisfy from its
authoritative data or cache to a fixed list of other servers. The forwarded
-queries are also known as recursive queries , the same type as a client
+queries are also known as recursive queries, the same type as a client
would send to a server. There may be one or more servers forwarded to, and
they are queried in turn until the list is exhausted or an answer is found.
A forwarding server is typically used when you do not wish all the servers
@@ -594,8 +592,8 @@ master server, the slave will check to see that its version of the zone is
the current version and, if not, initiate a transfer.
DNS Notify is fully documented in RFC 1996. See also the description of the
-zone option also-notify under Zone Transfers . More information about notify
-can be found under Boolean Options .
+zone option also-notify under Zone Transfers. More information about notify
+can be found under Boolean Options.
3.4 Nameserver Operations
@@ -609,7 +607,7 @@ the nameserver daemon. We describe several in this section
dig
-The domain information groper ( dig ) is a command line tool that can be
+The domain information groper ( dig) is a command line tool that can be
used to gather information from the Domain Name System servers. Dig has two
modes: simple interactive mode for a single query, and batch mode which
executes a query for each in a list of several query lines. All query
@@ -639,6 +637,9 @@ Usage
host [-aCdlrTwv] [-c class] [-N ndots] [-t type]
[-W timeout] [-R retries] hostname [server]
+For more information and a list of available commands and options, see the
+host man page.
+
nslookup
nslookup is a program used to query Internet domain nameservers. nslookup
@@ -672,7 +673,7 @@ For more information and a list of available commands and options, see the
nslookup man page.
Due to its arcane user interface and frequently inconsistent behavior, we do
-not recommend the use of nslookup , and it is not installed by default when
+not recommend the use of nslookup, and it is not installed by default when
installing BIND 9. Use dig instead.
3.4.1.2 Administrative Tools
@@ -681,16 +682,106 @@ Administrative tools play an integral part in the management of a server.
rndc
-The remote name daemon control ( rndc ) program is a program that allows the
-system administrator to control the operation of a nameserver. If you run
-rndc without any options it will display a usage message.
+The remote name daemon control (rndc) program allows the system
+administrator to control the operation of a nameserver. If you run
+rndc without any options it will display a usage message as follows:
-Usage:
+Usage: rndc [-c config] [-s server] [-p port] [-y key] command [command ...]
-rndc [-p port] [-m] server command [command ...]
+ command is one of the following for named:
+
+ *status Display ps(1) status of named.
+ *dumpdb Dump database and cache to /var/tmp/named_dump.db.
+ reload Reload configuration file and zones.
+ *stats Dump statistics to /var/tmp/named.stats.
+ *trace Increment debugging level by one.
+ *notrace Set debugging level to 0.
+ *querylog Toggle query logging.
+ *stop Stop the server.
+ *restart Restart the server.
+
+ * == not yet implemented
+
+As noted above, "reload" is the only command available for BIND 9.0.0.
+The other commands, and more, are planned to be implemented for future
+releases.
+
+A configuration file is required, since all communication with the
+server is authenticated with digital signatures that rely on a shared
+secret, and there is no way to provide that secret other than with a
+configuration file. The default location for the rndc configuration
+file is /etc/rndc.conf, but an alternate location can be specified
+with the "-c" option.
+
+The format of the configuration file is similar to that of named.conf, but
+limited to only three statements, the options{}, key{} and server{}
+statements. These statements are what associate the secret keys to the
+servers with which they are meant to be shared. The order of statements is not
+significant.
+
+The options{} statement has two clauses: default-server and
+default-key. default-server takes a host name or address argument and
+represents the server that will be contacted if no "-s" option is
+provided on the command line. default-key takes the name of the key
+as its argument, as defined by a key{} statement. In the future a
+default-port clause will be added to specify the port to which rndc
+should connect.
+
+The key{} statement names a key with its string argument. The string is
+required by the server to be a valid domain name, though it need not
+actually be hierarchical; thus, a string like "rndc_key" is a valid name.
+The key{} statement has two clauses: algorithm and secret. While the
+configuration parser will accept any string as the argument to algorithm,
+currently only the string "hmac-md5" has any meaning. The secret is a
+base-64 encoded string, typically generated with either dnssec-keygen or
+mmencode. The parser will happily accept an invalid base-64 string, but it
+will never work with the server because the server validates the
+base-64 of the secret for itself when loading its own configuration file.
+
+The server{} statement uses the key clause to associate a key{}-defined key
+with a server. The argument to the server{} statement is a host name or
+address (addresses must be double quoted). The argument to the key clause
+is the name of key as defined by the key{} statement. A port clause will
+be added to a future release to specify the port to which rndc should
+connect on the given server.
+
+A sample minimal configuration file is as follows:
+
+key rndc_key {
+ algorithm "hmac-md5";
+ secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
+};
+
+options {
+ default-server localhost;
+ default-key rndc_key;
+};
+
+This file, if installed as /etc/rndc.conf, would allow the command:
+
+$ rndc reload
+
+to connect to 127.0.0.1 port 953 and cause the nameserver to reload,
+if a nameserver on the local machine were running with following controls
+statements:
+
+controls {
+ inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
+};
+
+and it had an identical key statement for rndc_key.
+
+
+3.4.2 Signals
+
+Certain UNIX signals cause the name server to take specific actions, as
+described in the following table. These signals can be sent using the kill
+command.
+
+ SIGHUP Causes the server to read named.conf and reload the database.
+ SIGTERM Causes the server to clean up and exit.
+ SIGINT Causes the server to clean up and exit.
-For more information and a list of available commands and options, see the
-rndc man page.
------------------------------------------------------------------------
@@ -718,7 +809,7 @@ The zone files of dynamic zones must not be edited by hand. The zone file on
disk at any given time may not contain the latest changes performed by
dynamic update. The zone file is written to disk only periodically, and
changes that have occurred since the zone file was last written to disk are
-stored only in the zone's journal ( .jnl ) file. BIND 9 currently does not
+stored only in the zone's journal ( .jnl) file. BIND 9 currently does not
update the zone file when it exits as BIND 8 does, so editing the zone file
manually is unsafe even when the server has been shut down.
@@ -727,7 +818,7 @@ manually is unsafe even when the server has been shut down.
The incremental zone transfer (IXFR) protocol is a way for slave servers to
transfer only changed data, instead of having to transfer the entire zone.
The IXFR protocol is documented in RFC 1995. See the list of proposed
-standards in Appendix C .
+standards in Appendix C.
When acting as a master, BIND 9 supports IXFR for those zones where the
necessary change history information is available. These include master
@@ -774,23 +865,23 @@ space) and the other set will be on bastion hosts, which are "proxy" hosts
that can talk to both sides of its network, in the DMZ.
The internal servers will be configured to forward all queries, except
-queries for site1.internal , site2.internal , site1.example.com , and
-site2.example.com , to the servers in the DMZ. These internal servers will
-have complete sets of information for site1.example.com , site2.example.com
-, site1.internal , and site2.internal .
+queries for site1.internal, site2.internal, site1.example.com, and
+site2.example.com, to the servers in the DMZ. These internal servers
+will have complete sets of information for site1.example.com,
+site2.example.com, site1.internal, and site2.internal.
-To protect the site1.interna l and site2.internal domains, the internal
-nameservers must be configured to disallow all queries to these domains from
-any external hosts, including the bastion hosts.
+To protect the site1.internal and site2.internal domains, the internal
+nameservers must be configured to disallow all queries to these
+domains from any external hosts, including the bastion hosts.
-The external servers, which are on the bastion hosts, will be configured to
-serve the "public" version of the site1 and site2.example.com zones. This
-could include things such as the host records for public servers (
-www.example.com and ftp.example.com ), and mail exchange (MX) records (
-a.mx.example.com and b.mx.example.com ).
+The external servers, which are on the bastion hosts, will be
+configured to serve the "public" version of the site1 and
+site2.example.com zones. This could include things such as the host
+records for public servers (www.example.com and ftp.example.com), and
+mail exchange (MX) records (a.mx.example.com and b.mx.example.com).
In addition, the public site1 and site2.example.com zones should have
-special MX records that contain wildcard (`*') records pointing to the
+special MX records that contain wildcard ('*') records pointing to the
bastion hosts. This is needed because external mail servers do not have any
other way of looking up how to deliver mail to those internal hosts. With
the wildcard records, the mail will be delivered to the bastion host, which
@@ -814,7 +905,7 @@ In order for all this to work properly, internal clients will need to be
configured to query only the internal nameservers for DNS queries. This
could also be enforced via selective filtering on the network.
-If everything has been set properly, Example, Inc. 's internal clients will
+If everything has been set properly, Example, Inc.'s internal clients will
now be able to:
* Look up any hostnames in the site1 and site2.example.com zones.
@@ -829,7 +920,7 @@ Hosts on the Internet will be able to:
Here is an example configuration for the setup we just described above. Note
that this is only configuration information; for information on how to
-configure your zone files, see the Sample Configurations .
+configure your zone files, see the Sample Configurations.
Internal DNS server config:
@@ -890,9 +981,9 @@ bastion-ips-go-here; };
options {
...
...
- allow-transfer { none; }; // sample allow-transfer (no one)
- allow-query { internals; externals; }; // restrict query access
- allow-recursion { internals; externals; }; // restrict recursion
+ allow-transfer { none; }; // sample allow-transfer (no one)
+ allow-query { internals; externals; }; // restrict query access
+ allow-recursion { internals; externals; }; // restrict recursion
...
...
};
@@ -931,16 +1022,16 @@ BIND primarily supports TSIG for server to server communication. This
includes zone transfer, notify, and recursive query messages. Resolvers
based on newer versions of BIND 8 have limited support for TSIG.
-TSIG might be most useful for dynamic update. A primary server for a dynamic
-zone should use access control to control updates, but IP-based access
-control is insufficient. Key-based access control is far superior. See RFC
-2845 in the Proposed Standards section of the Appendix. The nsupdate program
-that is shipped with BIND 8 supports TSIG via the " -k " command line
-option.
+TSIG might be most useful for dynamic update. A primary server for a
+dynamic zone should use access control to control updates, but
+IP-based access control is insufficient. Key-based access control is
+far superior. See RFC 2845 in the Proposed Standards section of the
+Appendix. The nsupdate program supports TSIG via the " -k " and "-y"
+command line options.
4.4.1 Generate Shared Keys for Each Pair of Hosts
-A shared secret is generated to be shared between host1 and host2 . An
+A shared secret is generated to be shared between host1 and host2. An
arbitrary key name is chosen: "host1-host2.". The key name must be the same
on both hosts.
@@ -953,7 +1044,7 @@ will be digested with MD5 to produce a 128 bit key.
dnssec-keygen -a hmac-md5 -b 128 -n HOST host1-host2.
-The key is in the file Khost1-host2.+157+00000.private . Nothing directly
+The key is in the file Khost1-host2.+157+00000.private. Nothing directly
uses this file, but the base-64 encoded string following " Key :" can be
extracted from the file and used as a shared secret:
@@ -989,7 +1080,7 @@ key host1-host2. {
The algorithm, hmac-md5, is the only one supported by BIND. The secret is
the one generated above. Since this is a secret, it is recommended that
either named.conf be non-world readable, or the key directive be added to a
-non-world readable file that is included by named.conf .
+non-world readable file that is included by named.conf.
At this point, the key is recognized. This means that if the server receives
a message signed by this key, it can verify the signature. If the signature
@@ -997,9 +1088,9 @@ succeeds, the response is signed by the same key.
4.4.4 Instructing the Server to Use the Key
-Since keys are shared between two hosts only, the server must be told when
-keys are to be used. The following is added to the named.conf file for host1
-, if the IP address of host2 is 10.1.2.3:
+Since keys are shared between two hosts only, the server must be told
+when keys are to be used. The following is added to the named.conf
+file for host1, if the IP address of host2 is 10.1.2.3:
server 10.1.2.3 {
keys { host1-host2. ;};
@@ -1012,8 +1103,8 @@ If host1 sends a message that is a response to that address, the message
will be signed with the specified key. host1 will expect any responses to
signed messages to be signed with the same key.
-A similar statement must be present in host2 's configuration file (with
-host1 's address) for host2 to sign non-response messages to host1 .
+A similar statement must be present in host2's configuration file (with
+host1's address) for host2 to sign non-response messages to host1.
4.4.5 TSIG Key Based Access Control
@@ -1029,7 +1120,7 @@ This allows dynamic updates to succeed only if the request was signed by a
key named " host1-host2. ".
The more powerful update-policy statement is described Dynamic Update
-Policies .
+Policies.
4.4.6 Errors
@@ -1085,7 +1176,7 @@ BIND 9 does not ship with any tools that generate SIG(0) signed messages.
4.7 DNSSEC
Cryptographic authentication of DNS information is possible through the DNS
-Security ( DNSSEC ) extensions, defined in RFC 2535. This section describes
+Security ( DNSSEC) extensions, defined in RFC 2535. This section describes
the creation and use of DNSSEC signed zones.
In order to set up a DNSSEC secure zone, there are a series of steps which
@@ -1109,7 +1200,7 @@ The dnssec-keygen program is used to generate keys.
A secure zone must contain one or more zone keys. The zone keys will sign
all other records in the zone, as well as the zone keys of any secure
delegated zones. Zone keys must have the same name as the zone, a name type
-of ZONE , and must be usable for authentication. It is recommended that zone
+of ZONE, and must be usable for authentication. It is recommended that zone
keys be mandatory to implement a cryptographic algorithm; currently the only
key mandatory to implement an algorithm is DSA.
@@ -1120,7 +1211,7 @@ dnssec-keygen -a DSA -b 768 -n ZONE child.example.
Two output files will be produced: Kchild.example.+003+12345.key and
Kchild.example.+003+12345.private (where 12345 is an example of a key
-identifier). The key file names contain the key name ( child.example. ),
+identifier). The key file names contain the key name ( child.example.),
algorithm (3 is DSA, 1 is RSA, etc.), and the key identifier (12345 in this
case). The private key (in the .private file) is used to generate
signatures, and the public key (in the .key file) is used for signature
@@ -1145,17 +1236,17 @@ be included and the TTL of the set must be specified, and the desired
signature validity period of the parent's signature may also be specified.
The list of keys to be inserted into the key set may also included non-zone
-keys present at the apex. dnssec-makekeyset may also be used at non-apex
-names.
+keys present at the top of the zone. dnssec-makekeyset may also be used at other
+names in the zone.
The following command generates a key set containing the above key and
another key similarly generated, with a TTL of 3600 and a signature validity
period of 10 days starting from now.
-dnssec-makekeyset -t 3600 -s now -e now+864000 Kchild.example.+003+12345
+dnssec-makekeyset -t 3600 -e +864000 Kchild.example.+003+12345
Kchild.example.+003+23456
-One output file is produced: child.example.keyset . This file should be
+One output file is produced: child.example.keyset. This file should be
transmitted to the parent to be signed. It includes the keys, as well as
signatures over the key set generated by the zone keys themselves, which are
used to prove ownership of the private keys and encode the desired validity
@@ -1166,7 +1257,7 @@ period.
The dnssec-signkey program is used to sign one child's keyset.
If the child.example zone has any delegations which are secure, for example,
-grand.child.example , the child.example administrator should receive keyset
+grand.child.example, the child.example administrator should receive keyset
files for each secure subzone. These keys must be signed by this zone's zone
keys.
@@ -1175,7 +1266,7 @@ The following command signs the child's key set with the zone keys:
dnssec-signkey grand.child.example.keyset Kchild.example.+003+12345
Kchild.example.+003+23456
-One output file is produced: grand.child.example.signedkey . This file
+One output file is produced: grand.child.example.signedkey. This file
should be both transmitted back to the child and retained. It includes all
keys (the child's keys) from the keyset file and signatures generated by
this zone's zone keys.
@@ -1191,12 +1282,12 @@ well as incorporate the zone key signature from the parent and indicate the
security status at all delegation points.
The following command signs the zone, assuming it is in a file called
-zone.child.example . By default, all zone keys which have an available
+zone.child.example. By default, all zone keys which have an available
private key are used to generate signatures.
dnssec-signzone -o child.example zone.child.example
-One output file is produced: zone.child.example.signed . This file should be
+One output file is produced: zone.child.example.signed. This file should be
referenced by named.conf as the input file for the zone.
4.7.5 Configuring Servers
@@ -1270,12 +1361,12 @@ host 1h IN A6 64 0:0:0:0:42::1 company.example2.net.
ISP1 will use:
$ORIGIN example1.net.
-company 1h IN A6 0 3ffe:8050:201:1860::
+company 1h IN A6 0 3ffe:8050:201:1860::
ISP2 will use:
$ORIGIN example2.net.
-company 1h IN A6 0 1234:5678:90ab:fffa::
+company 1h IN A6 0 1234:5678:90ab:fffa::
When host.example.com is looked up, the resolver (in the resolver daemon or
caching name server) will find two partial A6 records, and will use the
@@ -1305,50 +1396,64 @@ supported for backwards compatiblity with existing IPv6 applications.
When looking up an address in nibble format, the address components are
simply reversed, just as in IPv4, and ip6.int. is appended to the resulting
name. For example, the following would provide reverse name lookup for a
-host with address 3ffe:8050:201:1860:42::1 .
+host with address 3ffe:8050:201:1860:42::1.
$ORIGIN 0.6.8.1.1.0.2.0.0.5.0.8.e.f.f.3.ip6.int.
-1.0.0.0.0.0.0.0.0.0.0.0.2.4.0.0 4h IN PTR host.example.com.
+1.0.0.0.0.0.0.0.0.0.0.0.2.4.0.0 4h IN PTR host.example.com.
4.8.4 Address to Name Lookups Using Bitstring Format
Bitstring labels can start and end on any bit boundary, rather than on a
multiple of 4 bits as in the nibble format. They also use ip6.arpa rather
-than ip6.int .
+than ip6.int.
To replicate the previous example using bitstrings:
$ORIGIN \[x3ffe805002011860/64].ip6.arpa.
-\[x0042000000000001/64] 4h IN PTR host.example.com.
+\[x0042000000000001/64] 4h IN PTR host.example.com.
4.8.5 Using DNAME for Delegation of IPv6 Reverse Addresses
-Delegation of reverse addresses is done through the new DNAME RR. In the
-example above, where \[x2/3].ip6.int. needs to delegate \[xFFF0] to an
-organization ( example2.com ), the domain administrator would insert a line
-similar to the following in the \[x2/3].ip6.int. zone:
+In IPV6, the same host may have many addresses from many network
+providers. Since the trailing portion of the address usually
+remains constant, DNAME can help reduce the number of zone files used
+for reverse mapping that need to be maintained.
-$ORIGIN \[x2/3].ip6.int.
-\[xFFF0/13] 1h IN DNAME ip6.example2.com.
+For example, consider a host which has two providers (example.net and
+example2.net) and therefore two IPv6 addresses. Since the host chooses
+its own 64 bit host address portion, the provider address is the only
+part that changes:
-example2.com would then place into the ip6 zone:
+$ORIGIN example.com.
+host A6 64 ::1234:5678:1212:5675 cust1.example.net.
+ A6 64 ::1234:5678:1212:5675 subnet5.example2.net.
-$ORIGIN ip6.example.com.
-\[x80500201/32] 1h IN DNAME ip6.example.com.
+$ORIGIN example.net.
+cust1 A6 48 0:0:0:dddd:: ipv6net.example.net.
+ipv6net A6 0 aa:bb:cccc::
-Finally, example.com needs to include in the ip6.example.com zone:
+$ORIGIN example2.net.
+subnet5 A6 48 0:0:0:1:: ipv6net2.example2.net.
+ipv6net2 A6 0 6666:5555:4::
-$ORIGIN ip6.example.com.
-\[x00090A0020FFFE812B32/80] 1h IN PTR host.example.com.
-We suggest that the top of your administrative control ( example.com , in
-this case) provide all the bits required for reverse and forward resolution
-to allow name resolution even if the network is disconnected from the
-Internet. This will also allow operation with DNSSEC if you set up a false
-trusted server for "." containing only delegations for your forward and
-reverse zones directly to the top of your administrative control. This
-should be signed with a key trusted by all of your clients, equivalent to
-the real key for ".".
+This sets up forward lookups. To handle the reverse lookups, the
+provider example.net would have:
+
+$ORIGIN \[x00aa00bbcccc/48].ip6.arpa.
+\[xdddd/16] DNAME ipv6-rev.example.com.
+
+and example2.net would have:
+
+$ORIGIN \[x666655550004/48].ip6.arpa.
+\[x0001/16] DNAME ipv6-rev.example.com.
+
+example.com needs only one zone file to handle both of these reverse
+mappings:
+
+$ORIGIN ipv6-rev.example.com.
+\[x1234567812125675/64] PTR host.example.com.
+
------------------------------------------------------------------------
@@ -1373,7 +1478,7 @@ simpler than the full DNS protocol.
5.2 Running a Resolver Daemon
To use the lightweight resolver interface, the system must run the resolver
-daemon lwresd .
+daemon lwresd.
Applications using the lightweight resolver library will make UDP requests
to the IPv4 loopback address (127.0.0.1) on port 921. The daemon will try to
@@ -1381,7 +1486,7 @@ find the answer to the questions "what are the addresses for host
foo.example.com ?" and "what are the names for IPv4 address 204.152.184.79?"
The daemon currently only looks in the DNS, but in the future it may use
-other sources such as /etc/hosts , NIS, etc.
+other sources such as /etc/hosts, NIS, etc.
The lwresd daemon is essentially a stripped-down, caching-only name server
that answers requests using the lightweight resolver protocol rather than
@@ -1402,7 +1507,7 @@ implemented using the new features found in BIND 9.
BIND 4 configuration files can be converted to the new format using the
shell script
-contrib/named-bootconf/named-bootconf.sh .
+contrib/named-bootconf/named-bootconf.sh.
6.1 Configuration File Elements
@@ -1414,62 +1519,67 @@ documentation:
acl_name The name of an address_match_list as defined by the acl
statement.
- address_match_list A list of one or more ip_addr , ip_prefix , key_id , or
- acl_name elements, as described in Address Match Lists
- .
+ address_match_list A list of one or more ip_addr, ip_prefix, key_id, or
+ acl_name elements, as described in Address Match Lists.
+
domain_name A quoted string which will be used as a DNS name, for
example " my.test.domain ".
dotted_decimal One or more integers valued 0 through 255 separated
- only by dots (`.'), such as 123 , 45.67 or 89.123.45.67
- .
+ only by dots ('.'), such as 123, 45.67 or 89.123.45.67.
+
ip4_addr An IPv4 address with exactly four elements in
dotted_decimal notation.
ip6_addr
- An IPv6 address, such as fe80::200:f8ff:fe01:9742 .
+ An IPv6 address, such as fe80::200:f8ff:fe01:9742.
- ip_addr
- An ip4_addr or ip6_addr .
+ ip_addr An ip4_addr or ip6_addr.
- An IP port number . number is limited to 0 through
- ip_port 65535, with values below 1024 typically restricted to
- root-owned processes. In some cases an asterisk (`*')
+ ip_port An IP port number. number is limited to 0 through
+ 65535, with values below 1024 typically restricted to
+ root-owned processes. In some cases an asterisk ('*')
character can be used as a placeholder to select a
random high-numbered port.
- An IP network specified as an ip_addr , followed by a
- ip_prefix slash (`/') and then the number of bits in the netmask.
+
+ An IP network specified as an ip_addr, followed by a
+ ip_prefix slash ('/') and then the number of bits in the netmask.
For example, 127/8 is the network 127.0.0.0 with
netmask 255.0.0.0 and 1.2.3.0/28 is network 1.2.3.0
- with netmask 255.255.255.240 .
- key_name A domain_name representing the name of a shared key, to
+ with netmask 255.255.255.240.
+
+ key_id A domain_name representing the name of a shared key, to
be used for transaction security.
- A non-negative integer with an entire range limited by
- number the range of a C language signed integer (2,147,483,647
+
+ key_list A list of one or more key_ids, separated by semicolons
+ and ending with a semicolon.
+
+ number A non-negative integer with an entire range limited by
+ the range of a C language signed integer (2,147,483,647
on a machine with 32 bit integers). Its acceptable
value might further be limited by the context in which
it is used.
- path_name A quoted string which will be used as a pathname, such
- as " zones/master/my.test.domain " .
- A number, the word unlimited , or the word default .
+ path_name A quoted string which will be used as a pathname, such
+ as " zones/master/my.test.domain ".
+
+ size_spec A number, the word unlimited, or the word default.
The maximum value of size_spec is that of unsigned long
integers on the machine. An unlimited size_spec
requests unlimited use, or the maximum available
amount. A default size_spec uses the limit that was in
force when the server was started.
-
- size_spec A number can optionally be followed by a scaling
+ A number can optionally be followed by a scaling
factor: K or k for kilobytes, M or m for megabytes, and
G or g for gigabytes, which scale by 1024, 1024*1024,
and 1024*1024*1024 respectively.
-
Integer storage overflow is currently silently ignored
during conversion of scaled values, resulting in values
less than intended, possibly even negative. Using
unlimited is the best way to safely set a really large
number.
- yes_or_no Either yes or no . The words true and false are also
- accepted, as are the numbers 1 and 0 .
+
+ yes_or_no Either yes or no. The words true and false are also
+ accepted, as are the numbers 1 and 0.
6.1.1 Address Match Lists
@@ -1495,7 +1605,7 @@ be any of the following:
statement
* a nested address match list enclosed in braces
-Elements can be negated with a leading exclamation mark (`!') and the match
+Elements can be negated with a leading exclamation mark ('!') and the match
list names "any," "none," "localhost" and "localnets" are predefined. More
information on those names can be found in the description of the acl
statement.
@@ -1512,7 +1622,7 @@ listen-on ports, or as a topology, and whether the element was negated.
When used as an access control list, a non-negated match allows access and a
negated match denies access. If there is no match, access is denied. The
-clauses allow-query , allow-transfer , allow-update and blackhole all use
+clauses allow-query, allow-transfer, allow-update and blackhole all use
address match lists this. Similarly, the listen-on option will cause the
server to not accept queries on any of the machine's addresses which do not
match the list.
@@ -1583,7 +1693,7 @@ For example:
# is a new comment, even though it is logically
# part of the previous comment.
-WARNING: you cannot use the semicolon (`;') character to start a comment
+WARNING: you cannot use the semicolon (';') character to start a comment
such as you would in a zone file. The semicolon indicates the end of a
configuration statement.
@@ -1596,11 +1706,11 @@ substatements, which are also terminated with a semicolon.
The following statements are supported:
-
-
acl defines a named IP address matching list, for access control
and other uses.
+
controls declares control channels to be used by the rndc utility.
+
include includes a file.
key specifies key information for use in authentication and
@@ -1611,9 +1721,13 @@ The following statements are supported:
options controls global server configuration options and sets
defaults for other statements.
+
server sets certain configuration options on a per-server basis.
+
trusted-keys defines trusted DNSSEC keys.
+
view defines a view.
+
zone defines a zone.
The logging and options statements may only occur once per configuration.
@@ -1635,8 +1749,6 @@ can be used elsewhere; no forward references are allowed.
The following ACLs are built-in:
-
-
any Matches all hosts.
none Matches no hosts.
localhost Matches the IP addresses of all interfaces on the system.
@@ -1648,36 +1760,41 @@ The following ACLs are built-in:
controls {
[ inet (ip_addr|*) port ip_port allow { address_match_list } ;
- [ inet...;[...]]]
- [ unix string permission number owner number group number ;
- [ unix...;[..]]]
+ keys { key_list };
+ [ inet...; ]
};
6.2.4 controls Statement Definition and Usage
The controls statement declares control channels to be used by system
administrators to affect the operation of the local nameserver. These
-control channels are used by the ndc utility to send commands to and
+control channels are used by the rndc utility to send commands to and
retrieve non-DNS results from a nameserver.
-A UNIX control channel is a "first in first out" (FIFO) named pipe in the
-file system, and access to it is controlled by normal file system
-permissions. It is created by named with the specified file mode bits (see
-the chmod(1) manual page), user and group owner. Note that, unlike chmod ,
-the mode bits specified for permission will normally have a leading 0 so the
-number is interpreted as octal. Also note that the user and group ownership
-specified as owner and group must be given as numbers, not names. It is
-recommended that the permissions be restricted to administrative personnel
-only to prevent random users on the system from having the ability to manage
-the local nameserver.
-
An inet control channel is a TCP/IP socket accessible to the Internet,
-created at the specified ip_port on the specified ip_addr . It is
-recommended that 127.0.0.1 be the only ip_addr used, and this only if you
-trust all non-privileged users on the local host to manage your nameserver.
+created at the specified ip_port on the specified ip_addr. If no port
+is specified, port 953 is used by default. "*" cannot be used for
+ip_port.
-The controls statement is not yet implemented in BIND 9. The server always
-listens for control connections on IP address 127.0.0.1, port 953.
+The ability to issue commands over the control channel is restricted
+by the allow and keys clauses. Connections to the control channel are
+permitted based on the address permissions in address_match_list.
+key_id members of the address_match_list are ignored, and instead are
+interpreted independently based the key_list. Each key_id in the
+key_list is allowed to be used to authenticate commands and responses
+given over the control channel by digitally signing each message
+between the server and a command client (see rndc in section 3.4.1.2).
+All commands to the control channel must be signed by one of its
+specified keys to be honored.
+
+For the initial release of BIND 9.0.0, only one command is possible
+over the command channel, the command to reload the server. We will
+expand command set in future releases.
+
+The UNIX control channel type of BIND 8 is not supported in BIND
+9.0.0, and is not expected to be added in future releases. If it is
+present in the controls statement from a BIND 8 configuration file, a
+non-fatal warning will be logged.
6.2.5 include Statement Grammar
@@ -1700,9 +1817,9 @@ secret string;
6.2.8 key Statement Definition and Usage
-The key statement defines a shared secret key for use with TSIG. See TSIG .
+The key statement defines a shared secret key for use with TSIG. See TSIG.
-The key_id , also known as the key name, is a domain name uniquely
+The key_id, also known as the key name, is a domain name uniquely
identifying the key. It can be used in a "server" statement to cause
requests sent to that server to be signed with this key, or in address match
lists to verify that incoming requests have been signed with a key matching
@@ -1710,7 +1827,7 @@ this name, algorithm, and secret.
The algorithm_id is a string that specifies a security/authentication
algorithm. The only algorithm currently supported with TSIG authentication
-is hmac-md5 . The secret_string is the secret to be used by the algorithm,
+is hmac-md5. The secret_string is the secret to be used by the algorithm,
and is treated as a base-64 encoded string.
6.2.9 logging Statement Grammar
@@ -1763,7 +1880,7 @@ as you want.
Every channel definition must include a clause that says whether messages
selected for the channel go to a file, to a particular syslog facility, or
are discarded. It can optionally also limit the message severity level that
-will be accepted by the channel (the default is info ), and whether to
+will be accepted by the channel (the default is info), and whether to
include a named -generated time stamp, the category name and/or severity
level (the default is not to include any).
@@ -1783,8 +1900,8 @@ trigger a reopen. The default behavior is not to limit the size of the file.
If you use the version log file option, then named will retain that many
backup versions of the file by renaming them when opening. For example, if
you choose to keep 3 old versions of the file lamers.log then just before it
-is opened lamers.log.1 is renamed to lamers.log.2 , lamers.log.0 is renamed
-to lamers.log.1 , and lamers.log is renamed to lamers.log.0 . No rolled
+is opened lamers.log.1 is renamed to lamers.log.2, lamers.log.0 is renamed
+to lamers.log.1, and lamers.log is renamed to lamers.log.0. No rolled
versions are kept by default; any existing log file is simply appended. The
unlimited keyword is synonymous with 99 in current BIND releases.
@@ -1802,13 +1919,13 @@ described in the syslog.conf man page. If you have a system which uses a
very old version of syslog that only uses two arguments to the openlog()
function, then this clause is silently ignored.
-The severity clause works like syslog 's "priorities," except that they can
-also be used if you are writing straight to a file rather than using syslog
-. Messages which are not at least of the severity level given will not be
-selected for the channel; messages of higher severity levels will be
-accepted.
+The severity clause works like syslog's "priorities," except that they
+can also be used if you are writing straight to a file rather than
+using syslog. Messages which are not at least of the severity level
+given will not be selected for the channel; messages of higher
+severity levels will be accepted.
-If you are using syslog , then the syslog.conf priorities will also
+If you are using syslog, then the syslog.conf priorities will also
determine what eventually passes through. For example, defining a channel
facility and severity as daemon and debug but only logging daemon.warning
via syslog.conf will cause messages of severity info and notice to be
@@ -1817,14 +1934,15 @@ warning or higher, then syslogd would print all messages it received from
the channel.
The server can supply extensive debugging information when it is in
-debugging mode. If the server's global debug level is greater than zero,
-then debugging mode will be active. The global debug level is set either by
-starting the named server with the " -d " flag followed by a positive
-integer, or by running rndc trace ( the latter method is not yet implemented
-). The global debug level can be set to zero, and debugging mode turned off,
-by running ndc notrace . All debugging messages in the server have a debug
-level, and higher debug levels give more detailed output. Channels that
-specify a specific debug severity, for example:
+debugging mode. If the server's global debug level is greater than
+zero, then debugging mode will be active. The global debug level is
+set either by starting the named server with the " -d " flag followed
+by a positive integer, or by running rndc trace (the latter method is
+not yet implemented). The global debug level can be set to zero, and
+debugging mode turned off, by running ndc notrace. All debugging
+messages in the server have a debug level, and higher debug levels
+give more detailed output. Channels that specify a specific debug
+severity, for example:
channel "specific_debug_level" {
file "foo";
@@ -1843,12 +1961,12 @@ then the category of the message will be logged as well. Finally, if
print-severity is on, then the severity level of the message will be logged.
The print- options may be used in any combination, and will always be
printed in the following order: time, category, severity. Here is an example
-where all three print- options are on:
+where all three print-options are on:
28-Feb-2000 15:05:32.863 general: notice: running
-There are four predefined channels that are used for named 's default
-logging as follows. How they are used is described in the category Phrase .
+There are four predefined channels that are used for named's default
+logging as follows. How they are used is described in the category Phrase.
channel "default_syslog" {
syslog daemon; // end to syslog's daemon
@@ -1881,16 +1999,16 @@ logging as follows. How they are used is described in the category Phrase .
};
The default_debug channel normally writes to a file named.run in the
-server's working directory. For security reasons, when the " -u " command
-line option is used, the named.run file is created only after named has
-changed to the new UID, and any debug output generated while named is
-starting up and still running as root is discarded. If you need to capture
-this output, you must run the server with the " -g " option and redirect
-standard error to a file.
+server's working directory. For security reasons, when the "-u"
+command line option is used, the named.run file is created only after
+named has changed to the new UID, and any debug output generated while
+named is starting up and still running as root is discarded. If you
+need to capture this output, you must run the server with the "-g"
+option and redirect standard error to a file.
-Once a channel is defined, it cannot be redefined. Thus you cannot alter the
-built-in channels directly, but you can modify the default logging by
-pointing categories at channels you have defined.
+Once a channel is defined, it cannot be redefined. Thus you cannot
+alter the built-in channels directly, but you can modify the default
+logging by pointing categories at channels you have defined.
6.2.10.2 The category Phrase
@@ -1921,7 +2039,7 @@ category "xfer-out" { "null"; };
category "notify" { "null"; };
Following are the available categories and brief descriptions of the types
-of log information they contain . More categories may be added in future
+of log information they contain. More categories may be added in future
BIND releases.
default The default category defines the logging options for those
@@ -1932,16 +2050,24 @@ BIND releases.
database Messages relating to the databases used internally by the name
server to store zone and cache data.
+
security Approval and denial of requests.
+
config Configuration file parsing and processing.
resolver DNS resolution, such as the recursive lookups performed on behalf
of clients by a caching name server.
+
xfer-in Zone transfers the server is receiving.
+
xfer-out Zone transfers the server is sending.
+
notify The NOTIFY protocol.
+
client Processing of client requests.
+
network Network operations.
+
update Dynamic updates.
6.2.11 options Statement Grammar
@@ -1995,10 +2121,19 @@ options {
[ transfer-source ip4_addr; ]
[ transfer-source-v6 ip6_addr; ]
[ also-notify { ip_addr; [ ip_addr; ... ] }; ]
- [ max-ixfr-log-size number; ] [ coresize size_spec ; ] [ datasize size_spec ; ] [ files size_spec ; ] [ stacksize size_spec ; ] [ cleaning-interval number; ] [ heartbeat-interval number; ] [ interface-interval number; ] [ statistics-interval number; ]
+ [ max-ixfr-log-size number; ]
+ [ coresize size_spec ; ]
+ [ datasize size_spec ; ]
+ [ files size_spec ; ]
+ [ stacksize size_spec ; ]
+ [ cleaning-interval number; ]
+ [ heartbeat-interval number; ]
+ [ interface-interval number; ]
+ [ statistics-interval number; ]
[ topology { address_match_list }; ]
[ sortlist { address_match_list }; ]
- [ rrset-order { order_spec ; [ order_spec ; ... ] ] }; [ lame-ttl number; ] [ max-ncache-ttl number; ]
+ [ rrset-order { order_spec ; [ order_spec ; ... ] ] };
+ [ lame-ttl number; ] [ max-ncache-ttl number; ]
[ max-cache-ttl number; ]
[ sig-validity-interval number ; ]
[ min-roots number; ]
@@ -2014,63 +2149,73 @@ occurrence is found, the first occurrence determines the actual options
used, and a warning will be generated. If there is no options statement, an
options block with each option set to its default will be used.
- The version the server should report via a query of
- version name version.bind in class chaos . The default is the
+ version The version the server should report via a query of
+ name version.bind in class chaos. The default is the
real version number of this server.
- The working directory of the server. Any non-absolute
+
+ directory The working directory of the server. Any non-absolute
pathnames in the configuration file will be taken as
relative to this directory. The default location for
- directory most server output files (e.g. named.run ) is this
+ most server output files (e.g. named.run) is this
directory. If a directory is not specified, the working
- directory defaults to ` . ', the directory from which
+ directory defaults to '.', the directory from which
the server was started. The directory specified should
be an absolute path.
- This option is obsolete. It was used in BIND 8 to
- named-xfer specify the pathname to the named-xfer program. In
+
+ named-xfer This option is obsolete. It was used in BIND 8 to
+ specify the pathname to the named-xfer program. In
BIND 9, no separate named-xfer program is needed; its
functionality is built into the name server.
- The domain appended to the names of all shared keys
- generated with TKEY . When a client requests a TKEY
+
+ tkey-domain The domain appended to the names of all shared keys
+ generated with TKEY. When a client requests a TKEY
exchange, it may or may not specify the desired name
- tkey-domain for the key. If present, the name of the shared key
+ for the key. If present, the name of the shared key
will be " client specified part " + " tkey-domain ".
Otherwise, the name of the shared key will be " random
hex digits " + " tkey-domain ". In most cases, the
domainname should be the server's domain name.
- The Diffie-Hellman key used by the server to generate
+
+ tkey-dhkey The Diffie-Hellman key used by the server to generate
shared keys with clients using the Diffie-Hellman mode
- tkey-dhkey of TKEY . The server must be able to load the public
+ of TKEY. The server must be able to load the public
and private keys from files in the working directory.
In most cases, the keyname should be the server's host
name.
- The pathname of the file the server dumps the database
- dump-file to when it receives SIGINT signal ( ndc dumpdb ). If
- not specified, the default is named_dump.db . Not yet
+
+ dump-file The pathname of the file the server dumps the database
+ to when it receives SIGINT signal (ndc dumpdb). If
+ not specified, the default is named_dump.db. Not yet
implemented in BIND 9.
- The pathname of the file the server writes memory usage
- memstatistics-file statistics to on exit. If not specified, the default is
- named.memstats . Not yet implemented in BIND 9.
- The pathname of the file the server writes its process
+
+ memstatistics-file The pathname of the file the server writes memory usage
+ statistics to on exit. If not specified, the default is
+ named.memstats. Not yet implemented in BIND 9.
+
+ pid-file The pathname of the file the server writes its process
ID in. If not specified, the default is operating
- pid-file system dependent, but is usually
- /var/run/named.pid or /etc/named.pid . The pid-file is
+ system dependent, but is usually
+ /var/run/named.pid or /etc/named.pid. The pid-file is
used by programs that want to send signals to the
running nameserver.
- The pathname of the file the server appends statistics
- statistics-file to. If not specified, the default is named.stats . Not
- yet implemented in BIND 9 .
+
+ statistics-file The pathname of the file the server appends statistics
+ to. If not specified, the default is named.stats. Not
+ yet implemented in BIND 9.
6.2.12.1 Boolean Options
- If yes , then the AA bit is always set on NXDOMAIN
+ auth-nxdomain If yes, then the AA bit is always set on NXDOMAIN
responses, even if the server is not actually
- auth-nxdomain authoritative. The default is no ; this is a change
+ authoritative. The default is no ; this is a change
from BIND 8. If you are using very old DNS software,
- you may need to set it to yes .
- This option was used in BIND 8 to enable checking for
- deallocate-on-exit memory leaks on exit. BIND 9 ignores the option and
+ you may need to set it to yes.
+
+ deallocate-on-exit This option was used in BIND 8 to enable checking for
+ memory leaks on exit. BIND 9 ignores the option and
always performs the checks.
- If yes , then the server treats all zones as if they
+
+ dialup If yes, then the server treats all zones as if they
are doing zone transfers across a dial on demand dialup
link, which can be brought up by traffic originating
from this server. This has different effects according
@@ -2078,80 +2223,87 @@ options block with each option set to its default will be used.
that it all happens in a short interval, once every
heartbeat-interval and hopefully during the one call.
It also suppresses some of the normal zone maintenance
- traffic. The default is no .
-
+ traffic. The default is no.
The dialup option may also be specified in the zone
statement, in which case it overrides the options
- dialup dialup statement.
-
+ dialup statement.
If the zone is a master then the server will send out a
NOTIFY request to all the slaves. This will trigger the
zone serial number check in the slave (providing it
supports NOTIFY) allowing the slave to verify the zone
while the connection is active.
-
If the zone is a slave or stub then the server will
suppress the regular "zone up to date" queries and only
perform them when the
heartbeat-interval expires. Not yet implemented in
BIND 9.
- In BIND 8, this option was used to enable simulating
- fake-iquery the obsolete DNS query type IQUERY. BIND 9 never does
+
+ fake-iquery In BIND 8, this option was used to enable simulating
+ the obsolete DNS query type IQUERY. BIND 9 never does
IQUERY simulation.
- (Information present outside of the authoritative nodes
+
+ fetch-glue (Information present outside of the authoritative nodes
in the zone is called glue information). If yes (the
default), the server will fetch glue resource records
it doesn't have when constructing the additional data
- fetch-glue section of a response. fetch-glue no can be used in
+ section of a response. fetch-glue no can be used in
conjunction with recursion no to prevent the server's
cache from growing or becoming corrupted (at the cost
of requiring more work from the client). Not yet
implemented in BIND 9.
- This option was incorrectly implemented in BIND 8, and
- has-old-clients is ignored by BIND 9. To achieve the intended effect of
- has-old-clients yes , specify the two separate options
+
+ has-old-clients This option was incorrectly implemented in BIND 8, and
+ is ignored by BIND 9. To achieve the intended effect of
+ has-old-clients yes, specify the two separate options
auth-nxdomain yes and rfc2308-type1 no instead.
- If yes , then statistics are kept for every host that
- host-statistics the nameserver interacts with. The default is no .
+
+ host-statistics If yes, then statistics are kept for every host that
+ the nameserver interacts with. The default is no.
Note: turning on host-statistics can consume huge
amounts of memory. Not yet implemented in BIND 9.
- This option is obsolete . It was used in BIND 8 to
+
+ maintain-ixfr-base This option is obsolete. It was used in BIND 8 to
determine whether a transaction log was kept for
- maintain-ixfr-base Incremental Zone Transfer. BIND 9 maintains a
+ Incremental Zone Transfer. BIND 9 maintains a
transaction log whenever possible. If you need to
disable outgoing incremental zone transfers, use
- provide-ixfr no .
- This option was used in BIND 8 to allow a domain name
+ provide-ixfr no.
+
+ multiple-cnames This option was used in BIND 8 to allow a domain name
to allow multiple CNAME records in violation of the DNS
standards. BIND 9 currently does not check for multiple
- multiple-cnames CNAMEs in zone data loaded from master files, but such
+ CNAMEs in zone data loaded from master files, but such
checks may be introduced in a later release. BIND 9
always strictly enforces the CNAME rules in dynamic
updates.
- If yes (the default), DNS NOTIFY messages are sent when
+
+ notify If yes (the default), DNS NOTIFY messages are sent when
a zone the server is authoritative for changes. See
- Notify , for more information. The notify option may
- notify also be specified in the zone statement, in which case
+ Notify, for more information. The notify option may
+ also be specified in the zone statement, in which case
it overrides the options notify statement. It would
only be necessary to turn off this option if it caused
- slaves to crash .
- If yes , and a DNS query requests recursion, then the
- server will attempt to do all the work required to
- recursion answer the query. If recursion is not on, the server
- will return a referral to the client if it doesn't know
- the answer. The default is yes . See also fetch-glue
- above.
- Setting this to yes will cause the server to send NS
- rfc2308-type1 records along with the SOA record for negative answers.
- The default is no . Not yet implemented in BIND 9 .
+ slaves to crash.
- use-id-pool This option is obsolete . BIND 9 always allocates query
+ recursion If yes, and a DNS query requests recursion, then the
+ server will attempt to do all the work required to
+ answer the query. If recursion is not on, the server
+ will return a referral to the client if it doesn't know
+ the answer. The default is yes. See also fetch-glue
+ above.
+
+ rfc2308-type1 Setting this to yes will cause the server to send NS
+ records along with the SOA record for negative answers.
+ The default is no. Not yet implemented in BIND 9.
+
+ use-id-pool This option is obsolete. BIND 9 always allocates query
IDs from a pool.
- This option was used in BIND 8 to make the server treat
- " \r " characters the same way as " " or " \t
- treat-cr-as-space ", to facilitate loading of zone files on a UNIX system
+
+ treat-cr-as-space This option was used in BIND 8 to make the server treat
+ "\r" characters the same way as " " or "\t",
+ to facilitate loading of zone files on a UNIX system
that were generated on an NT or DOS machine. In BIND 9,
- both UNIX " \n " and NT/DOS " \r\n " newlines are
+ both UNIX "\n" and NT/DOS "\r\n" newlines are
always accepted, and the option is ignored.
6.2.12.2 Forwarding
@@ -2164,10 +2316,9 @@ only on those queries for which the server is not authoritative and does not
have the answer in its cache.
-
- This option is only meaningful if the forwarders list is not
- empty. A value of first , the default, causes the server to
- forward query the forwarders first, and if that doesn't answer the
+ forward This option is only meaningful if the forwarders list is not
+ empty. A value of first, the default, causes the server to
+ query the forwarders first, and if that doesn't answer the
question the server will then look for the answer itself. If
only is specified, the server will only query the forwarders.
@@ -2188,8 +2339,6 @@ with the RFCs defining valid hostnames.
Three checking methods are available:
-
-
ignore No checking is done.
warn Names are checked against their expected client contexts. Invalid
@@ -2222,32 +2371,33 @@ Access to the server can be restricted based on the IP address of the
requesting system. See Address Match Lists for details on how to specify IP
address lists.
-
-
- Specifies which hosts are allowed to ask ordinary
+ allow-query Specifies which hosts are allowed to ask ordinary
questions. allow-query may also be specified in the zone
- allow-query statement, in which case it overrides the options
+ statement, in which case it overrides the options
allow-query statement. If not specified, the default is to
allow queries from all hosts.
- Specifies which hosts are allowed to make recursive
- allow-recursion queries through this server. If not specified, the default
+
+ allow-recursion Specifies which hosts are allowed to make recursive
+ queries through this server. If not specified, the default
is to allow recursive queries from all hosts.
- Specifies which hosts are allowed to receive zone
+
+ allow-transfer Specifies which hosts are allowed to receive zone
transfers from the server. allow-transfer may also be
- allow-transfer specified in the zone statement, in which case it
+ specified in the zone statement, in which case it
overrides the options allow-transfer statement. If not
specified, the default is to allow transfers from all
hosts.
- Specifies a list of addresses that the server will not
- blackhole accept queries from or use to resolve a query. Queries
+
+ blackhole Specifies a list of addresses that the server will not
+ accept queries from or use to resolve a query. Queries
from these addresses will not be responded to. The default
- is none . Not yet implemented in BIND 9.
+ is none. Not yet implemented in BIND 9.
6.2.12.5 Interfaces
The interfaces and ports that the server will answer queries from may be
specified using the listen-on option. listen-on takes an optional port, and
-an address_match_list . The server will listen on all interfaces allowed by
+an address_match_list. The server will listen on all interfaces allowed by
the address match list. If a port is not specified, port 53 will be used.
Multiple listen-on statements are allowed. For example,
@@ -2286,7 +2436,7 @@ on the IPv6 wildcard address.
If the server doesn't know the answer to a question, it will query other
nameservers. query-source specifies the address and port used for such
queries. For queries sent over IPv6, there is a separate query-source-v6
-option. If address is * or is omitted, a wildcard IP address ( INADDR_ANY )
+option. If address is * or is omitted, a wildcard IP address (INADDR_ANY)
will be used. If port is * or is omitted, a random unprivileged port will be
used. The defaults are
@@ -2303,32 +2453,36 @@ the amount of load that transfers place on the system. The following options
apply to zone transfers.
-
- Defines a global list of IP addresses that are also
+
+ also-notify Defines a global list of IP addresses that are also
sent NOTIFY messages whenever a fresh copy of the
zone is loaded. This helps to ensure that copies of
the zones will quickly converge on stealth servers.
- also-notify If an also-notify list is given in a zone statement,
+ If an also-notify list is given in a zone statement,
it will override the options also-notify statement.
- When a zone notify statement is set to no , the IP
+ When a zone notify statement is set to no, the IP
addresses in the global also-notify list will not be
sent NOTIFY messages for that zone. The default is
the empty list (no global notification list).
- Inbound zone transfers running longer than this many
- max-transfer-time-in minutes will be terminated. The default is 120
- minutes (2 hours).
- Inbound zone transfers making no progress in this
- max-transfer-idle-in many minutes will be terminated. The default is 60
- minutes (1 hour).
- Outbound zone transfers running longer than this
- max-transfer-time-out many minutes will be terminated. The default is 120
- minutes (2 hours).
- Outbound zone transfers making no progress in this
- many minutes will be terminated. The default is 60
- max-transfer-idle-out minutes
- (1 hour).
- Slave servers will periodically query master servers
+
+ max-transfer-time-in Inbound zone transfers running longer than this many
+ minutes will be terminated. The default is 120
+ minutes (2 hours).
+
+ max-transfer-idle-in Inbound zone transfers making no progress in this
+ many minutes will be terminated. The default is 60
+ minutes (1 hour).
+
+ max-transfer-time-out Outbound zone transfers running longer than this
+ many minutes will be terminated. The default is 120
+ minutes (2 hours).
+
+ max-transfer-idle-out Outbound zone transfers making no progress in this
+ many minutes will be terminated. The default is 60
+ minutes (1 hour).
+
+ serial-queries Slave servers will periodically query master servers
to find out if zone serial numbers have changed.
Each such query uses a minute amount of the slave
server's network bandwidth, but more importantly
@@ -2337,7 +2491,7 @@ apply to zone transfers.
respond. The serial-queries option sets the maximum
number of concurrent serial-number queries allowed
to be outstanding at any given time. The default is
- serial-queries 4. Note: If a server loads a large (tens or hundreds
+ 4. Note: If a server loads a large (tens or hundreds
of thousands) number of slave zones, then this limit
should be raised to the high hundreds or low
thousands, otherwise the slave server may never
@@ -2348,39 +2502,44 @@ apply to zone transfers.
resources. As with all tunable limits, this one
should be changed gently and monitored for its
effects. Not yet implemented in BIND 9.
- The server supports two zone transfer methods.
+
+ transfer-format The server supports two zone transfer methods.
one-answer uses one DNS message per resource record
transferred. many-answers packs as many resource
records as possible into a message. many-answers is
- transfer-format more efficient, but is only known to be understood
+ more efficient, but is only known to be understood
by BIND 9, BIND 8.x and patched versions of
- BIND 4.9.5. The default is many-answers .
+ BIND 4.9.5. The default is many-answers.
transfer-format may be overridden on a per-server
basis by using the server statement.
- The maximum number of inbound zone transfers that
- can be running concurrently. The default value is 10
- transfers-in . Increasing transfers-in may speed up the
+
+ transfers-in The maximum number of inbound zone transfers that
+ can be running concurrently. The default value is 10.
+ Increasing transfers-in may speed up the
convergence of slave zones, but it also may increase
the load on the local system.
- The maximum number of outbound zone transfers that
- transfers-out can be running concurrently. Zone transfer requests
+
+ transfers-out The maximum number of outbound zone transfers that
+ can be running concurrently. Zone transfer requests
in excess of the limit will be refused. The default
- value is 10 .
- The maximum number of inbound zone transfers that
+ value is 10.
+
+ transfers-per-ns The maximum number of inbound zone transfers that
can be concurrently transferring from a given remote
- nameserver. The default value is 2 . Increasing
- transfers-per-ns transfers-per-ns may speed up the convergence of
+ nameserver. The default value is 2. Increasing
+ transfers-per-ns may speed up the convergence of
slave zones, but it also may increase the load on
the remote nameserver. transfers-per-ns may be
overridden on a per-server basis by using the
transfers phrase of the server statement.
- transfer-source determines which local address will
+
+ transfer-source transfer-source determines which local address will
be bound to IPv4 TCP connections used to fetch zones
transferred inbound by the server. If not set, it
defaults to a system controlled value which will
usually be the address of the interface "closest to"
the remote end. This address must appear in the
- transfer-source remote end's allow-transfer option for the zone
+ remote end's allow-transfer option for the zone
being transferred, if one is specified. This
statement sets the transfer-source for all zones,
but can be overridden on a per-zone basis by
@@ -2388,7 +2547,7 @@ apply to zone transfers.
transfer-source statement within the zone block in
the configuration file.
- transfer-source-v6 The same as transfer-source , except zone transfers
+ transfer-source-v6 The same as transfer-source, except zone transfers
are performed using IPv6.
6.2.12.8 Resource Limits
@@ -2406,34 +2565,38 @@ description of size_spec in Configuration File Elements for more details.
- coresize The maximum size of a core dump. The default is default
- . Not yet implemented in BIND 9.
+ coresize The maximum size of a core dump. The default is default.
+ Not yet implemented in BIND 9.
datasize The maximum amount of data memory the server may use.
- The default is default . Not yet implemented in BIND 9.
+ The default is default. Not yet implemented in BIND 9.
+
The maximum number of files the server may have open
- concurrently. The default is unlimited . Note: on some
+ concurrently. The default is unlimited. Note: on some
operating systems the server cannot set an unlimited
value and cannot determine the maximum number of open
files files the kernel can support. On such systems, choosing
unlimited will cause the server to use the larger of the
rlim_max for RLIMIT_NOFILE and the value returned by
- sysconf(_SC_OPEN_MAX) . If the actual kernel limit is
+ sysconf(_SC_OPEN_MAX). If the actual kernel limit is
larger than this value, use limit files to specify the
limit explicitly. Not yet implemented in BIND 9.
- The max-ixfr-log-size will be used in a future release
- max-ixfr-log-size of the server to limit the size of the transaction log
+
+ max-ixfr-log-size The max-ixfr-log-size will be used in a future release
+ of the server to limit the size of the transaction log
kept for Incremental Zone Transfer. Not yet implemented
in BIND 9.
- The maximum number of simultaneous recursive lookups the
- recursive-clients server will perform on behalf of clients. The default is
- 100 .
+
+ recursive-clients The maximum number of simultaneous recursive lookups the
+ server will perform on behalf of clients. The default is
+ 100.
stacksize The maximum amount of stack memory the server may use.
- The default is default . Not yet implemented in BIND 9.
- The maximum number of simultaneous client TCP
- tcp-clients connections that the server will accept. The default is
- 100 .
+ The default is default. Not yet implemented in BIND 9.
+
+ tcp-clients The maximum number of simultaneous client TCP
+ connections that the server will accept. The default is
+ 100.
Resource limits are not yet implemented in BIND 9.
@@ -2441,27 +2604,30 @@ Resource limits are not yet implemented in BIND 9.
- The server will remove expired resource records from
- cleaning-interval the cache every cleaning-interval minutes. The default
- is 60 minutes. If set to 0 , no periodic cleaning will
+ cleaning-interval The server will remove expired resource records from
+ the cache every cleaning-interval minutes. The default
+ is 60 minutes. If set to 0, no periodic cleaning will
occur.
- The server will perform zone maintenance tasks for all
+
+ heartbeat-interval The server will perform zone maintenance tasks for all
zones marked dialup yes whenever this interval
- heartbeat-interval expires. The default is 60 minutes. Reasonable values
- are up to 1 day (1440 minutes). If set to 0 , no zone
+ expires. The default is 60 minutes. Reasonable values
+ are up to 1 day (1440 minutes). If set to 0, no zone
maintenance for these zones will occur. Not yet
implemented in BIND 9.
- The server will scan the network interface list every
+
+ interface-interval The server will scan the network interface list every
interface-interval minutes. The default is 60 minutes.
- If set to 0 , interface scanning will only occur when
- interface-interval the configuration file is loaded. After the scan,
+ If set to 0, interface scanning will only occur when
+ the configuration file is loaded. After the scan,
listeners will be started on any new interfaces
(provided they are allowed by the listen-on
configuration). Listeners on interfaces that have gone
away will be cleaned up.
- Nameserver statistics will be logged every
- statistics-interval statistics-interval minutes. The default is 60 . If
- set to 0 , no statistics will be logged. Not yet
+
+ statistics-interval Nameserver statistics will be logged every
+ statistics-interval minutes. The default is 60. If
+ set to 0, no statistics will be logged. Not yet
implemented in BIND 9.
6.2.12.10 Topology
@@ -2498,11 +2664,11 @@ The topology option is not yet implemented in BIND 9.
Resource Records (RRs) are the data associated with the names in a domain
name space. The data is maintained in the form of sets of RRs. The order of
RRs in a set is, by default, not significant. Therefore, to control the
-sorting of records in a set of resource records, or RRset , you must use the
+sorting of records in a set of resource records, or RRset, you must use the
sortlist statement.
RRs are explained more fully in See Types of Resource Records and When to
-Use Them . Specifications for RRs are documented in RFC 1035.
+Use Them. Specifications for RRs are documented in RFC 1035.
When returning multiple RRs the nameserver will normally return them in
Round Robin order, that is, after each request the first RR is put at the
@@ -2515,10 +2681,10 @@ configuring the nameservers, not all the clients.
The sortlist statement (see below) takes an address_match_list and
interprets it even more specifically than the topology statement does (see
-Topology ). Each top level statement in the sortlist must itself be an
+Topology). Each top level statement in the sortlist must itself be an
explicit address_match_list with one or two elements. The first element
(which may be an IP address, an IP prefix, an ACL name or a nested
-address_match_list ) of each top level list is checked against the source
+address_match_list) of each top level list is checked against the source
address of the query until a match is found.
Once the source address of the query has been matched, if the top level
@@ -2590,16 +2756,16 @@ An order_spec is defined as follows:
[ class class_name ][ type type_name ][ name "domain_name"]
order ordering
-If no class is specified, the default is ANY . If no type is specified, the
-default is ANY . If no name is specified, the default is " * ".
+If no class is specified, the default is ANY. If no type is specified, the
+default is ANY. If no name is specified, the default is "*".
The legal values for ordering are:
-
-
fixed Records are returned in the order they are defined in the zone
file.
+
random Records are returned in some random order.
+
cyclic Records are returned in a round-robin order.
For example:
@@ -2609,9 +2775,9 @@ For example:
order cyclic;
};
-will cause any responses for type A records in class IN that have "
-host.example.com " as a suffix, to always be returned in random order. All
-other records are returned in cyclic order.
+will cause any responses for type A records in class IN that have
+"host.example.com" as a suffix, to always be returned in random
+order. All other records are returned in cyclic order.
If multiple rrset-order statements appear, they are not combined--the last
one applies.
@@ -2628,30 +2794,33 @@ The rrset-order statement is not yet implemented in BIND 9.
6.2.12.13 Tuning
-
- Sets the number of seconds to cache a lame server
+ lame-ttl Sets the number of seconds to cache a lame server
indication. 0 disables caching. (This is NOT
- lame-ttl recommended.) Default is 600 (10 minutes). Maximum
+ recommended.) Default is 600 (10 minutes). Maximum
value is 1800 (30 minutes). Not yet implemented in
BIND 9.
- To reduce network traffic and increase performance
+
+ max-ncache-ttl To reduce network traffic and increase performance
the server stores negative answers. max-ncache-ttl
is used to set a maximum retention time for these
- max-ncache-ttl answers in the server in seconds. The default
+ answers in the server in seconds. The default
max-ncache-ttl is 10800 seconds (3 hours).
max-ncache-ttl cannot exceed 7 days and will be
silently truncated to 7 days if set to a greater
value.
- max-cache-ttl sets the maximum time for which the
- max-cache-ttl server will cache ordinary (positive) answers. The
+
+ max-cache-ttl max-cache-ttl sets the maximum time for which the
+ server will cache ordinary (positive) answers. The
default is one week (7 days).
- The minimum number of root servers that is required
- min-roots for a request for the root servers to be accepted.
- Default is 2 . Not yet implemented in BIND 9.
- Specifies the number of days into the future when
+
+ min-roots The minimum number of root servers that is required
+ for a request for the root servers to be accepted.
+ Default is 2. Not yet implemented in BIND 9.
+
+ sig-validity-interval Specifies the number of days into the future when
DNSSEC signatures automatically generated as a
- result of dynamic updates (see Dynamic Update ) will
- sig-validity-interval expire. The default is 30 days. The signature
+ result of dynamic updates (see Dynamic Update) will
+ expire. The default is 30 days. The signature
inception time is unconditionally set to one hour
before the current time to allow for a limited
amount of clock skew.
@@ -2660,8 +2829,8 @@ The rrset-order statement is not yet implemented in BIND 9.
use-ixfr is deprecated in BIND 9. If you need to disable IXFR to a
particular server or servers see the information on the provide-ixfr option
-in server Statement Definition and Usage . See also the description of IXFR
-in the section Incremental Zone Transfers (IXFR) .
+in server Statement Definition and Usage. See also the description of IXFR
+in the section Incremental Zone Transfers (IXFR).
6.2.13 server Statement Grammar
@@ -2681,13 +2850,13 @@ The server statement defines the characteristics to be associated with a
remote nameserver.
If you discover that a remote server is giving out bad data, marking it as
-bogus will prevent further queries to it. The default value of bogus is no .
+bogus will prevent further queries to it. The default value of bogus is no.
The bogus clause is not yet implemented in BIND 9.
The provide-ixfr clause determines whether the local server, acting as
master, will respond with an incremental zone transfer when the given remote
-server, a slave, requests it. If set to yes , incremental transfer will be
-provided whenever possible. If set to no , all transfers to the remote
+server, a slave, requests it. If set to yes, incremental transfer will be
+provided whenever possible. If set to no, all transfers to the remote
server will be nonincremental. If not set, the value of the provide-ixfr
option in the global options block is used as a default.
@@ -2704,7 +2873,7 @@ possible to disable the use of IXFR even when both master and slave claim to
support it, for example if one of the servers is buggy and crashes or
corrupts data when IXFR is used.
-The server supports two zone transfer methods. The first, one-answer , uses
+The server supports two zone transfer methods. The first, one-answer, uses
one DNS message per resource record transferred. many-answers packs as many
resource records as possible into a message. many-answers is more efficient,
but is only known to be understood by BIND 9, BIND 8.x, and patched versions
@@ -2770,7 +2939,7 @@ client query will be resolved in the context of the first view whose
match-clients list matches the client's IP address.
Zones defined within a view statement will be only be accessible to clients
-that match the view . By defining a zone of the same name in multiple views,
+that match the view. By defining a zone of the same name in multiple views,
different zone data can be given to different clients, for example,
"internal" and "external" clients in a split DNS setup.
@@ -2789,7 +2958,7 @@ statements specified on the top level of the configuration file are
considered to be part of this default view. If any explicit view statements
are present, all zone statements must occur inside view statements.
-A zone statement of type hint for the root zone (` . ') does not strictly
+A zone statement of type hint for the root zone ('.') does not strictly
define a zone. Therefore, it should not be included in a view statement.
Here is an example of a typical split DNS setup implemented using view
@@ -2857,14 +3026,15 @@ zone zone name [class] [{
master The server has a master copy of the data for the zone and will be
able to provide authoritative answers for it.
- A slave zone is a replica of a master zone. The masters list
+
+ slave A slave zone is a replica of a master zone. The masters list
specifies one or more IP addresses that the slave contacts to
update its copy of the zone. If a port is specified, the slave
then checks to see if the zone is current and zone transfers will
be done to the port given. If a file is specified, then the
replica will be written to this file whenever the zone is changed,
and reloaded from this file on a server restart. Use of a file is
- slave recommended, since it often speeds server start-up and eliminates
+ recommended, since it often speeds server start-up and eliminates
a needless waste of bandwidth. Note that for large numbers (in the
tens or hundreds of thousands) of zones per server, it is best to
use a two level naming scheme for zone file names. For example, a
@@ -2873,7 +3043,8 @@ zone zone name [class] [{
ex/example.com where ex/ is just the first two letters of the zone
name. (Most operating systems behave very slowly if you put 100K
files into a single directory.)
- A stub zone is similar to a slave zone, except that it replicates
+
+stub A stub zone is similar to a slave zone, except that it replicates
only the NS records of a master zone instead of the entire zone.
Stub zones are not a standard part of the DNS; they are a
peculiarity of BIND 4 and BIND 8 that relies heavily on the
@@ -2881,7 +3052,6 @@ zone zone name [class] [{
BIND 9 attempts to emulate the BIND 4/8 stub zone feature for
backwards compatibility, but we do not recommend its use in new
configurations.
- stub
In BIND 4/8, zone transfers of a parent zone included the NS
records from stub children of that zone. This meant that, in some
cases, users could get away with configuring child stubs only in
@@ -2890,21 +3060,23 @@ zone zone name [class] [{
master serving a parent zone has child stub zones configured, all
the slave servers for the parent zone also need to have the same
child stub zones configured..
- A "forward zone" is a way to configure forwarding on a per-domain
+
+ forward A "forward zone" is a way to configure forwarding on a per-domain
basis. A zone statement of type forward can contain a forward
and/or forwarders statement, which will apply to queries within
the domain given by the zone name. If no forwarders statement is
present or an empty list for forwarders is given, then no
- forward forwarding will be done for the domain, cancelling the effects of
+ forwarding will be done for the domain, cancelling the effects of
any forwarders in the options statement. Thus if you want to use
this type of zone to change the behavior of the global forward
option (that is, "forward first to", then "forward only", or vice
versa, but want to use the same servers as set globally) you need
to respecify the global forwarders. Domain-specific forwarding is
not yet implemented in BIND 9.
- The initial set of root nameservers is specified using a "hint
+
+ hint The initial set of root nameservers is specified using a "hint
zone". When the server starts up, it uses the root hints to find a
- hint root nameserver and get the most recent list of root nameservers.
+ root nameserver and get the most recent list of root nameservers.
If no hint zone is specified for class IN, the server users a
compiled-in default set of root servers hints. Classes other than
IN have no built-in defaults hints.
@@ -2912,7 +3084,7 @@ zone zone name [class] [{
6.2.20.2 Class
The zone's name may optionally be followed by a class. If a class is not
-specified, class IN (for Internet ), is assumed. This is correct for the
+specified, class IN (for Internet), is assumed. This is correct for the
vast majority of cases.
The hesiod class is named for an information service from MIT's Project
@@ -2926,82 +3098,92 @@ mid-1970s. Zone data for it can be specified with the CHAOS class.
6.2.20.3 Zone Options
allow-query See the description of allow-query under Access
- Control .
+ Control.
allow-transfer See the description of allow-transfer under Access
- Control .
- Specifies which hosts are allowed to submit
- allow-update Dynamic DNS updates for master zones. The default
- is to deny updates from all hosts.
+ Control.
+
+ allow-update Specifies which hosts are allowed to submit Dynamic DNS
+ updates for master zones. The default is to deny updates
+ from all hosts.
update-policy Specifies a "Simple Secure Update" policy. See
- description in Dynamic Update Policies .
- Specifies which hosts are allowed to submit
+ description in Dynamic Update Policies.
+
+ allow-update-forwarding Specifies which hosts are allowed to submit
Dynamic DNS updates to slave zones to be forwarded
- allow-update-forwarding to the master. The default is to deny update
+ to the master. The default is to deny update
forwarding from all hosts. Update forwarding is
not yet implemented.
- Only meaningful if notify is active for this zone.
- The set of machines that will receive a DNS NOTIFY
- message for this zone is made up of all the listed
- also-notify nameservers (other than the primary master) for
- the zone plus any IP addresses specified with
- also-notify .
- also-notify is not meaningful for stub zones. The
- default is the empty list .
- check-names See Name Checking .
+ also-notify Only meaningful if notify is active for this zone. The
+ set of machines that will receive a DNS
+ NOTIFY message for this zone is made up of
+ all the listed nameservers (other than the
+ primary master) for the zone plus any IP
+ addresses specified with also-notify.
+ also-notify is not meaningful for stub
+ zones. The default is the empty list.
+
+ check-names See Name Checking.
Not yet implemented in BIND 9.
- See the description of dialup under Boolean
- dialup Options .
+
+ dialup See the description of dialup under Boolean
+ Options.
Not yet implemented in BIND 9.
- Only meaningful if the zone has a forwarders list.
+
+ forward Only meaningful if the zone has a forwarders list.
The only value causes the lookup to fail after
- forward trying the forwarders and getting no answer, while
+ trying the forwarders and getting no answer, while
first would allow a normal lookup to be tried.
Not yet implemented in BIND 9.
- Used to override the list of global forwarders. If
- it is not specified in a zone of type forward , no
- forwarders forwarding is done for the zone; the global
- options are not used.
+ forwarders Used to override the list of global forwarders. If
+ it is not specified in a zone of type forward, no
+ forwarding is done for the zone; the global
+ options are not used.
Not yet implemented in BIND 9.
- Was used in BIND 8 to specify the name of the
+
+ ixfr-base Was used in BIND 8 to specify the name of the
transaction log (journal) file for dynamic update
- ixfr-base and IXFR. BIND 9 ignores the option and constructs
- the name of the journal file by appending ". jnl "
+ and IXFR. BIND 9 ignores the option and constructs
+ the name of the journal file by appending ".jnl"
to the name of the zone file.
max-transfer-time-in See the description of
- max-transfer-time-in under Zone Transfers .
+ max-transfer-time-in under Zone Transfers.
max-transfer-idle-in See the description of
- max-transfer-idle-in under Zone Transfers .
+ max-transfer-idle-in under Zone Transfers.
max-transfer-time-out See the description of
- max-transfer-time-out under Zone Transfers .
+ max-transfer-time-out under Zone Transfers.
max-transfer-idle-out See the description of
- max-transfer-idle-out under Zone Transfers .
+ max-transfer-idle-out under Zone Transfers.
notify See the description of notify under Boolean
- Options .
- In BIND 8, this option was intended for specifying
+ Options.
+
+ pubkey In BIND 8, this option was intended for specifying
a public zone key for verification of signatures
- pubkey in DNSSEC signed zones when they are loaded from
+ in DNSSEC signed zones when they are loaded from
disk. BIND 9 does not verify signatures on loading
and ignores the option.
sig-validity-interval See the description of sig-validity-interval in
- Tuning .
- Determines which local address will be bound to
- the IPv4 TCP connection used to fetch this zone.
- If not set, it defaults to a system controlled
- transfer-source value which will usually be the address of the
- interface "closest to" the remote end. This
- address must appear in the remote end's
- allow-transfer option for this zone if one is
- specified.
+ Tuning.
+
+ transfer-source Determines which local address will be bound
+ to the IPv4 TCP connection used to fetch this
+ zone. If not set, it defaults to a system
+ controlled value which will
+ usually be the address of the interface
+ "closest to" the remote end. If the remote
+ end user is an allow-transfer option for
+ this zone, the address, supplied by the
+ transfer-source option, needs to be specified
+ in that allow-transfer option.
transfer-source-v6 Similar to transfer-source, but for zone transfers
performed using IPv6.
@@ -3040,7 +3222,7 @@ identity field, the name matches the name field, and the type is specified
in the type field.
The identity field specifies a name or a wildcard name. The nametype field
-has 4 values: name , subdomain , wildcard , and self .
+has 4 values: name, subdomain, wildcard, and self.
name Matches when the updated name is the same as the name in the
name field.
@@ -3096,37 +3278,53 @@ The following are types of valid RRs (some of these listed, although not
obsolete, are experimental (x) or historical (h) and no longer in general
use):
- A a host address.
- A6 an IPv6 address.
- AAAA Obsolete format of IPv6 address
+ A a host address.
+
+ A6 an IPv6 address.
+
+ AAAA Obsolete format of IPv6 address
+
AFSDB(x) location of AFS database servers. Experimental.
- CNAMEidentifies the canonical name of an alias.
- DNAMEfor delegation of reverse addresses. Replaces the domain name
- specified with another name to be looked up. Described in RFC 2672.
- HINFOidentifies the CPU and OS used by a host.
- ISDN (x) representation of ISDN addresses. Experimental.
- KEY stores a public key associated with a DNS name.
- LOC (x) for storing GPS info. See RFC 1876. Experimental.
- MX identifies a mail exchange for the domain. See RFC 974 for details.
- NS the authoritative nameserver for the domain.
- used in DNSSEC to securely indicate that RRs with an owner name in a
- NXT certain name interval do not exist in a zone and indicate what RR
- types are present for an existing name. See RFC 2535 for details.
- PTR a pointer to another part of the domain name space.
- RP (x) information on persons responsible for the domain. Experimental.
+ CNAME identifies the canonical name of an alias.
- RT (x) route-through binding for hosts that do not have their own direct
- wide area network addresses. Experimental.
+ DNAME for delegation of reverse addresses. Replaces the domain name
+ specified with another name to be looked up. Described in RFC 2672.
- SIG ("signature") contains data authenticated in the secure DNS. See RFC
- 2535 for details.
- SOA identifies the start of a zone of authority.
- SRV information about well known network services (replaces WKS).
+ HINFO identifies the CPU and OS used by a host.
- WKS (h) information about which well known network services, such as
- SMTP, that a domain supports. Historical, replaced by newer RR SRV.
- X25 (x) representation of X.25 network addresses. Experimental.
+ ISDN (x) representation of ISDN addresses. Experimental.
+
+ KEY stores a public key associated with a DNS name.
+
+ LOC (x) for storing GPS info. See RFC 1876. Experimental.
+
+ MX identifies a mail exchange for the domain. See RFC 974 for details.
+
+ NS the authoritative nameserver for the domain.
+ used in DNSSEC to securely indicate that RRs with an owner name in a
+
+ NXT certain name interval do not exist in a zone and indicate what RR
+ types are present for an existing name. See RFC 2535 for details.
+
+ PTR a pointer to another part of the domain name space.
+
+ RP (x) information on persons responsible for the domain. Experimental.
+
+ RT (x) route-through binding for hosts that do not have their own direct
+ wide area network addresses. Experimental.
+
+ SIG ("signature") contains data authenticated in the secure DNS. See RFC
+ 2535 for details.
+
+ SOA identifies the start of a zone of authority.
+
+ SRV information about well known network services (replaces WKS).
+
+ WKS (h) information about which well known network services, such as
+ SMTP, that a domain supports. Historical, replaced by newer RR SRV.
+
+ X25 (x) representation of X.25 network addresses. Experimental.
The following classes of resource records are currently valid in the DNS:
@@ -3137,21 +3335,26 @@ The following classes of resource records are currently valid in the DNS:
RDATA is the type-dependent or class-dependent data that describes the
resource:
- A for the IN class, a 32 bit IP address.
+ A for the IN class, a 32 bit IP address.
- A6 maps a domain name to an IPv6 address, with a provision for
- indirection for leading "prefix" bits.
- CNAMEa domain name.
- provides alternate naming to an entire subtree of the domain name
- DNAMEspace, rather than to a single node. It causes some suffix of a
- queried name to be substituted with a name from the DNAME record's
- RDATA.
+ A6 maps a domain name to an IPv6 address, with a provision for
+ indirection for leading "prefix" bits.
- MX a 16 bit preference value (lower is better) followed by a host name
- willing to act as a mail exchange for the owner domain.
- NS a fully qualified domain name.
- PTR a fully qualified domain name.
- SOA several fields.
+ CNAME a domain name.
+ provides alternate naming to an entire subtree of the domain name
+
+ DNAME space, rather than to a single node. It causes some suffix of a
+ queried name to be substituted with a name from the DNAME record's
+ RDATA.
+
+ MX a 16 bit preference value (lower is better) followed by a host name
+ willing to act as a mail exchange for the owner domain.
+
+ NS a fully qualified domain name.
+
+ PTR a fully qualified domain name.
+
+ SOA several fields.
The owner name is often implicit, rather than forming an integral part of
the RR. For example, many nameservers internally form tree or hash
@@ -3218,7 +3421,7 @@ Similarly we might see:
XX.LCS.MIT.EDU. IN A 10.0.0.44
CH A MIT.EDU. 2420
-This example shows two addresses for XX.LCS.MIT.EDU , each of a different
+This example shows two addresses for XX.LCS.MIT.EDU, each of a different
class.
6.3.2 Discussion of MX Records
@@ -3264,21 +3467,20 @@ describes how long a RR can be cached before it should be discarded. The
following three types of TTL are currently used in a zone file.
+ SOA The last field in the SOA is the negative caching TTL. This
+ controls how long other servers will cache no-such-domain
+ (NXDOMAIN) responses from you.
- The last field in the SOA is the negative caching TTL. This
- controls how long other servers will cache no-such-domain
- SOA (NXDOMAIN) responses from you.
+ The maximum time for negative caching is 3 hours (3h).
- The maximum time for negative caching is 3 hours (3h).
+ $TTL The $TTL directive at the top of the zone file (before the SOA)
+ gives a default TTL for every RR without a specific TTL set.
- $TTL The $TTL directive at the top of the zone file (before the SOA)
- gives a default TTL for every RR without a specific TTL set.
-
- RR TTLsEach RR can have a TTL as the second field in the RR, which will
- control how long other servers can cache the it.
+ RR TTLs Each RR can have a TTL as the second field in the RR, which will
+ control how long other servers can cache the it.
All of these TTLs default to units of seconds, though units can be
-explicitly specified, for example, 1h30m .
+explicitly specified, for example, 1h30m.
6.3.4 Inverse Mapping in IPv4
@@ -3309,16 +3511,16 @@ The Master File Format was initially defined in RFC 1035 and has
subsequently been extended. While the Master File Format itself is class
independent all records in a Master File must be of the same class.
-Master File Directives include $ORIGIN , $INCLUDE , and $TTL.
+Master File Directives include $ORIGIN, $INCLUDE, and $TTL.
6.3.5.1 The $ORIGIN Directive
Syntax: $ORIGIN < domain-name > [ < comment > ]
$ORIGIN sets the domain name that will be appended to any unqualified
-records. When a zone is first read in there is an implicit $ORIGIN <
-zone-name > . The current $ORIGIN is appended to the domain specified in the
-$ORIGIN argument if it is not absolute.
+records. When a zone is first read in there is an implicit $ORIGIN
+. The current $ORIGIN is appended to the domain specified
+in the $ORIGIN argument if it is not absolute.
$ORIGIN example.com
WWW CNAME MAIN-SERVER
@@ -3375,32 +3577,23 @@ is equivalent to
- This can be one of two forms: start-stop or start-stop/step. If the
- range first form is used then step is set to 1. All of start, stop and
+ range This can be one of two forms: start-stop or start-stop/step. If the
+ first form is used then step is set to 1. All of start, stop and
step must be positive.
- lhs describes the owner name of the resource records to be created.
+
+ lhs lhs describes the owner name of the resource records to be created.
Any single $ symbols within the lhs side are replaced by the
- lhs iterator value. To get a $ in the output use a double $ , e.g. $$ .
+ iterator value. To get a $ in the output use a double $, e.g. $$.
If the lhs is not absolute, the current $ORIGIN is appended to the
name.
+
type At present the only supported types are PTR, CNAME and NS.
+
rhs rhs is a domain name. It is processed similarly to lhs.
The $GENERATE directive is a BIND extension and not part of the standard
zone file format. It is not yet implemented in BIND 9.
-6.3.7 Signals
-
-Certain UNIX signals cause the name server to take specific actions, as
-described in the following table. These signals can be sent using the kill
-command.
-
-
-
- SIGHUP Causes the server to read named.conf and reload the database.
- SIGTERM Causes the server to clean up and exit.
- SIGINT Causes the server to clean up and exit.
- SIGQUIT Causes the server to clean up and exit.
------------------------------------------------------------------------
@@ -3409,8 +3602,8 @@ command.
7.1 Access Control Lists
Access Control Lists (ACLs), are address match lists that you can set up and
-nickname for future use in allow-query , allow-recursion , blackhole ,
-allow-transfer , etc.
+nickname for future use in allow-query, allow-recursion, blackhole,
+allow-transfer, etc.
Using ACLs allows you to have finer control over who can access your
nameserver, without cluttering up your config files with huge lists of IP
@@ -3458,25 +3651,25 @@ ftp://ftp.auscert.org.au/pub/auscert/advisory/AL-1999.004.dns_dos
7.2 chroot and setuid (for UNIX servers)
On UNIX servers, it is possible to run BIND in a chrooted environment (
-chroot() ) by specifying the " -t " option. This can help improve system
+chroot() ) by specifying the "-t" option. This can help improve system
security by placing BIND in a "sandbox," which will limit the damage done if
a server is compromised.
Another useful feature in the UNIX version of BIND is the ability to run the
-daemon as a nonprivileged user ( -u user ). We suggest running as a
+daemon as a nonprivileged user (-u user). We suggest running as a
nonprivileged user when using the chroot feature.
Here is an example command line to load BIND in a chroot() sandbox,
-/var/named , and to run named setuid to user 202:
+/var/named, and to run named setuid to user 202:
/usr/local/bin/named -u 202 -t /var/named
7.2.1 The chroot Environment
In order for a chroot() environment to work properly in a particular
-directory (for example, /var/named ), you will need to set up an environment
+directory (for example, /var/named), you will need to set up an environment
that includes everything BIND needs to run. From BIND's point of view,
-/var/named is the root of the filesystem. You will need /dev/null , and any
+/var/named is the root of the filesystem. You will need /dev/null, and any
library directories and files that BIND needs to run on your system. Please
consult your operating system's instructions if you need help figuring out
which library files you need to copy over to the chroot() sandbox.
@@ -3629,8 +3822,8 @@ IPv6 addresses (A6)
IPv6 addresses are 128-bit identifiers for interfaces and sets of interfaces
which were introduced in the DNS to facilitate scalable Internet routing.
-There are three types of addresses: Unicast , an identifier for a single
-interface; Anycast , an identifier for a set of interfaces; and Multicast ,
+There are three types of addresses: Unicast, an identifier for a single
+interface; Anycast, an identifier for a set of interfaces; and Multicast,
an identifier for a set of interfaces. Here we describe the global Unicast
address scheme. For more information, see RFC 2374.
@@ -3640,26 +3833,24 @@ The aggregatable global Unicast address format is as follows:
3 13 8 24 16 64 bits
FP TLA ID RES NLA ID SLA ID Interface ID
- <------ Public Topology
- ------>
+ <-- Public Topology -->
<-Site Topology->
- <------ Interface Identifier
- ------>
+ <- Interface Identifier ->
Where
- FP = Format Prefix (001)
- TLA ID = Top-Level Aggregation Identifier
- RES = Reserved for future use
- NLA ID = Next-Level Aggregation Identifier
- SLA ID = Site-Level Aggregation Identifier
- INTERFACE ID= Interface Identifier
+ FP = Format Prefix (001)
+ TLA ID = Top-Level Aggregation Identifier
+ RES = Reserved for future use
+ NLA ID = Next-Level Aggregation Identifier
+ SLA ID = Site-Level Aggregation Identifier
+ INTERFACE ID = Interface Identifier
The Public Topology is provided by the upstream provider or ISP, and
(roughly) corresponds to the IPv4 network section of the address range. The
Site Topology is where you can subnet this space, much the same as
-subnetting an IPv4 class A or B network into class Cs. The Interface
+subnetting an IPv4 /16 network into /24 subnets. The Interface
Identifier is the address of an individual interface on a given network.
(With IPv6, addresses belong to interfaces rather than machines.)
@@ -3672,8 +3863,8 @@ address consists of:
- 3 13 8 24
- FPTLA ID RES NLA ID
+ 3 13 8 24
+ FP TLA ID RES NLA ID
A 3 bit FP (Format Prefix) of 001 indicates this is a global Unicast
address. FP lengths for other types of addresses may vary.
@@ -3689,8 +3880,7 @@ client can then split up the network further by filling in more NLA bits,
and hand out IPv6 prefixes to their clients, and so forth.
There is no particular structure for the Site topology section.
-Organizations can allocate these bits in any way they desire, in the same
-way as they would subnet an IPv4 class A (8-bit prefix) network.
+Organizations can allocate these bits in any way they desire.
The Interface Identifier must be unique on that network. On ethernet
networks, one way to ensure this is to set the address to the first three
@@ -3703,7 +3893,7 @@ colon, and leading zeros of a block may be omitted, for example:
IPv6 address specifications are likely to contain long strings of zeros, so
the architects have included a shorthand for specifying them. The double
-colon (`::') indicates the longest possible string of zeros that can fit,
+colon ('::') indicates the longest possible string of zeros that can fit,
and can be used only once in an address.
Bibliography (and Suggested Reading)
@@ -3716,13 +3906,13 @@ notes. The standards themselves are defined by the Internet Engineering Task
Force (IETF) and the Internet Engineering Steering Group (IESG). RFCs can be
obtained online via FTP at
ftp://www.isi.edu/in-notes/RFCxxx.txt (where xxx is the number of the RFC).
-RFCs are also available via the Web at http://www.ietf.org/rfc/ .
+RFCs are also available via the Web at http://www.ietf.org/rfc/.
Standards
-RFC974. Partridge, C. Mail Routing and the Domain System . January 1986.
+RFC974. Partridge, C. Mail Routing and the Domain System. January 1986.
-RFC1034. Mockapetris, P.V. Domain Names - Concepts and Facilities . P.V.
+RFC1034. Mockapetris, P.V. Domain Names - Concepts and Facilities. P.V.
November 1987.
RFC1035. Mockapetris, P. V. Domain Names - Implementation and Specification
@@ -3730,33 +3920,33 @@ RFC1035. Mockapetris, P. V. Domain Names - Implementation and Specification
Proposed Standards
-RFC2181. Elz, R., R. Bush. Clarifications to the DNS Specification . July
+RFC2181. Elz, R., R. Bush. Clarifications to the DNS Specification. July
1997.
-RFC2308. Andrews, M. Negative Caching of DNS Queries . March 1998.
+RFC2308. Andrews, M. Negative Caching of DNS Queries. March 1998.
-RFC1995. Ohta, M. Incremental Zone Transfer in DNS . August 1996.
+RFC1995. Ohta, M. Incremental Zone Transfer in DNS. August 1996.
-RFC1996. Vixie, P. A Mechanism for Prompt Notification of Zone Changes .
+RFC1996. Vixie, P. A Mechanism for Prompt Notification of Zone Changes.
August 1996.
RFC2136. Vixie, P., S. Thomson, Y. Rekhter, J. Bound. Dynamic Updates in the
-Domain Name System . April 1997.
+Domain Name System. April 1997.
RFC2845. Vixie, P., O. Gudmundsson, D. Eastlake 3rd, B. Wellington. Secret
-Key Transaction Authentication for DNS (TSIG) . May 2000.
+Key Transaction Authentication for DNS (TSIG). May 2000.
Proposed Standards Still Under Development
Note: the following list of RFCs are undergoing major revision by the IETF.
-RFC1886. Thomson, S., C. Huitema. DNS Extensions to support IP version 6 .
+RFC1886. Thomson, S., C. Huitema. DNS Extensions to support IP version 6.
S. December 1995.
RFC2065. Eastlake, 3rd, D., C. Kaufman. Domain Name System Security
-Extensions . January 1997.
+Extensions. January 1997.
-RFC2137. Eastlake, 3rd, D. Secure Domain Name System Dynamic Update . April
+RFC2137. Eastlake, 3rd, D. Secure Domain Name System Dynamic Update. April
1997.
Other Important RFCs About DNS Implementation
@@ -3765,55 +3955,55 @@ RFC1535. Gavron, E. A Security Problem and Proposed Correction With Widely
Deployed DNS Software. October 1993.
RFC1536. Kumar, A., J. Postel, C. Neuman, P. Danzig, S. Miller. Common DNS
-Implementation Errors and Suggested Fixes . October 1993.
+Implementation Errors and Suggested Fixes. October 1993.
-RFC1982. Elz, R., R. Bush. Serial Number Arithmetic . August 1996.
+RFC1982. Elz, R., R. Bush. Serial Number Arithmetic. August 1996.
Resource Record Types
RFC1183. Everhart, C.F., L. A. Mamakos, R. Ullmann, P. Mockapetris. New DNS
-RR Definitions . October 1990.
+RR Definitions. October 1990.
-RFC1706. Manning, B., R. Colella. DNS NSAP Resource Records . October 1994.
+RFC1706. Manning, B., R. Colella. DNS NSAP Resource Records. October 1994.
RFC2168. Daniel, R., M. Mealling. Resolution of Uniform Resource Identifiers
using the Domain Name System. June 1997.
RFC1876. Davis, C., P. Vixie, T. Goodwin, I. Dickinson. A Means for
-Expressing Location Information in the Domain Name System . January 1996.
+Expressing Location Information in the Domain Name System. January 1996.
RFC2052. Gulbrandsen, A., P. Vixie. A DNS RR for Specifying the Location of
Services. October 1996.
RFC2163. Allocchio, A. U sing the Internet DNS to Distribute MIXER
-Conformant Global Address Mapping . January 1998.
+Conformant Global Address Mapping. January 1998.
-RFC2230. Atkinson, R. Key Exchange Delegation Record for the DNS . October
+RFC2230. Atkinson, R. Key Exchange Delegation Record for the DNS. October
1997.
DNS and the Internet
-RFC1101. Mockapetris, P. V. DNS Encoding of Network Names and Other Types .
+RFC1101. Mockapetris, P. V. DNS Encoding of Network Names and Other Types.
April 1989.
RFC1123. Braden, R. Requirements for Internet Hosts - Application and
-Support . October 1989.
+Support. October 1989.
-RFC1591. Postel, J. D omain Name System Structure and Delegation . March
+RFC1591. Postel, J. D omain Name System Structure and Delegation. March
1994.
RFC2317. Eidnes, H., G. de Groot, P. Vixie. Classless IN-ADDR.ARPA
-Delegation . March 1998.
+Delegation. March 1998.
DNS Operations
-RFC1537. Beertema, P. Common DNS Data File Configuration Errors . October
+RFC1537. Beertema, P. Common DNS Data File Configuration Errors. October
1993.
-RFC1912. Barr, D. Common DNS Operational and Configuration Errors . February
+RFC1912. Barr, D. Common DNS Operational and Configuration Errors. February
1996.
-RFC1912. Barr, D. Common DNS Operational and Configuration Errors . February
+RFC1912. Barr, D. Common DNS Operational and Configuration Errors. February
1996.
RFC2010. Manning, B., P. Vixie. Operational Criteria for Root Name Servers.
@@ -3828,25 +4018,25 @@ Note: the following list of RFCs, although DNS-related, are not concerned
with implementing software.
RFC1464. Rosenbaum, R. Using the Domain Name System To Store Arbitrary
-String Attributes . May 1993.
+String Attributes. May 1993.
-RFC1713. Romao, A. Tools for DNS Debugging . November 1994.
+RFC1713. Romao, A. Tools for DNS Debugging. November 1994.
-RFC1794. Brisco, T. DNS Support for Load Balancing . April 1995.
+RFC1794. Brisco, T. DNS Support for Load Balancing. April 1995.
-RFC2240. Vaughan, O. A Legal Basis for Domain Name Allocation .
+RFC2240. Vaughan, O. A Legal Basis for Domain Name Allocation.
November1997.
RFC2345. Klensin, J., T. Wolf, G. Oglesby. Domain Names and Company Name
-Retrieval . May 1998.
+Retrieval. May 1998.
-RFC2352. Vaughan, O. A Convention For Using Legal Names as Domain Names .
+RFC2352. Vaughan, O. A Convention For Using Legal Names as Domain Names.
May 1998.
Obsolete and Unimplemented Experimental RRs
RFC1712. Farrell, C., M. Schulze, S. Pleitner, D. Baldoni. DNS Encoding of
-Geographical Location . November 1994.
+Geographical Location. November 1994.
Internet Drafts
@@ -3860,7 +4050,7 @@ authors.
Other BIND Documents
-Albitz, Paul and Cricket Liu. 1998. DNS and BIND . Sebastopol, CA: O'Reilly
+Albitz, Paul and Cricket Liu. 1998. DNS and BIND. Sebastopol, CA: O'Reilly
and Associates.
------------------------------------------------------------------------
From 9df4200a67abf7a9907e95d2e01c7313328ad272 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 17:59:08 +0000
Subject: [PATCH 051/226] Check the return value of kill. This means that the
test can now detect the case when a program no longer exists (due to a crash)
or when a program responds badly to a SIGTERM and doesn't clean up the pid
file.
---
bin/tests/system/notify/tests.sh | 30 +++++++++++++++++++++++++-----
bin/tests/system/stop.sh | 30 +++++++++++++++++++++++++-----
2 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh
index 0737b9936a..ce5a545241 100644
--- a/bin/tests/system/notify/tests.sh
+++ b/bin/tests/system/notify/tests.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: tests.sh,v 1.22 2000/07/07 18:25:13 bwelling Exp $
+# $Id: tests.sh,v 1.23 2000/07/12 17:59:07 bwelling Exp $
#
# Perform tests
@@ -52,14 +52,24 @@ grep ";" dig.out.ns3
$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
-kill -TERM `cat ns3/named.pid`
+kill -TERM `cat ns3/named.pid` > /dev/null 2>&1
+if [ $? != 0 ]; then
+ echo "I:ns3 died before a SIGTERM was sent"
+ status=1
+ rm -f ns3/named.pid
+fi
rm -f ns2/example.db
cp ns2/example3.db ns2/example.db
sleep 6
if [ -f ns3/named.pid ]; then
echo "I:ns3 didn't die when sent a SIGTERM"
- kill -KILL `cat ns3/named.pid`
+ kill -KILL `cat ns3/named.pid` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:ns3 died before a SIGKILL was sent"
+ status=1
+ rm -f ns3/named.pid
+ fi
status=1
fi
@@ -78,12 +88,22 @@ grep ";" dig.out.ns3
$PERL ../digcomp.pl dig.out.ns2 dig.out.ns3 || status=1
rm -f ns2/example.db
-kill -TERM `cat ns2/named.pid`
+kill -TERM `cat ns2/named.pid` > /dev/null 2>&1
+if [ $? != 0 ]; then
+ echo "I:ns2 died before a SIGTERM was sent"
+ status=1
+ rm -f ns2/named.pid
+fi
sleep 6
if [ -f ns2/named.pid ]; then
echo "I:ns2 didn't die when sent a SIGTERM"
- kill -KILL `cat ns2/named.pid`
+ kill -KILL `cat ns2/named.pid` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:ns2 died before a SIGKILL was sent"
+ status=1
+ rm -f ns2/named.pid
+ fi
status=1
fi
diff --git a/bin/tests/system/stop.sh b/bin/tests/system/stop.sh
index 665299330f..b172a40e54 100644
--- a/bin/tests/system/stop.sh
+++ b/bin/tests/system/stop.sh
@@ -15,7 +15,7 @@
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
-# $Id: stop.sh,v 1.12 2000/07/09 15:55:01 tale Exp $
+# $Id: stop.sh,v 1.13 2000/07/12 17:59:08 bwelling Exp $
#
# Stop name servers.
@@ -31,7 +31,12 @@ for d in ns*
do
pidfile="$d/named.pid"
if [ -f $pidfile ]; then
- kill -TERM `cat $pidfile`
+ kill -TERM `cat $pidfile` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:$d died before a SIGTERM was sent"
+ status=`expr $status + 1`
+ rm -f $pidfile
+ fi
fi
done
@@ -39,7 +44,12 @@ for d in lwresd*
do
pidfile="$d/lwresd.pid"
if [ -f $pidfile ]; then
- kill -TERM `cat $pidfile`
+ kill -TERM `cat $pidfile` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:$d died before a SIGTERM was sent"
+ status=`expr $status + 1`
+ rm -f $pidfile
+ fi
fi
done
@@ -51,7 +61,12 @@ do
if [ -f $pidfile ]; then
echo "I:$d didn't die when sent a SIGTERM"
status=`expr $status + 1`
- kill -KILL `cat $pidfile`
+ kill -KILL `cat $pidfile` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:$d died before a SIGKILL was sent"
+ status=`expr $status + 1`
+ rm -f $pidfile
+ fi
rm -f $pidfile
fi
done
@@ -62,7 +77,12 @@ do
if [ -f $pidfile ]; then
echo "I:$d didn't die when sent a SIGTERM"
status=`expr $status + 1`
- kill -KILL `cat $pidfile`
+ kill -KILL `cat $pidfile` > /dev/null 2>&1
+ if [ $? != 0 ]; then
+ echo "I:$d died before a SIGKILL was sent"
+ status=`expr $status + 1`
+ rm -f $pidfile
+ fi
rm -f $pidfile
fi
done
From df5918b068fecf7ce1a4003a340c2110bd3cbd19 Mon Sep 17 00:00:00 2001
From: Jim Reid
Date: Wed, 12 Jul 2000 18:29:33 +0000
Subject: [PATCH 052/226] incorporated Brian's review comments and corrections
---
bin/nsupdate/nsupdate.8 | 55 +++++++++++++++++++++++++++++++++--------
doc/man/bin/nsupdate.8 | 55 +++++++++++++++++++++++++++++++++--------
2 files changed, 90 insertions(+), 20 deletions(-)
diff --git a/bin/nsupdate/nsupdate.8 b/bin/nsupdate/nsupdate.8
index 75b1205c2a..2de9cbcf08 100644
--- a/bin/nsupdate/nsupdate.8
+++ b/bin/nsupdate/nsupdate.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: nsupdate.8,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\" $Id: nsupdate.8,v 1.2 2000/07/12 18:29:33 jim Exp $
.\"
.Dd Jun 30, 2000
.Dt NSUPDATE 8
@@ -72,15 +72,18 @@ HMAC-MD5, which is defined in RFC 2104.
Once other algorithms are defined for TSIG, applications will need to
ensure they select the appropriate algorithm as well as the key when
authenticating each other.
-Suitable
+For instance suitable
.Dv key{}
and
.Dv server{}
-statements will be added to
+statements would be added to
.Pa /etc/named.conf
-so that the appropriate secret key and algorithm can be associated
-with the IP address of the
+so that the name server can associate the appropriate secret key
+and algorithm with the IP address of the
client application that will be using TSIG authentication.
+.Nm nsupdate
+does not read
+.Pa /etc/named.conf .
.Pp
.Nm nsupdate
uses the
@@ -104,7 +107,8 @@ is used, a signature is generated from
is the name of the key,
and
.Ar secret
-is a string comprising the shared secret.
+is a string comprising the shared secret, typically written in base-64
+encoding.
Use of the
.Fl y
option is discouraged because the shared secret is supplied as a command
@@ -126,12 +130,14 @@ This may be preferable when a batch of update requests are made.
.Nm nsupdate
reads commands from its standard input.
Each command is supplied on exactly one line of input.
-Commands can be update instructions or prerequisite checks on the
+Some commands are for administrative purposes.
+The others are either update instructions or prerequisite checks on the
contents of the zone.
These checks set conditions that some name or set of
resource records (RRset) either exists or is absent from the zone.
These conditions must be met if the entire update request is to succeed.
Updates will be rejected if the tests for the prerequisite conditions fail.
+.Pp
Every update request consists of zero or more prerequisites
and one or more updates.
This allows a suitably authenticated update request to proceed if some
@@ -142,6 +148,34 @@ DNS update request to the name server.
The command formats and their meaning are as follows:
.Bl -ohang indent
.It Xo
+.Ic server Va servername Op port
+.Xc
+.sp 1
+Sends all dynamic update requests to the name server
+.Va servername .
+When no server statement is provided,
+.Nm nsupdate
+will send updates to the master server of the correct zone.
+The MNAME field of that zone's SOA record will identify the master
+server for that zone.
+.Va port
+is the port number on
+.Va servername
+where the dynamic update requests get sent.
+If no port number is specified, the default DNS port number of 53 is
+used.
+.It Xo
+.Ic zone Va zonename
+.Xc
+.sp 1
+Specifies that all updates are to be made to the zone
+.Va zonename .
+.Nm nsupdate
+will determine the correct zone to update based on the rest of the input
+data if no
+.Va zone
+statement is provided.
+.It Xo
.Ic prereq nxdomain Va domain-name
.Xc
.sp 1
@@ -258,6 +292,7 @@ long-standing rule in RFC1034 that a name must not exist as any other
record type if it exists as a CNAME.
(The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
SIG, KEY and NXT records.)
+.Pp
.Sh NAME SERVER PROCESSING
.Pp
When a successful update request is made, the BIND9 name server
@@ -271,13 +306,13 @@ XXXJR WHEN DOES IT DO THAT???
It then sends a NOTIFY message to the zone's slave servers to inform
them that the zone's contents have changed.
.Sh FILES
-.Bl -tag -width Kname.+157.+{random}.private -compact
+.Bl -tag -width K{name}.+157.+{random}.private -compact
.It Pa /etc/named.conf
name server configuration file
-.It Pa Kname.+157.+{random}.key
+.It Pa K{name}.+157.+{random}.key
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
-.It Pa Kname.+157.+{random}.private
+.It Pa K{name}.+157.+{random}.private
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
.El
diff --git a/doc/man/bin/nsupdate.8 b/doc/man/bin/nsupdate.8
index 75b1205c2a..2de9cbcf08 100644
--- a/doc/man/bin/nsupdate.8
+++ b/doc/man/bin/nsupdate.8
@@ -13,7 +13,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.\" $Id: nsupdate.8,v 1.1 2000/07/12 17:17:03 jim Exp $
+.\" $Id: nsupdate.8,v 1.2 2000/07/12 18:29:33 jim Exp $
.\"
.Dd Jun 30, 2000
.Dt NSUPDATE 8
@@ -72,15 +72,18 @@ HMAC-MD5, which is defined in RFC 2104.
Once other algorithms are defined for TSIG, applications will need to
ensure they select the appropriate algorithm as well as the key when
authenticating each other.
-Suitable
+For instance suitable
.Dv key{}
and
.Dv server{}
-statements will be added to
+statements would be added to
.Pa /etc/named.conf
-so that the appropriate secret key and algorithm can be associated
-with the IP address of the
+so that the name server can associate the appropriate secret key
+and algorithm with the IP address of the
client application that will be using TSIG authentication.
+.Nm nsupdate
+does not read
+.Pa /etc/named.conf .
.Pp
.Nm nsupdate
uses the
@@ -104,7 +107,8 @@ is used, a signature is generated from
is the name of the key,
and
.Ar secret
-is a string comprising the shared secret.
+is a string comprising the shared secret, typically written in base-64
+encoding.
Use of the
.Fl y
option is discouraged because the shared secret is supplied as a command
@@ -126,12 +130,14 @@ This may be preferable when a batch of update requests are made.
.Nm nsupdate
reads commands from its standard input.
Each command is supplied on exactly one line of input.
-Commands can be update instructions or prerequisite checks on the
+Some commands are for administrative purposes.
+The others are either update instructions or prerequisite checks on the
contents of the zone.
These checks set conditions that some name or set of
resource records (RRset) either exists or is absent from the zone.
These conditions must be met if the entire update request is to succeed.
Updates will be rejected if the tests for the prerequisite conditions fail.
+.Pp
Every update request consists of zero or more prerequisites
and one or more updates.
This allows a suitably authenticated update request to proceed if some
@@ -142,6 +148,34 @@ DNS update request to the name server.
The command formats and their meaning are as follows:
.Bl -ohang indent
.It Xo
+.Ic server Va servername Op port
+.Xc
+.sp 1
+Sends all dynamic update requests to the name server
+.Va servername .
+When no server statement is provided,
+.Nm nsupdate
+will send updates to the master server of the correct zone.
+The MNAME field of that zone's SOA record will identify the master
+server for that zone.
+.Va port
+is the port number on
+.Va servername
+where the dynamic update requests get sent.
+If no port number is specified, the default DNS port number of 53 is
+used.
+.It Xo
+.Ic zone Va zonename
+.Xc
+.sp 1
+Specifies that all updates are to be made to the zone
+.Va zonename .
+.Nm nsupdate
+will determine the correct zone to update based on the rest of the input
+data if no
+.Va zone
+statement is provided.
+.It Xo
.Ic prereq nxdomain Va domain-name
.Xc
.sp 1
@@ -258,6 +292,7 @@ long-standing rule in RFC1034 that a name must not exist as any other
record type if it exists as a CNAME.
(The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
SIG, KEY and NXT records.)
+.Pp
.Sh NAME SERVER PROCESSING
.Pp
When a successful update request is made, the BIND9 name server
@@ -271,13 +306,13 @@ XXXJR WHEN DOES IT DO THAT???
It then sends a NOTIFY message to the zone's slave servers to inform
them that the zone's contents have changed.
.Sh FILES
-.Bl -tag -width Kname.+157.+{random}.private -compact
+.Bl -tag -width K{name}.+157.+{random}.private -compact
.It Pa /etc/named.conf
name server configuration file
-.It Pa Kname.+157.+{random}.key
+.It Pa K{name}.+157.+{random}.key
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
-.It Pa Kname.+157.+{random}.private
+.It Pa K{name}.+157.+{random}.private
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
.El
From 8d790f3e952bca3e3617f47023c9314a1766b1e5 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 19:03:08 +0000
Subject: [PATCH 053/226] When lwresd is shutting down, don't explicitly send
shutdown events to the clientmgr tasks, since the task manager already sends
them.
---
bin/named/lwresd.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/bin/named/lwresd.c b/bin/named/lwresd.c
index 8ab64de382..9d9702695d 100644
--- a/bin/named/lwresd.c
+++ b/bin/named/lwresd.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: lwresd.c,v 1.10 2000/06/28 00:06:24 bwelling Exp $ */
+/* $Id: lwresd.c,v 1.11 2000/07/12 19:03:08 bwelling Exp $ */
/*
* Main program for the Lightweight Resolver Daemon.
@@ -89,15 +89,11 @@ mem_free(void *arg, void *mem, size_t size) {
static void
shutdown_lwresd(isc_task_t *task, isc_event_t *event) {
ns_lwresd_t *lwresd = event->ev_arg;
- unsigned int i;
UNUSED(task);
dns_dispatchmgr_destroy(&lwresd->dispmgr);
- for (i = 0; i < lwresd->ntasks; i++)
- isc_task_shutdown(lwresd->cmgr[i].task);
-
/*
* Wait for everything to die off by waiting for the sockets
* to be detached.
From 3dae6c46753c6e2608b15c84b77991add3e0bac3 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Wed, 12 Jul 2000 19:39:49 +0000
Subject: [PATCH 054/226] minor cleanups from review
---
bin/named/lwresd.8 | 41 ++++++++++++++++++++---------------------
doc/man/bin/lwresd.8 | 41 ++++++++++++++++++++---------------------
2 files changed, 40 insertions(+), 42 deletions(-)
diff --git a/bin/named/lwresd.8 b/bin/named/lwresd.8
index 643f62e63b..c361880eaf 100644
--- a/bin/named/lwresd.8
+++ b/bin/named/lwresd.8
@@ -14,12 +14,12 @@
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwresd.8,v 1.2 2000/06/28 02:51:45 jim Exp $
+.\" $Id: lwresd.8,v 1.3 2000/07/12 19:39:49 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt LWRESD 8
.Os BIND9 9
-.ds vT BIND9 Programmer's Manual
+.ds vT BIND 9 Programmer's Manual
.Sh NAME
.Nm lwresd
.Nd lightweight resolver daemon
@@ -36,7 +36,7 @@
.Op Fl u Ar user-id
.Sh DESCRIPTION
.Nm lwresd
-is the daemon for processes that use the BIND9 lightweight resolver
+is the daemon for processes that use the BIND 9 lightweight resolver
library.
The daemon is actually a DNS name server,
.Nm named ,
@@ -60,12 +60,7 @@ requests and responses.
.Pp
Incoming lightweight resolver requests are decoded by
.Nm lwresd
-which resolves them using the DNS protocol.
-.Nm lwresd
-either forwards the DNS queries to the name servers listed in
-.Pa /etc/resolv.conf
-or else resolves the request for itself by querying its built-in list
-of root name servers.
+which then resolves them using the DNS protocol.
When the DNS lookup completes,
.Nm lwresd
encodes the answers from the name servers in the lightweight
@@ -88,7 +83,7 @@ is present,
uses its built-in list of root name servers.
In this mode of operation,
.Nm lwresd
-analagous to a caching-only name server, albeit one that does not
+analogous to a caching-only name server, albeit one that does not
receive conventional DNS queries.
.Pp
The lightweight resolver simplifies the task of looking up hostnames
@@ -102,7 +97,7 @@ having to make many DNS queries to resolve the hostname or IP address.
Without the lightweight resolver, clients would be expected to deal
with the complexities of
processing the DNS resource records used for IPv6 addresses, dealing
-with DNAME records and possibly DNSSEC.
+with DNAME records and deciphering DNSSEC.
Instead of directly handling those complications, clients can make
.Nm lwresd
do the work for them.
@@ -131,7 +126,7 @@ also runs the lightweight resolver daemon in the foreground, but
logs to
.Dv stderr .
.It Fl i
-write the daemon's process id (PID) to
+write the daemon's process id to
.Ar pid-file
instead of the default pathname.
.It Fl n
@@ -158,22 +153,26 @@ instead of the default port number, 921.
.It Fl s
write memory usage statistics to
.Dv stdout
-on exit. This option is only of interest
-to BIND9 developers and may be removed or changed in a future release.
+on exit.
+This option is only of interest to BIND 9 developers and may be
+removed or changed in a future release.
.It Fl t
tells
.Nm lwresd
to chroot() to
.Ar directory
-immediately after reading its config file.
+immediately after reading its configuration file.
.It Fl u
run
.Nm lwresd
-as UID
-.Ar user-id .
-The lightweight resolver daemon will change its UID after it has
-carried out any privileged operations, such as writing the PID file
-or creating a socket that uses its default UDP port number.
+as
+.Ar user-id ,
+which is a user name or numeric id that must be present in the
+password file.
+The lightweight resolver daemon will change its user-id after it has
+carried out any privileged operations, such as writing the process-id
+file or binding a socket to a privileged port (typically any port
+less than 1024).
.El
.Sh FILES
.Bl -tag -width /var/run/lwresd.pid -compact
@@ -185,7 +184,7 @@ default process-id file
.Sh SEE ALSO
.Xr named 8 ,
.Xr lwres 3 .
-.Sh BUGS
+.Sh NOTES
.Nm lwresd
is a daemon for lightweight resolvers, not a lightweight daemon
for resolvers.
diff --git a/doc/man/bin/lwresd.8 b/doc/man/bin/lwresd.8
index 643f62e63b..c361880eaf 100644
--- a/doc/man/bin/lwresd.8
+++ b/doc/man/bin/lwresd.8
@@ -14,12 +14,12 @@
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwresd.8,v 1.2 2000/06/28 02:51:45 jim Exp $
+.\" $Id: lwresd.8,v 1.3 2000/07/12 19:39:49 tale Exp $
.\"
.Dd Jun 30, 2000
.Dt LWRESD 8
.Os BIND9 9
-.ds vT BIND9 Programmer's Manual
+.ds vT BIND 9 Programmer's Manual
.Sh NAME
.Nm lwresd
.Nd lightweight resolver daemon
@@ -36,7 +36,7 @@
.Op Fl u Ar user-id
.Sh DESCRIPTION
.Nm lwresd
-is the daemon for processes that use the BIND9 lightweight resolver
+is the daemon for processes that use the BIND 9 lightweight resolver
library.
The daemon is actually a DNS name server,
.Nm named ,
@@ -60,12 +60,7 @@ requests and responses.
.Pp
Incoming lightweight resolver requests are decoded by
.Nm lwresd
-which resolves them using the DNS protocol.
-.Nm lwresd
-either forwards the DNS queries to the name servers listed in
-.Pa /etc/resolv.conf
-or else resolves the request for itself by querying its built-in list
-of root name servers.
+which then resolves them using the DNS protocol.
When the DNS lookup completes,
.Nm lwresd
encodes the answers from the name servers in the lightweight
@@ -88,7 +83,7 @@ is present,
uses its built-in list of root name servers.
In this mode of operation,
.Nm lwresd
-analagous to a caching-only name server, albeit one that does not
+analogous to a caching-only name server, albeit one that does not
receive conventional DNS queries.
.Pp
The lightweight resolver simplifies the task of looking up hostnames
@@ -102,7 +97,7 @@ having to make many DNS queries to resolve the hostname or IP address.
Without the lightweight resolver, clients would be expected to deal
with the complexities of
processing the DNS resource records used for IPv6 addresses, dealing
-with DNAME records and possibly DNSSEC.
+with DNAME records and deciphering DNSSEC.
Instead of directly handling those complications, clients can make
.Nm lwresd
do the work for them.
@@ -131,7 +126,7 @@ also runs the lightweight resolver daemon in the foreground, but
logs to
.Dv stderr .
.It Fl i
-write the daemon's process id (PID) to
+write the daemon's process id to
.Ar pid-file
instead of the default pathname.
.It Fl n
@@ -158,22 +153,26 @@ instead of the default port number, 921.
.It Fl s
write memory usage statistics to
.Dv stdout
-on exit. This option is only of interest
-to BIND9 developers and may be removed or changed in a future release.
+on exit.
+This option is only of interest to BIND 9 developers and may be
+removed or changed in a future release.
.It Fl t
tells
.Nm lwresd
to chroot() to
.Ar directory
-immediately after reading its config file.
+immediately after reading its configuration file.
.It Fl u
run
.Nm lwresd
-as UID
-.Ar user-id .
-The lightweight resolver daemon will change its UID after it has
-carried out any privileged operations, such as writing the PID file
-or creating a socket that uses its default UDP port number.
+as
+.Ar user-id ,
+which is a user name or numeric id that must be present in the
+password file.
+The lightweight resolver daemon will change its user-id after it has
+carried out any privileged operations, such as writing the process-id
+file or binding a socket to a privileged port (typically any port
+less than 1024).
.El
.Sh FILES
.Bl -tag -width /var/run/lwresd.pid -compact
@@ -185,7 +184,7 @@ default process-id file
.Sh SEE ALSO
.Xr named 8 ,
.Xr lwres 3 .
-.Sh BUGS
+.Sh NOTES
.Nm lwresd
is a daemon for lightweight resolvers, not a lightweight daemon
for resolvers.
From ecb2897c71b2268b2f828c6b563aea06320c8ee2 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Wed, 12 Jul 2000 23:56:06 +0000
Subject: [PATCH 055/226] Insist that when a fetch returns a successful event,
the rdataset is associated. A test failed about a week ago because this was
not true, and because it died in the event handler, diagnosing the problem
was impossible.
---
lib/dns/resolver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 94a0ed6e7b..38db487176 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: resolver.c,v 1.144 2000/07/07 19:43:14 tale Exp $ */
+/* $Id: resolver.c,v 1.145 2000/07/12 23:56:06 bwelling Exp $ */
#include
@@ -504,6 +504,8 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
event->ev_sender = fctx;
if (!HAVE_ANSWER(fctx))
event->result = result;
+ if (result == ISC_R_SUCCESS)
+ INSIST(dns_rdataset_isassociated(event->rdataset));
isc_task_sendanddetach(&task, (isc_event_t **)&event);
}
ISC_LIST_INIT(fctx->events);
From 30576c592b538cab293cf6e1f6265d376cd5a12c Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Thu, 13 Jul 2000 00:19:02 +0000
Subject: [PATCH 056/226] 330. [func] New function
isc_log_wouldlog().
---
CHANGES | 2 ++
lib/isc/include/isc/log.h | 13 ++++++++++-
lib/isc/log.c | 45 ++++++++++++++++++++++-----------------
3 files changed, 40 insertions(+), 20 deletions(-)
diff --git a/CHANGES b/CHANGES
index 0772b30444..c2421bde6c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 330. [func] New function isc_log_wouldlog().
+
329. [func] omapi_auth_register() now takes a size_t argument for
the length of a key's secret data. Previously
OMAPI only stored secrets up to the first NUL byte.
diff --git a/lib/isc/include/isc/log.h b/lib/isc/include/isc/log.h
index 091c763371..f80f735d59 100644
--- a/lib/isc/include/isc/log.h
+++ b/lib/isc/include/isc/log.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: log.h,v 1.25 2000/06/19 21:45:03 explorer Exp $ */
+/* $Id: log.h,v 1.26 2000/07/13 00:18:53 gson Exp $ */
#ifndef ISC_LOG_H
#define ISC_LOG_H 1
@@ -627,6 +627,17 @@ isc_log_getdebuglevel(isc_log_t *lctx);
* The current logging debugging level is returned.
*/
+isc_boolean_t
+isc_log_wouldlog(isc_log_t *lctx, int level);
+/*
+ * Determine whether logging something to 'lctx' at 'level' would
+ * actually cause something to be logged somewhere.
+ *
+ * If ISC_FALSE is returned, it is guaranteed that nothing would
+ * be logged, allowing the caller to omit unnecessary
+ * isc_log_write() calls and possible message preformatting.
+ */
+
void
isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval);
/*
diff --git a/lib/isc/log.c b/lib/isc/log.c
index 93df1fe816..e3c5d308bc 100644
--- a/lib/isc/log.c
+++ b/lib/isc/log.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: log.c,v 1.38 2000/06/23 17:52:20 tale Exp $ */
+/* $Id: log.c,v 1.39 2000/07/13 00:18:51 gson Exp $ */
/* Principal Authors: DCL */
@@ -1197,6 +1197,30 @@ isc_log_open(isc_logchannel_t *channel) {
return (ISC_R_SUCCESS);
}
+isc_boolean_t
+isc_log_wouldlog(isc_log_t *lctx, int level) {
+ /*
+ * Try to avoid locking the mutex for messages which can't
+ * possibly be logged to any channels -- primarily debugging
+ * messages that the debug level is not high enough to print.
+ *
+ * If the level is (mathematically) less than or equal to the
+ * highest_level, or if there is a dynamic channel and the level is
+ * less than or equal to the debug level, the main loop must be
+ * entered to see if the message should really be output.
+ *
+ * NOTE: this is UNLOCKED access to the logconfig. However,
+ * the worst thing that can happen is that a bad decision is made
+ * about returning without logging, and that's not a big concern,
+ * because that's a risk anyway if the logconfig is being
+ * dynamically changed.
+ */
+
+ return (ISC_TF(level <= lctx->logconfig->highest_level ||
+ (lctx->logconfig->dynamic &&
+ level <= lctx->debug_level)));
+}
+
static void
isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, isc_boolean_t write_once,
@@ -1232,24 +1256,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
REQUIRE(category->id < lctx->category_count);
REQUIRE(module->id < lctx->module_count);
- /*
- * Try to avoid locking the mutex for messages which can't
- * possibly be logged to any channels -- primarily debugging
- * messages that the debug level is not high enough to print.
- *
- * If the level is (mathematically) less than or equal to the
- * highest_level, or if there is a dynamic channel and the level is
- * less than or equal to the debug level, the main loop must be
- * entered to see if the message should really be output.
- *
- * NOTE: this is UNLOCKED access to the logconfig. However,
- * the worst thing that can happen is that a bad decision is made
- * about returning without logging, and that's not a big concern,
- * because that's a risk anyway if the logconfig is being
- * dynamically changed.
- */
- if (! (level <= lctx->logconfig->highest_level ||
- (lctx->logconfig->dynamic && level <= lctx->debug_level)))
+ if (! isc_log_wouldlog(lctx, level))
return;
time_string[0] = '\0';
From 720319de674728f25ca6a1b42f087b1fcb453516 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 00:21:27 +0000
Subject: [PATCH 057/226] Call isc_log_wouldlog in ns_client_log
---
bin/named/client.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/named/client.c b/bin/named/client.c
index ad5fa8140e..b7ef7d018f 100644
--- a/bin/named/client.c
+++ b/bin/named/client.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: client.c,v 1.98 2000/06/22 23:48:07 marka Exp $ */
+/* $Id: client.c,v 1.99 2000/07/13 00:21:27 bwelling Exp $ */
#include
@@ -268,7 +268,7 @@ set_timeout(ns_client_t *client, unsigned int seconds) {
if (result != ISC_R_SUCCESS) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_CLIENT, ISC_LOG_ERROR,
- "setting timouet: %s",
+ "setting timeout: %s",
isc_result_totext(result));
/* Continue anyway. */
}
@@ -1659,6 +1659,9 @@ ns_client_log(ns_client_t *client, isc_logcategory_t *category,
{
va_list ap;
+ if (isc_log_wouldlog(ns_g_lctx, level) == ISC_FALSE)
+ return;
+
va_start(ap, fmt);
ns_client_logv(client, category, module, level, fmt, ap);
va_end(ap);
From 211ac47e07f46ed6aafc0e9f60bc7fce640964cd Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Thu, 13 Jul 2000 00:25:38 +0000
Subject: [PATCH 058/226] use isc_log_wouldlog() to avoid unnecessary
formatting work when the debug level does not warrant logging
---
lib/isc/unix/socket.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
index a1327a4a87..f468552736 100644
--- a/lib/isc/unix/socket.c
+++ b/lib/isc/unix/socket.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: socket.c,v 1.147 2000/07/10 19:40:06 explorer Exp $ */
+/* $Id: socket.c,v 1.148 2000/07/13 00:25:38 gson Exp $ */
#include
@@ -245,6 +245,9 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
char peerbuf[256];
va_list ap;
+ if (! isc_log_wouldlog(isc_lctx, level))
+ return;
+
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
From 945c32833bd1a2caf18e8d830461d87c0e5b3a04 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 00:27:17 +0000
Subject: [PATCH 059/226] Call isc_log_wouldlog() in a few places.
---
lib/dns/xfrin.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c
index 0f435c9335..278b5d506d 100644
--- a/lib/dns/xfrin.c
+++ b/lib/dns/xfrin.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: xfrin.c,v 1.82 2000/07/05 20:28:34 gson Exp $ */
+/* $Id: xfrin.c,v 1.83 2000/07/13 00:27:17 bwelling Exp $ */
#include
@@ -1215,6 +1215,9 @@ xfrin_log1(int level, dns_name_t *zonename, isc_sockaddr_t *masteraddr,
{
va_list ap;
+ if (isc_log_wouldlog(dns_lctx, level) == ISC_FALSE)
+ return;
+
va_start(ap, fmt);
xfrin_logv(level, zonename, masteraddr, fmt, ap);
va_end(ap);
@@ -1229,6 +1232,9 @@ xfrin_log(dns_xfrin_ctx_t *xfr, unsigned int level, const char *fmt, ...)
{
va_list ap;
+ if (isc_log_wouldlog(dns_lctx, level) == ISC_FALSE)
+ return;
+
va_start(ap, fmt);
xfrin_logv(level, &xfr->name, &xfr->masteraddr, fmt, ap);
va_end(ap);
From 2e1236ad1eb37716c43827df1b8585ce58592e2c Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 00:30:58 +0000
Subject: [PATCH 060/226] Call isc_log_wouldlog()
---
lib/dns/zone.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/dns/zone.c b/lib/dns/zone.c
index b68971cd9c..2b4f375340 100644
--- a/lib/dns/zone.c
+++ b/lib/dns/zone.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: zone.c,v 1.156 2000/07/11 22:44:33 gson Exp $ */
+/* $Id: zone.c,v 1.157 2000/07/13 00:30:58 bwelling Exp $ */
#include
@@ -3360,6 +3360,9 @@ zone_log(dns_zone_t *zone, const char *me, int level, const char *fmt, ...) {
int len;
isc_result_t result = ISC_R_FAILURE;
+ if (isc_log_wouldlog(dns_lctx, level) == ISC_FALSE)
+ return;
+
isc_buffer_init(&buffer, namebuf, sizeof(namebuf));
if (dns_name_dynamic(&zone->origin))
From d2895dd9bba25beaa167cb1fe9282855bc002768 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 00:32:20 +0000
Subject: [PATCH 061/226] Major changes to how dighost handles lists and
shutdown conditions. Probably not safe to pull up to release branch, since,
though it works, it needs serious testing and more changes are still pending.
In particular, I INSIST lots of things I didn't used to INSIST, which may be
set off under certain conditions.
---
bin/dig/dighost.c | 497 ++++++++++++++++++++++++----------------------
1 file changed, 258 insertions(+), 239 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index df7561240e..50b1e6523d 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.77 2000/07/12 00:42:54 mws Exp $ */
+/* $Id: dighost.c,v 1.78 2000/07/13 00:32:20 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -88,6 +88,7 @@ isc_sockaddr_t bind_any;
char *rootspace[BUFSIZE];
isc_buffer_t rootbuf;
int sendcount = 0;
+int recvcount = 0;
int sockcount = 0;
int ndots = -1;
int tries = 3;
@@ -107,7 +108,7 @@ extern isc_boolean_t isc_mem_debugging;
isc_boolean_t debugging = ISC_FALSE;
char *progname = NULL;
-static isc_boolean_t
+static void
cancel_lookup(dig_lookup_t *lookup);
static int
@@ -237,8 +238,7 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
debug("requeue_lookup()");
- if (free_now)
- return(ISC_R_SUCCESS);
+ INSIST(!free_now);
lookup_counter++;
if (lookup_counter > LOOKUP_LIMIT)
@@ -615,19 +615,114 @@ add_question(dns_message_t *message, dns_name_t *name,
}
/*
- * Return ISC_TRUE if we're in the process of shutting down on the
- * return.
+ * We're done iff all the counts are zero and the lookup list is empty
*/
+static void
+check_if_done(void) {
+ debug("check_if_done()");
+ if ((sockcount == 0) && (recvcount == 0) && (sendcount == 0)
+ && ISC_LIST_EMPTY(lookup_list)) {
+ debug("shutting down");
+ dighost_shutdown();
+ }
+}
+
+/*
+ * Clear out a query when we're done with it. WARNING: This routine
+ * WILL invalidate the query pointer.
+ */
+static void
+clear_query(dig_query_t *query) {
+ dig_lookup_t *lookup;
+
+ REQUIRE(query != NULL);
+
+ lookup = query->lookup;
+ ISC_LIST_UNLINK(lookup->q, query, link);
+ if (ISC_LINK_LINKED(&query->recvbuf, link))
+ ISC_LIST_DEQUEUE(query->recvlist, &query->recvbuf,
+ link);
+ if (ISC_LINK_LINKED(&query->lengthbuf, link))
+ ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
+ link);
+ isc_buffer_invalidate(&query->recvbuf);
+ isc_buffer_invalidate(&query->lengthbuf);
+ isc_mem_free(mctx, query);
+}
+
static isc_boolean_t
-check_next_lookup(dig_lookup_t *lookup) {
+try_clear_lookup(dig_lookup_t *lookup) {
+ dig_server_t *s;
+ void *ptr;
+
+ REQUIRE(lookup != NULL);
+
+ if (ISC_LIST_HEAD(lookup->q) != NULL)
+ return (ISC_FALSE);
+ /*
+ * At this point, we know there are no queries on the lookup,
+ * so can make it go away also.
+ */
+ if (lookup->use_my_server_list) {
+ s = ISC_LIST_HEAD(lookup->my_server_list);
+ while (s != NULL) {
+ debug("freeing server %p belonging to %p",
+ s, lookup);
+ ptr = s;
+ s = ISC_LIST_NEXT(s, link);
+ ISC_LIST_DEQUEUE(lookup->my_server_list,
+ (dig_server_t *)ptr, link);
+ isc_mem_free(mctx, ptr);
+ }
+ }
+ if (lookup->sendmsg != NULL)
+ dns_message_destroy(&lookup->sendmsg);
+ if (lookup->querysig != NULL) {
+ debug("freeing buffer %p", lookup->querysig);
+ isc_buffer_free(&lookup->querysig);
+ }
+ if (lookup->timer != NULL)
+ isc_timer_detach(&lookup->timer);
+
+ ptr = lookup;
+ lookup = ISC_LIST_NEXT(lookup, link);
+ ISC_LIST_DEQUEUE(lookup_list, (dig_lookup_t *)ptr, link);
+ isc_mem_free(mctx, ptr);
+ return (ISC_TRUE);
+}
+
+
+/*
+ * If we can, start the next lookup in the queue running.
+ * This assumes that the lookup on the head of the queue hasn't been
+ * started yet.
+ */
+static void
+begin_next_lookup(void) {
dig_lookup_t *next;
+
+ next = ISC_LIST_HEAD(lookup_list);
+ if (next != NULL) {
+ setup_lookup(next);
+ do_lookup(next);
+ } else {
+ check_if_done();
+ }
+}
+
+/*
+ * WARNING: The following routine may invalidate the lookup pointer.
+ * Never depend on being able to reference lookup or query pointers on the
+ * current lookup after calling this.
+ */
+static void
+check_next_lookup(dig_lookup_t *lookup) {
dig_query_t *query;
isc_boolean_t still_working=ISC_FALSE;
- if (free_now)
- return (ISC_TRUE);
+ INSIST(!free_now);
- debug("check_next_lookup(%p)", lookup);
+ debug("is_lookup_done(%p)", lookup);
for (query = ISC_LIST_HEAD(lookup->q);
query != NULL;
query = ISC_LIST_NEXT(query, link)) {
@@ -637,54 +732,11 @@ check_next_lookup(dig_lookup_t *lookup) {
}
}
if (still_working)
- return (ISC_FALSE);
-
- debug("have %d retries left for %s",
- lookup->retries-1, lookup->textname);
- debug("lookup %s pending", lookup->pending ? "is" : "is not");
-
- next = ISC_LIST_NEXT(lookup, link);
-
- if (lookup->tcp_mode) {
- if (next == NULL) {
- debug("shutting down", stderr);
- dighost_shutdown();
- return (ISC_TRUE);
- }
- if (next->sendmsg == NULL) {
- debug("setting up for TCP");
- setup_lookup(next);
- do_lookup(next);
- }
- } else {
- if (!lookup->pending) {
- if (next == NULL) {
- debug("shutting down", stderr);
- dighost_shutdown();
- return (ISC_TRUE);
- }
- if (next->sendmsg == NULL) {
- debug("setting up for UDP");
- setup_lookup(next);
- do_lookup(next);
- }
- } else {
- if (lookup->retries > 1) {
- debug("retrying");
- lookup->retries --;
- if (lookup->timer != NULL)
- isc_timer_detach(&lookup->timer);
- send_udp(lookup);
- } else {
- debug("cancelling");
- return(cancel_lookup(lookup));
- }
- }
- }
- return (ISC_FALSE);
+ return;
+ if (try_clear_lookup(lookup))
+ begin_next_lookup();
}
-
static void
followup_lookup(dns_message_t *msg, dig_query_t *query,
dns_section_t section) {
@@ -699,9 +751,9 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
isc_boolean_t success = ISC_FALSE;
int len;
+ INSIST(!free_now);
+
debug("followup_lookup()");
- if (free_now)
- return;
result = dns_message_firstname(msg,section);
if (result != ISC_R_SUCCESS) {
debug("firstname returned %s",
@@ -810,9 +862,9 @@ next_origin(dns_message_t *msg, dig_query_t *query) {
UNUSED(msg);
+ INSIST(!free_now);
+
debug("next_origin()");
- if (free_now)
- return;
debug("following up %s", query->lookup->textname);
if (query->lookup->origin == NULL) {
@@ -903,12 +955,10 @@ setup_lookup(dig_lookup_t *lookup) {
char store[MXNAME];
REQUIRE(lookup != NULL);
-
+ INSIST(!free_now);
+
debug("setup_lookup(%p)",lookup);
- if (free_now)
- return;
-
debug("setting up for looking up %s @%p->%p",
lookup->textname, lookup,
lookup->link.next);
@@ -1142,12 +1192,12 @@ send_done(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
debug("send_done()");
+ sendcount--;
+ debug("sendcount=%d",sendcount);
+ INSIST(sendcount >= 0);
}
-/*
- * Return ISC_TRUE if we're in the process of shutting down
- */
-static isc_boolean_t
+void
cancel_lookup(dig_lookup_t *lookup) {
dig_query_t *query = NULL;
@@ -1163,12 +1213,13 @@ cancel_lookup(dig_lookup_t *lookup) {
ISC_SOCKCANCEL_ALL);
isc_socket_detach(&query->sock);
sockcount--;
- debug("socket = %d", sockcount);
+ debug("sockcount=%d", sockcount);
+ INSIST(sockcount >= 0);
+ check_if_done();
}
}
lookup->pending = ISC_FALSE;
lookup->retries = 0;
- return(check_next_lookup(lookup));
}
static void
@@ -1214,8 +1265,8 @@ for (query = ISC_LIST_HEAD(lookup->q);
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
global_task, recv_done, query);
check_result(result, "isc_socket_recvv");
- sendcount++;
- debug("sent count number %d", sendcount);
+ recvcount++;
+ debug("recvcount=%d", recvcount);
ISC_LIST_ENQUEUE(query->sendlist, &lookup->sendbuf, link);
debug("sending a request");
result = isc_time_now(&query->time_sent);
@@ -1225,6 +1276,7 @@ for (query = ISC_LIST_HEAD(lookup->q);
global_task, send_done, query,
&query->sockaddr, NULL);
check_result(result, "isc_socket_sendtov");
+ sendcount++;
}
}
@@ -1253,27 +1305,26 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
q != NULL;
q = ISC_LIST_NEXT(q, link)) {
if (q->working) {
- if (!free_now) {
- isc_buffer_clear(b);
- result = isc_sockaddr_totext(&q->sockaddr, b);
- check_result(result, "isc_sockaddr_totext");
- isc_buffer_usedregion(b, &r);
- if ((q->lookup->retries > 1) &&
- (!q->lookup->tcp_mode))
- printf(";; Connection to server %.*s "
- "for %s timed out. "
- "Retrying %d.\n",
- (int)r.length, r.base,
- q->lookup->textname,
- q->lookup->retries-1);
- else {
- printf(";; Connection to "
- "server %.*s "
- "for %s timed out. "
- "Giving up.\n",
- (int)r.length, r.base,
- q->lookup->textname);
- }
+ INSIST(!free_now);
+ isc_buffer_clear(b);
+ result = isc_sockaddr_totext(&q->sockaddr, b);
+ check_result(result, "isc_sockaddr_totext");
+ isc_buffer_usedregion(b, &r);
+ if ((q->lookup->retries > 1) &&
+ (!q->lookup->tcp_mode))
+ printf(";; Connection to server %.*s "
+ "for %s timed out. "
+ "Retrying %d.\n",
+ (int)r.length, r.base,
+ q->lookup->textname,
+ q->lookup->retries-1);
+ else {
+ printf(";; Connection to "
+ "server %.*s "
+ "for %s timed out. "
+ "Giving up.\n",
+ (int)r.length, r.base,
+ q->lookup->textname);
}
isc_socket_cancel(q->sock, task,
ISC_SOCKCANCEL_ALL);
@@ -1295,16 +1346,12 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
isc_uint16_t length;
REQUIRE(event->ev_type == ISC_SOCKEVENT_RECVDONE);
+ INSIST(!free_now);
UNUSED(task);
debug("tcp_length_done()");
- if (free_now) {
- isc_event_free(&event);
- return;
- }
-
sevent = (isc_socketevent_t *)event;
query = event->ev_arg;
@@ -1326,9 +1373,10 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
isc_result_totext(sevent->result));
isc_buffer_free(&b);
query->working = ISC_FALSE;
- sockcount--;
- debug("socket = %d",sockcount);
isc_socket_detach(&query->sock);
+ sockcount--;
+ debug("sockcount=%d",sockcount);
+ INSIST(sockcount >= 0);
isc_event_free(&event);
check_next_lookup(query->lookup);
return;
@@ -1354,7 +1402,9 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
result = isc_socket_recvv(query->sock, &query->recvlist, length, task,
recv_done, query);
check_result(result, "isc_socket_recvv");
- debug("resubmitted recv request with length %d", length);
+ recvcount++;
+ debug("resubmitted recv request with length %d, recvcount=%d",
+ length, recvcount);
isc_event_free(&event);
}
@@ -1362,16 +1412,16 @@ static void
launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
isc_result_t result;
- debug("launch_next_query()");
+ INSIST(!free_now);
- if (free_now)
- return;
+ debug("launch_next_query()");
if (!query->lookup->pending) {
debug("ignoring launch_next_query because !pending");
- sockcount--;
- debug("socket = %d", sockcount);
isc_socket_detach(&query->sock);
+ sockcount--;
+ debug("sockcount=%d", sockcount);
+ INSIST(sockcount >= 0);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
check_next_lookup(query->lookup);
@@ -1391,14 +1441,17 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
result = isc_socket_recvv(query->sock, &query->lengthlist, 0,
global_task, tcp_length_done, query);
check_result(result, "isc_socket_recvv");
- sendcount++;
+ recvcount++;
+ debug("recvcount=%d",recvcount);
if (!query->first_soa_rcvd) {
debug("sending a request");
result = isc_time_now(&query->time_sent);
check_result(result, "isc_time_now");
result = isc_socket_sendv(query->sock, &query->sendlist,
global_task, send_done, query);
- check_result(result, "isc_socket_recvv");
+ check_result(result, "isc_socket_sendv");
+ sendcount++;
+ debug("sendcount=%d", sendcount);
}
query->waiting_connect = ISC_FALSE;
check_next_lookup(query->lookup);
@@ -1416,14 +1469,10 @@ connect_done(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
REQUIRE(event->ev_type == ISC_SOCKEVENT_CONNECT);
+ INSIST(!free_now);
debug("connect_done()");
- if (free_now) {
- isc_event_free(&event);
- return;
- }
-
sevent = (isc_socketevent_t *)event;
query = sevent->ev_arg;
@@ -1644,38 +1693,30 @@ recv_done(isc_task_t *task, isc_event_t *event) {
isc_buffer_t ab;
char abspace[MXNAME];
isc_region_t r;
- dig_lookup_t *n;
+ dig_lookup_t *n, *l;
isc_boolean_t docancel = ISC_FALSE;
- isc_boolean_t result_bool;
unsigned int local_timeout;
UNUSED(task);
+ INSIST(!free_now);
debug("recv_done()");
- if (free_now) {
- isc_event_free(&event);
- return;
- }
+ recvcount--;
+ debug("recvcount=%d", recvcount);
+ INSIST(recvcount >= 0);
query = event->ev_arg;
debug("lookup=%p, query=%p", query->lookup, query);
- if (free_now) {
- debug("bailing out, since freeing now");
- isc_event_free(&event);
- return;
- }
+ l = query->lookup;
- sendcount--;
- debug("in recv_done, counter down to %d", sendcount);
REQUIRE(event->ev_type == ISC_SOCKEVENT_RECVDONE);
sevent = (isc_socketevent_t *)event;
- if ((query->lookup->tcp_mode) &&
- (query->lookup->timer != NULL))
- isc_timer_touch(query->lookup->timer);
- if (!query->lookup->pending && !query->lookup->ns_search_only) {
+ if ((l->tcp_mode) && (l->timer != NULL))
+ isc_timer_touch(l->timer);
+ if (!l->pending && !l->ns_search_only) {
debug("no longer pending. Got %s",
isc_result_totext(sevent->result));
@@ -1683,10 +1724,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
- /*
- * In this case, we don't actually use result_bool
- */
- result_bool = cancel_lookup(query->lookup);
+ clear_query(query);
+ check_next_lookup(l);
return;
}
@@ -1698,24 +1737,24 @@ recv_done(isc_task_t *task, isc_event_t *event) {
check_result(result, "dns_message_create");
if (key != NULL) {
- debug("querysig 1 is %p", query->lookup->querysig);
- if (query->lookup->querysig == NULL) {
+ debug("querysig 1 is %p", l->querysig);
+ if (l->querysig == NULL) {
debug("getting initial querysig");
result = dns_message_getquerytsig(
- query->lookup->sendmsg,
- mctx, &query->lookup->querysig);
+ l->sendmsg,
+ mctx, &l->querysig);
check_result(result,
"dns_message_getquerytsig");
}
result = dns_message_setquerytsig(msg,
- query->lookup->querysig);
+ l->querysig);
check_result(result, "dns_message_setquerytsig");
result = dns_message_settsigkey(msg, key);
check_result(result, "dns_message_settsigkey");
- msg->tsigctx = query->lookup->tsigctx;
- if (query->lookup->msgcounter != 0)
+ msg->tsigctx = l->tsigctx;
+ if (l->msgcounter != 0)
msg->tcp_continuation = 1;
- query->lookup->msgcounter++;
+ l->msgcounter++;
}
debug("before parse starts");
result = dns_message_parse(msg, b, ISC_TRUE);
@@ -1724,18 +1763,20 @@ recv_done(isc_task_t *task, isc_event_t *event) {
hex_dump(b);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
- if (!query->lookup->tcp_mode) {
+ if (!l->tcp_mode) {
printf(";; Retrying in TCP mode.\n");
- n = requeue_lookup(query->lookup, ISC_TRUE);
+ n = requeue_lookup(l, ISC_TRUE);
n->tcp_mode = ISC_TRUE;
}
dns_message_destroy(&msg);
isc_event_free(&event);
- result_bool = cancel_lookup(query->lookup);
+ clear_query(query);
+ cancel_lookup(l);
+ check_next_lookup(l);
return;
}
if (key != NULL) {
- debug("querysig 2 is %p", query->lookup->querysig);
+ debug("querysig 2 is %p", l->querysig);
debug("before verify");
result = dns_tsig_verify(&query->recvbuf, msg,
NULL, keyring);
@@ -1745,29 +1786,29 @@ recv_done(isc_task_t *task, isc_event_t *event) {
dns_result_totext(result));
validated = ISC_FALSE;
}
- query->lookup->tsigctx = msg->tsigctx;
- if (query->lookup->querysig != NULL) {
+ l->tsigctx = msg->tsigctx;
+ if (l->querysig != NULL) {
debug("freeing querysig buffer %p",
- query->lookup->querysig);
- isc_buffer_free(&query->lookup->querysig);
+ l->querysig);
+ isc_buffer_free(&l->querysig);
}
result = dns_message_getquerytsig(msg, mctx,
- &query->lookup->querysig);
+ &l->querysig);
check_result(result,"dns_message_getquerytsig");
- debug("querysig 3 is %p", query->lookup->querysig);
+ debug("querysig 3 is %p", l->querysig);
}
debug("after parse");
- if (query->lookup->xfr_q == NULL) {
- query->lookup->xfr_q = query;
+ if (l->xfr_q == NULL) {
+ l->xfr_q = query;
/*
* Once we are in the XFR message, increase
* the timeout to much longer, so brief network
* outages won't cause the XFR to abort
*/
if ((timeout != INT_MAX) &&
- (query->lookup->timer != NULL)) {
+ (l->timer != NULL)) {
if (timeout == 0) {
- if (query->lookup->tcp_mode)
+ if (l->tcp_mode)
local_timeout = TCP_TIMEOUT;
else
local_timeout = UDP_TIMEOUT;
@@ -1779,62 +1820,62 @@ recv_done(isc_task_t *task, isc_event_t *event) {
}
debug("have local timeout of %d",
local_timeout);
- isc_interval_set(&query->lookup->interval,
+ isc_interval_set(&l->interval,
local_timeout, 0);
- result = isc_timer_reset(query->lookup->timer,
+ result = isc_timer_reset(l->timer,
isc_timertype_once,
NULL,
- &query->lookup->interval,
+ &l->interval,
ISC_FALSE);
check_result(result, "isc_timer_reset");
}
}
- if (query->lookup->xfr_q == query) {
- if ((query->lookup->trace)||
- (query->lookup->ns_search_only)) {
+ if (l->xfr_q == query) {
+ if ((l->trace)||
+ (l->ns_search_only)) {
debug("in TRACE code");
if (show_details ||
(((dns_message_firstname(msg,
DNS_SECTION_ANSWER)
== ISC_R_SUCCESS)) &&
- !query->lookup->trace_root)) {
+ !l->trace_root)) {
printmessage(query, msg, ISC_TRUE);
}
if ((msg->rcode != 0) &&
- (query->lookup->origin != NULL)) {
+ (l->origin != NULL)) {
next_origin(msg, query);
} else {
result = dns_message_firstname
(msg,DNS_SECTION_ANSWER);
if ((result != ISC_R_SUCCESS) ||
- query->lookup->trace_root)
+ l->trace_root)
followup_lookup(msg, query,
DNS_SECTION_AUTHORITY);
}
} else if ((msg->rcode != 0) &&
- (query->lookup->origin != NULL)) {
+ (l->origin != NULL)) {
next_origin(msg, query);
if (show_details) {
printmessage(query, msg, ISC_TRUE);
}
} else {
if (query->first_soa_rcvd &&
- query->lookup->doing_xfr)
+ l->doing_xfr)
printmessage(query, msg, ISC_FALSE);
else
printmessage(query, msg, ISC_TRUE);
}
} else if ((dns_message_firstname(msg, DNS_SECTION_ANSWER)
== ISC_R_SUCCESS) &&
- query->lookup->ns_search_only &&
- !query->lookup->trace_root ) {
+ l->ns_search_only &&
+ !l->trace_root ) {
printmessage(query, msg, ISC_TRUE);
}
- if (query->lookup->pending)
+ if (l->pending)
debug("still pending.");
- if (query->lookup->doing_xfr) {
- if (query != query->lookup->xfr_q) {
+ if (l->doing_xfr) {
+ if (query != l->xfr_q) {
dns_message_destroy(&msg);
isc_event_free (&event);
query->working = ISC_FALSE;
@@ -1844,7 +1885,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
docancel = check_for_more_data(query, msg, sevent);
if (docancel) {
dns_message_destroy(&msg);
- result_bool = cancel_lookup(query->lookup);
+ clear_query(query);
+ cancel_lookup(l);
}
if (msg != NULL)
dns_message_destroy(&msg);
@@ -1852,7 +1894,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
}
else {
if ((msg->rcode == 0) ||
- (query->lookup->origin == NULL)) {
+ (l->origin == NULL)) {
isc_buffer_init(&ab, abspace, MXNAME);
result = isc_sockaddr_totext(&sevent->address,
&ab);
@@ -1869,17 +1911,16 @@ recv_done(isc_task_t *task, isc_event_t *event) {
}
query->working = ISC_FALSE;
query->lookup->pending = ISC_FALSE;
- result_bool = ISC_FALSE;
if (!query->lookup->ns_search_only ||
query->lookup->trace_root) {
dns_message_destroy(&msg);
- result_bool = cancel_lookup(query->lookup);
+ cancel_lookup(l);
}
if (msg != NULL)
dns_message_destroy(&msg);
isc_event_free(&event);
- if ((!free_now) && (!result_bool))
- check_next_lookup(query->lookup);
+ clear_query(query);
+ check_next_lookup(l);
}
return;
}
@@ -1892,7 +1933,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
- check_next_lookup(query->lookup);
+ clear_query(query);
+ check_next_lookup(l);
return;
}
fatal("recv_done got result %s",
@@ -1972,13 +2014,13 @@ do_lookup_tcp(dig_lookup_t *lookup) {
query->waiting_connect = ISC_TRUE;
get_address(query->servname, port, &query->sockaddr);
- sockcount++;
- debug("socket = %d",sockcount);
ENSURE(query->sock == NULL);
result = isc_socket_create(socketmgr,
isc_sockaddr_pf(&query->sockaddr),
isc_sockettype_tcp, &query->sock) ;
check_result(result, "isc_socket_create");
+ sockcount++;
+ debug("sockcount=%d",sockcount);
if (specified_source)
result = isc_socket_bind(query->sock, &bind_address);
else {
@@ -2011,12 +2053,12 @@ do_lookup_udp(dig_lookup_t *lookup) {
query->waiting_connect = ISC_FALSE;
get_address(query->servname, port, &query->sockaddr);
- sockcount++;
- debug("socket = %d", sockcount);
result = isc_socket_create(socketmgr,
isc_sockaddr_pf(&query->sockaddr),
isc_sockettype_udp, &query->sock);
check_result(result, "isc_socket_create");
+ sockcount++;
+ debug("sockcount=%d", sockcount);
if (specified_source)
result = isc_socket_bind(query->sock, &bind_address);
else {
@@ -2048,10 +2090,9 @@ void
start_lookup(void) {
dig_lookup_t *lookup;
- debug("start_lookup()");
+ INSIST(!free_now);
- if (free_now)
- return;
+ debug("start_lookup()");
lookup = ISC_LIST_HEAD(lookup_list);
if (lookup != NULL) {
@@ -2067,20 +2108,16 @@ onrun_callback(isc_task_t *task, isc_event_t *event) {
start_lookup();
}
-void
-free_lists(void) {
- void *ptr;
+#if 0
+/*
+ * This will be used in the SIGINT handler, and perhaps other places.
+ */
+static void
+cancel_all(void) {
dig_lookup_t *l;
dig_query_t *q;
- dig_server_t *s;
- dig_searchlist_t *o;
- debug("free_lists()");
-
- if (free_now)
- return;
-
- free_now = ISC_TRUE;
+ debug ("cancel_all()");
l = ISC_LIST_HEAD(lookup_list);
while (l != NULL) {
@@ -2095,12 +2132,35 @@ free_lists(void) {
ISC_SOCKCANCEL_ALL);
isc_socket_detach(&q->sock);
sockcount--;
- debug("socket = %d",sockcount);
+ debug("sockcount=%d",sockcount);
+ INSIST(sockcount >= 0);
+ check_if_done();
}
q = ISC_LIST_NEXT(q, link);
}
l = ISC_LIST_NEXT(l, link);
}
+ check_if_done();
+}
+#endif
+
+void
+free_lists(void) {
+ void *ptr;
+ dig_server_t *s;
+ dig_searchlist_t *o;
+
+ debug("free_lists()");
+
+ REQUIRE(sockcount == 0);
+ REQUIRE(recvcount == 0);
+ REQUIRE(sendcount == 0);
+
+ INSIST(ISC_LIST_HEAD(lookup_list) == NULL);
+ INSIST(!free_now);
+
+ free_now = ISC_TRUE;
+
s = ISC_LIST_HEAD(server_list);
while (s != NULL) {
debug("freeing global server %p", s);
@@ -2136,47 +2196,6 @@ free_lists(void) {
if (namebuf != NULL)
isc_buffer_free(&namebuf);
- l = ISC_LIST_HEAD(lookup_list);
- while (l != NULL) {
- q = ISC_LIST_HEAD(l->q);
- while (q != NULL) {
- debug("freeing query %p, belonging to %p",
- q, l);
- if (ISC_LINK_LINKED(&q->recvbuf, link))
- ISC_LIST_DEQUEUE(q->recvlist, &q->recvbuf,
- link);
- if (ISC_LINK_LINKED(&q->lengthbuf, link))
- ISC_LIST_DEQUEUE(q->lengthlist, &q->lengthbuf,
- link);
- isc_buffer_invalidate(&q->recvbuf);
- isc_buffer_invalidate(&q->lengthbuf);
- ptr = q;
- q = ISC_LIST_NEXT(q, link);
- isc_mem_free(mctx, ptr);
- }
- if (l->use_my_server_list) {
- s = ISC_LIST_HEAD(l->my_server_list);
- while (s != NULL) {
- debug("freeing server %p belonging to %p",
- s, l);
- ptr = s;
- s = ISC_LIST_NEXT(s, link);
- isc_mem_free(mctx, ptr);
-
- }
- }
- if (l->sendmsg != NULL)
- dns_message_destroy(&l->sendmsg);
- if (l->querysig != NULL) {
- debug("freeing buffer %p", l->querysig);
- isc_buffer_free(&l->querysig);
- }
-
- ptr = l;
- l = ISC_LIST_NEXT(l, link);
- isc_mem_free(mctx, ptr);
- }
-
if (keyring != NULL) {
debug("freeing keyring %p", keyring);
dns_tsigkeyring_destroy(&keyring);
From febc974d0fc0066282e91d38f895004a27cd40d7 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 01:13:53 +0000
Subject: [PATCH 062/226] Use isc_log_wouldlog() to avoid calling strerror()
whenever possible.
---
lib/isc/unix/socket.c | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
index f468552736..7c8900350d 100644
--- a/lib/isc/unix/socket.c
+++ b/lib/isc/unix/socket.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: socket.c,v 1.148 2000/07/13 00:25:38 gson Exp $ */
+/* $Id: socket.c,v 1.149 2000/07/13 01:13:53 bwelling Exp $ */
#include
@@ -76,11 +76,17 @@
* DLVL(50) -- Event tracing, including receiving/sending completion events.
* DLVL(20) -- Socket creation/destruction.
*/
-#define TRACE DLVL(90)
-#define CORRECTNESS DLVL(70)
-#define IOEVENT DLVL(60)
-#define EVENT DLVL(50)
-#define CREATION DLVL(20)
+#define TRACE_LEVEL 90
+#define CORRECTNESS_LEVEL 70
+#define IOEVENT_LEVEL 60
+#define EVENT_LEVEL 50
+#define CREATION_LEVEL 20
+
+#define TRACE DLVL(TRACE_LEVEL)
+#define CORRECTNESS DLVL(CORRECTNESS_LEVEL)
+#define IOEVENT DLVL(IOEVENT_LEVEL)
+#define EVENT DLVL(EVENT_LEVEL)
+#define CREATION DLVL(CREATION_LEVEL)
typedef isc_event_t intev_t;
@@ -744,9 +750,10 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
if (SOFT_ERROR(errno))
return (DOIO_SOFT);
- socket_log(sock, NULL, IOEVENT,
- "doio_recv: recvmsg(%d) %d bytes, err %d/%s",
- sock->fd, cc, errno, strerror(errno));
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL))
+ socket_log(sock, NULL, IOEVENT,
+ "doio_recv: recvmsg(%d) %d bytes, err %d/%s",
+ sock->fd, cc, errno, strerror(errno));
#define SOFT_OR_HARD(_system, _isc) \
if (errno == _system) { \
@@ -1521,8 +1528,10 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
* If some other error, ignore it as well and hope
* for the best, but log it.
*/
- socket_log(sock, NULL, TRACE,
- "accept() returned %d/%s", errno, strerror(errno));
+ if (isc_log_wouldlog(isc_lctx, TRACE_LEVEL))
+ socket_log(sock, NULL, TRACE,
+ "accept() returned %d/%s", errno,
+ strerror(errno));
fd = -1;
@@ -1802,9 +1811,11 @@ watcher(void *uap) {
UNLOCK(&manager->lock);
cc = select(maxfd, &readfds, &writefds, NULL, NULL);
- manager_log(manager, IOEVENT,
- "select(%d, ...) == %d, errno %d/%s",
- maxfd, cc, errno, strerror(errno));
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL))
+ manager_log(manager, IOEVENT,
+ "select(%d, ...) == %d, "
+ "errno %d/%s",
+ maxfd, cc, errno, strerror(errno));
if (cc < 0) {
if (!SOFT_ERROR(errno))
FATAL_ERROR(__FILE__, __LINE__,
From 9317787889b6d2437b2f8e77583b49246f7511fe Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Thu, 13 Jul 2000 01:16:22 +0000
Subject: [PATCH 063/226] use isc_log_wouldlog()
---
lib/dns/dispatch.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c
index 0c6c2de5d8..3b2ef22338 100644
--- a/lib/dns/dispatch.c
+++ b/lib/dns/dispatch.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dispatch.c,v 1.58 2000/07/04 01:48:10 tale Exp $ */
+/* $Id: dispatch.c,v 1.59 2000/07/13 01:16:22 gson Exp $ */
#include
@@ -189,6 +189,9 @@ dispatch_log(dns_dispatch_t *disp, int level, const char *fmt, ...) {
char msgbuf[2048];
va_list ap;
+ if (! isc_log_wouldlog(dns_lctx, level))
+ return;
+
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
From 738310d8cf560c8e246c81d5ecccf4c96e567a58 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 01:22:38 +0000
Subject: [PATCH 064/226] It's probably a bad idea to pre-allocate 64K buffers
for each lookup as soon as you read in the batch file. Don't.
---
bin/dig/dig.c | 8 ++++----
bin/dig/dighost.c | 15 +++++++++++++--
bin/dig/host.c | 4 ++--
bin/dig/include/dig/dig.h | 6 +++---
bin/dig/nslookup.c | 4 ++--
5 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index 1d8943fde5..de80861cfe 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.61 2000/07/12 17:44:03 mws Exp $ */
+/* $Id: dig.c,v 1.62 2000/07/13 01:22:33 mws Exp $ */
#include
#include
@@ -1047,7 +1047,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
strcpy(lookup->rttext, "ptr");
strcpy(lookup->rctext, "in");
lookup->namespace[0] = 0;
- lookup->sendspace[0] = 0;
+ lookup->sendspace = NULL;
lookup->sendmsg = NULL;
lookup->name = NULL;
lookup->oname = NULL;
@@ -1112,7 +1112,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->rttext[0] = 0;
lookup->rctext[0] = 0;
lookup->namespace[0] = 0;
- lookup->sendspace[0] = 0;
+ lookup->sendspace = NULL;
lookup->sendmsg = NULL;
lookup->name = NULL;
lookup->oname = NULL;
@@ -1189,7 +1189,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->pending = ISC_FALSE;
lookup->rctext[0] = 0;
lookup->namespace[0] = 0;
- lookup->sendspace[0] = 0;
+ lookup->sendspace = NULL;
lookup->sendmsg = NULL;
lookup->name = NULL;
lookup->oname = NULL;
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 50b1e6523d..60c5ed006a 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.78 2000/07/13 00:32:20 mws Exp $ */
+/* $Id: dighost.c,v 1.79 2000/07/13 01:22:34 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -252,7 +252,7 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
strncpy(looknew->rttext, lookold-> rttext, 32);
strncpy(looknew->rctext, lookold-> rctext, 32);
looknew->namespace[0] = 0;
- looknew->sendspace[0] = 0;
+ looknew->sendspace = NULL;
looknew->sendmsg = NULL;
looknew->name = NULL;
looknew->oname = NULL;
@@ -645,6 +645,8 @@ clear_query(dig_query_t *query) {
if (ISC_LINK_LINKED(&query->lengthbuf, link))
ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
link);
+ INSIST(query->recvspace != NULL);
+ isc_mem_put(mctx, query->recvspace, COMMSIZE);
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_invalidate(&query->lengthbuf);
isc_mem_free(mctx, query);
@@ -683,6 +685,8 @@ try_clear_lookup(dig_lookup_t *lookup) {
}
if (lookup->timer != NULL)
isc_timer_detach(&lookup->timer);
+ INSIST(lookup->sendspace != NULL);
+ isc_mem_put(mctx, lookup->sendspace, COMMSIZE);
ptr = lookup;
lookup = ISC_LIST_NEXT(lookup, link);
@@ -1129,6 +1133,10 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->querysig = NULL;
}
+ lookup->sendspace = isc_mem_get(mctx, COMMSIZE);
+ if (lookup->sendspace == NULL)
+ fatal("memory allocation failure");
+
debug("starting to render the message");
isc_buffer_init(&lookup->sendbuf, lookup->sendspace, COMMSIZE);
result = dns_message_renderbegin(lookup->sendmsg, &lookup->sendbuf);
@@ -1172,6 +1180,9 @@ setup_lookup(dig_lookup_t *lookup) {
ISC_LIST_INIT(query->recvlist);
ISC_LIST_INIT(query->lengthlist);
query->sock = NULL;
+ query->recvspace = isc_mem_get(mctx, COMMSIZE);
+ if (query->recvspace == NULL)
+ fatal("memory allocation failure");
isc_buffer_init(&query->recvbuf, query->recvspace, COMMSIZE);
isc_buffer_init(&query->lengthbuf, query->lengthspace, 2);
diff --git a/bin/dig/host.c b/bin/dig/host.c
index ca67b84600..d73a1f5069 100644
--- a/bin/dig/host.c
+++ b/bin/dig/host.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: host.c,v 1.37 2000/07/10 18:02:29 bwelling Exp $ */
+/* $Id: host.c,v 1.38 2000/07/13 01:22:35 mws Exp $ */
#include
#include
@@ -661,7 +661,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
strncpy(lookup->rttext, querytype, 32);
strncpy(lookup->rctext, queryclass, 32);
lookup->namespace[0] = 0;
- lookup->sendspace[0] = 0;
+ lookup->sendspace = NULL;
lookup->sendmsg = NULL;
lookup->name = NULL;
lookup->oname = NULL;
diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h
index 66d2c3f431..120f7c3201 100644
--- a/bin/dig/include/dig/dig.h
+++ b/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.h,v 1.30 2000/07/10 18:02:31 bwelling Exp $ */
+/* $Id: dig.h,v 1.31 2000/07/13 01:22:38 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -99,7 +99,7 @@ struct dig_lookup {
isc_buffer_t namebuf;
isc_buffer_t onamebuf;
isc_buffer_t sendbuf;
- char sendspace[COMMSIZE];
+ char *sendspace;
dns_name_t *name;
isc_timer_t *timer;
isc_interval_t interval;
@@ -139,7 +139,7 @@ struct dig_query {
isc_buffer_t recvbuf,
lengthbuf,
slbuf;
- char recvspace[COMMSIZE],
+ char *recvspace,
lengthspace[4],
slspace[4];
isc_socket_t *sock;
diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c
index 6de37deabf..5f032a4923 100644
--- a/bin/dig/nslookup.c
+++ b/bin/dig/nslookup.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.23 2000/07/05 23:28:30 mws Exp $ */
+/* $Id: nslookup.c,v 1.24 2000/07/13 01:22:36 mws Exp $ */
#include
@@ -651,7 +651,7 @@ addlookup(char *opt) {
strncpy (lookup->rttext, deftype, MXNAME);
strncpy (lookup->rctext, defclass, MXNAME);
lookup->namespace[0]=0;
- lookup->sendspace[0]=0;
+ lookup->sendspace = NULL;
lookup->sendmsg=NULL;
lookup->name=NULL;
lookup->oname=NULL;
From 2935e25e99a4b93126a9aebcc94cd52c7aa8ca67 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 01:22:56 +0000
Subject: [PATCH 065/226] Removed debugging code that is no longer useful.
---
lib/isc/unix/socket.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
index 7c8900350d..f666db91d3 100644
--- a/lib/isc/unix/socket.c
+++ b/lib/isc/unix/socket.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: socket.c,v 1.149 2000/07/13 01:13:53 bwelling Exp $ */
+/* $Id: socket.c,v 1.150 2000/07/13 01:22:56 bwelling Exp $ */
#include
@@ -1811,11 +1811,6 @@ watcher(void *uap) {
UNLOCK(&manager->lock);
cc = select(maxfd, &readfds, &writefds, NULL, NULL);
- if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL))
- manager_log(manager, IOEVENT,
- "select(%d, ...) == %d, "
- "errno %d/%s",
- maxfd, cc, errno, strerror(errno));
if (cc < 0) {
if (!SOFT_ERROR(errno))
FATAL_ERROR(__FILE__, __LINE__,
From 0072e42780cda66e72303bb6449a9ad8bbbc8fe4 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Thu, 13 Jul 2000 01:38:40 +0000
Subject: [PATCH 066/226] use isc_log_wouldlog() in manager_log()
---
lib/isc/unix/socket.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
index f666db91d3..ce57288544 100644
--- a/lib/isc/unix/socket.c
+++ b/lib/isc/unix/socket.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: socket.c,v 1.150 2000/07/13 01:22:56 bwelling Exp $ */
+/* $Id: socket.c,v 1.151 2000/07/13 01:38:40 gson Exp $ */
#include
@@ -234,6 +234,9 @@ manager_log(isc_socketmgr_t *sockmgr,
char msgbuf[2048];
va_list ap;
+ if (! isc_log_wouldlog(isc_lctx, level))
+ return;
+
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
From 77365675e9db53de6ef728c98fc696ce86e88e63 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 01:49:44 +0000
Subject: [PATCH 067/226] Use mempools instead of free lists for the comm
buffers.
---
bin/dig/dighost.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 60c5ed006a..944a638ccf 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.79 2000/07/13 01:22:34 mws Exp $ */
+/* $Id: dighost.c,v 1.80 2000/07/13 01:49:44 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -103,7 +103,7 @@ isc_buffer_t *namebuf = NULL;
dns_tsigkey_t *key = NULL;
isc_boolean_t validated = ISC_TRUE;
isc_entropy_t *entp = NULL;
-
+isc_mempool_t *commctx = NULL;
extern isc_boolean_t isc_mem_debugging;
isc_boolean_t debugging = ISC_FALSE;
char *progname = NULL;
@@ -142,7 +142,6 @@ hex_dump(isc_buffer_t *b) {
printf("\n");
}
-
void
fatal(const char *format, ...) {
va_list args;
@@ -566,6 +565,16 @@ setup_libs(void) {
result = dst_lib_init(mctx, entp, 0);
check_result(result, "dst_lib_init");
is_dst_up = ISC_TRUE;
+
+ result = isc_mempool_create(mctx, COMMSIZE, &commctx);
+ check_result(result, "isc_mempool_create");
+ isc_mempool_setname(commctx, "COMMPOOL");
+ /*
+ * 6 and 2 set as reasonable parameters for 3 or 4 nameserver
+ * systems.
+ */
+ isc_mempool_setfreemax(commctx, 6);
+ isc_mempool_setfillcount(commctx, 2);
}
static void
@@ -646,7 +655,7 @@ clear_query(dig_query_t *query) {
ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
link);
INSIST(query->recvspace != NULL);
- isc_mem_put(mctx, query->recvspace, COMMSIZE);
+ isc_mempool_put(commctx, query->recvspace);
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_invalidate(&query->lengthbuf);
isc_mem_free(mctx, query);
@@ -686,7 +695,7 @@ try_clear_lookup(dig_lookup_t *lookup) {
if (lookup->timer != NULL)
isc_timer_detach(&lookup->timer);
INSIST(lookup->sendspace != NULL);
- isc_mem_put(mctx, lookup->sendspace, COMMSIZE);
+ isc_mempool_put(commctx, lookup->sendspace);
ptr = lookup;
lookup = ISC_LIST_NEXT(lookup, link);
@@ -1133,7 +1142,7 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->querysig = NULL;
}
- lookup->sendspace = isc_mem_get(mctx, COMMSIZE);
+ lookup->sendspace = isc_mempool_get(commctx);
if (lookup->sendspace == NULL)
fatal("memory allocation failure");
@@ -1180,7 +1189,7 @@ setup_lookup(dig_lookup_t *lookup) {
ISC_LIST_INIT(query->recvlist);
ISC_LIST_INIT(query->lengthlist);
query->sock = NULL;
- query->recvspace = isc_mem_get(mctx, COMMSIZE);
+ query->recvspace = isc_mempool_get(commctx);
if (query->recvspace == NULL)
fatal("memory allocation failure");
@@ -2187,6 +2196,10 @@ free_lists(void) {
o = ISC_LIST_NEXT(o, link);
isc_mem_free(mctx, ptr);
}
+ if (commctx != NULL) {
+ debug("freeing commctx");
+ isc_mempool_destroy(&commctx);
+ }
if (socketmgr != NULL) {
debug("freeing socketmgr");
isc_socketmgr_destroy(&socketmgr);
From 58cdafb232d9226b8110301536f97a55b541bf5c Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 02:14:17 +0000
Subject: [PATCH 068/226] Style changes, nothing functional
---
bin/dig/dighost.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 944a638ccf..477af1ea8a 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.80 2000/07/13 01:49:44 mws Exp $ */
+/* $Id: dighost.c,v 1.81 2000/07/13 02:14:17 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -146,7 +146,7 @@ void
fatal(const char *format, ...) {
va_list args;
- fprintf (stderr, "%s: ", progname);
+ fprintf(stderr, "%s: ", progname);
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
@@ -495,7 +495,7 @@ setup_system(void) {
dns_rootname, ISC_FALSE,
namebuf);
if (result != ISC_R_SUCCESS) {
- printf (";; Couldn't create key %s: %s\n",
+ printf(";; Couldn't create key %s: %s\n",
keynametext, dns_result_totext(result));
goto SYSSETUP_FAIL;
}
@@ -773,7 +773,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
isc_result_totext(result));
if ((section == DNS_SECTION_ANSWER) &&
(query->lookup->trace || query->lookup->ns_search_only))
- followup_lookup (msg, query, DNS_SECTION_AUTHORITY);
+ followup_lookup(msg, query, DNS_SECTION_AUTHORITY);
return;
}
@@ -860,7 +860,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
loopresult = dns_rdataset_next(rdataset);
}
}
- result = dns_message_nextname (msg, section);
+ result = dns_message_nextname(msg, section);
if (result != ISC_R_SUCCESS)
break;
}
@@ -2137,7 +2137,7 @@ cancel_all(void) {
dig_lookup_t *l;
dig_query_t *q;
- debug ("cancel_all()");
+ debug("cancel_all()");
l = ISC_LIST_HEAD(lookup_list);
while (l != NULL) {
From 4532e9e7c666375dd329b067b0805ef77f72df08 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Thu, 13 Jul 2000 02:28:18 +0000
Subject: [PATCH 069/226] in isc_log_wouldlog(), deal with the possibility of
lctx being NULL
---
lib/isc/log.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/isc/log.c b/lib/isc/log.c
index e3c5d308bc..e9f7260371 100644
--- a/lib/isc/log.c
+++ b/lib/isc/log.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: log.c,v 1.39 2000/07/13 00:18:51 gson Exp $ */
+/* $Id: log.c,v 1.40 2000/07/13 02:28:18 gson Exp $ */
/* Principal Authors: DCL */
@@ -1216,6 +1216,9 @@ isc_log_wouldlog(isc_log_t *lctx, int level) {
* dynamically changed.
*/
+ if (lctx == NULL)
+ return (ISC_FALSE);
+
return (ISC_TF(level <= lctx->logconfig->highest_level ||
(lctx->logconfig->dynamic &&
level <= lctx->debug_level)));
From 618e871c2eb80021673bedf083496ccd1bf65cd0 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 02:41:20 +0000
Subject: [PATCH 070/226] Add DNS_R_NAMETOOLONG
---
lib/dns/include/dns/result.h | 4 ++--
lib/dns/result.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h
index 91452f90e4..6da4907d92 100644
--- a/lib/dns/include/dns/result.h
+++ b/lib/dns/include/dns/result.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: result.h,v 1.60 2000/07/04 03:59:53 marka Exp $ */
+/* $Id: result.h,v 1.61 2000/07/13 02:41:20 bwelling Exp $ */
#ifndef DNS_RESULT_H
#define DNS_RESULT_H 1
@@ -58,7 +58,7 @@
#define DNS_R_NOOWNER (ISC_RESULTCLASS_DNS + 19)
#define DNS_R_NOTTL (ISC_RESULTCLASS_DNS + 20)
#define DNS_R_BADCLASS (ISC_RESULTCLASS_DNS + 21)
-/* 22 is unused */
+#define DNS_R_NAMETOOLONG (ISC_RESULTCLASS_DNS + 22)
#define DNS_R_PARTIALMATCH (ISC_RESULTCLASS_DNS + 23)
#define DNS_R_NEWORIGIN (ISC_RESULTCLASS_DNS + 24)
#define DNS_R_UNCHANGED (ISC_RESULTCLASS_DNS + 25)
diff --git a/lib/dns/result.c b/lib/dns/result.c
index 6a9d9d6fc1..b1ed52d2bf 100644
--- a/lib/dns/result.c
+++ b/lib/dns/result.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: result.c,v 1.64 2000/07/04 03:59:51 marka Exp $ */
+/* $Id: result.c,v 1.65 2000/07/13 02:41:19 bwelling Exp $ */
#include
@@ -48,7 +48,7 @@ static const char *text[DNS_R_NRESULTS] = {
"no owner", /* 19 */
"no ttl", /* 20 */
"bad class", /* 21 */
- "UNUSED22", /* 22 */
+ "name too long", /* 22 */
"partial match", /* 23 */
"new origin", /* 24 */
"unchanged", /* 25 */
From 425028583845247a2e09532a88e58165e82924f4 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 18:10:18 +0000
Subject: [PATCH 071/226] Return DNS_R_NAMETOOLONG in a few places where less
useful errors were returned before.
---
lib/dns/include/dns/name.h | 3 ++-
lib/dns/name.c | 8 ++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h
index 11ba00c568..1ce797c996 100644
--- a/lib/dns/include/dns/name.h
+++ b/lib/dns/include/dns/name.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: name.h,v 1.73 2000/06/22 21:55:49 tale Exp $ */
+/* $Id: name.h,v 1.74 2000/07/13 18:10:16 bwelling Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
@@ -931,6 +931,7 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix,
* Returns:
* ISC_R_SUCCESS
* ISC_R_NOSPACE
+ * DNS_R_NAMETOOLONG
*/
isc_result_t
diff --git a/lib/dns/name.c b/lib/dns/name.c
index 67690c9f61..00593ff2b7 100644
--- a/lib/dns/name.c
+++ b/lib/dns/name.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: name.c,v 1.93 2000/06/22 21:54:32 tale Exp $ */
+/* $Id: name.c,v 1.94 2000/07/13 18:10:18 bwelling Exp $ */
#include
@@ -2345,7 +2345,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
* The name did not fit even though we had a buffer
* big enough to fit a maximum-length name.
*/
- return (DNS_R_FORMERR);
+ return (DNS_R_NAMETOOLONG);
else
/*
* The name might fit if only the caller could give us a
@@ -2513,6 +2513,10 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name,
length += suffix->length;
labels += suffix->labels;
}
+ if (length > 255) {
+ MAKE_EMPTY(name);
+ return (DNS_R_NAMETOOLONG);
+ }
if (length > nrem) {
MAKE_EMPTY(name);
return (ISC_R_NOSPACE);
From c5ec9b45bbf7175cf3c9b36293555c93bb703d93 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 18:52:58 +0000
Subject: [PATCH 072/226] Lots of duplicate code removed +tcp mode bug fixed
---
bin/dig/dig.c | 545 ++++++++++----------------------------
bin/dig/dighost.c | 106 ++++++--
bin/dig/include/dig/dig.h | 8 +-
3 files changed, 225 insertions(+), 434 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index de80861cfe..e1d96eab00 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.62 2000/07/13 01:22:33 mws Exp $ */
+/* $Id: dig.c,v 1.63 2000/07/13 18:52:55 mws Exp $ */
#include
#include
@@ -556,13 +556,13 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
isc_boolean_t have_host = ISC_FALSE;
dig_server_t *srv = NULL;
dig_lookup_t *lookup = NULL;
+ static dig_lookup_t *default_lookup = NULL;
char *batchname = NULL;
char batchline[MXNAME];
char address[MXNAME];
FILE *fp = NULL;
int bargc;
char *bargv[16];
- char bargv0[sizeof("dig")];
int i, n;
int adrs[4];
int rc;
@@ -575,8 +575,16 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
* otherwise make it apply to the latest host. This is
* a bit different than the previous versions, but should
* form a consistent user interface.
+ *
+ * First, create a "default lookup" which won't actually be used
+ * anywhere, except for cloning into new lookups
*/
+ if (!is_batchfile)
+ default_lookup = make_empty_lookup();
+
+ lookup = default_lookup;
+
rc = argc;
rv = argv;
for (rc--, rv++; rc > 0; rc--, rv++) {
@@ -589,42 +597,26 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (srv == NULL)
fatal("Memory allocation failure");
strncpy(srv->servername, &rv[0][1], MXNAME-1);
- if (is_batchfile && have_host) {
- if (!lookup->use_my_server_list) {
- ISC_LIST_INIT(lookup->
- my_server_list);
- lookup->use_my_server_list =
- ISC_TRUE;
- }
- ISC_LIST_APPEND(lookup->my_server_list,
- srv, link);
- } else {
- ISC_LIST_APPEND(server_list, srv, link);
+ if (!lookup->use_my_server_list) {
+ ISC_LIST_INIT(lookup->
+ my_server_list);
+ lookup->use_my_server_list =
+ ISC_TRUE;
}
+ ISC_LIST_APPEND(lookup->my_server_list,
+ srv, link);
} else if ((strcmp(rv[0], "+vc") == 0)
&& (!is_batchfile)) {
- if (have_host)
- lookup->tcp_mode = ISC_TRUE;
- else
- tcpmode = ISC_TRUE;
+ lookup->tcp_mode = ISC_TRUE;
} else if ((strcmp(rv[0], "+novc") == 0)
&& (!is_batchfile)) {
- if (have_host)
- lookup->tcp_mode = ISC_FALSE;
- else
- tcpmode = ISC_FALSE;
+ lookup->tcp_mode = ISC_FALSE;
} else if ((strcmp(rv[0], "+tcp") == 0)
&& (!is_batchfile)) {
- if (have_host)
- lookup->tcp_mode = ISC_TRUE;
- else
- tcpmode = ISC_TRUE;
+ lookup->tcp_mode = ISC_TRUE;
} else if ((strcmp(rv[0], "+notcp") == 0)
&& (!is_batchfile)) {
- if (have_host)
- lookup->tcp_mode = ISC_FALSE;
- else
- tcpmode = ISC_FALSE;
+ lookup->tcp_mode = ISC_FALSE;
} else if (strncmp(rv[0], "+domain=", 8) == 0) {
/* Global option always */
strncpy(fixeddomain, &rv[0][8], MXNAME);
@@ -634,15 +626,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
} else if (strncmp(rv[0], "+nosea", 6) == 0) {
usesearch = ISC_FALSE;
} else if (strncmp(rv[0], "+defn", 5) == 0) {
- if (have_host)
- lookup->defname = ISC_TRUE;
- else
- defname = ISC_TRUE;
+ lookup->defname = ISC_TRUE;
} else if (strncmp(rv[0], "+nodefn", 7) == 0) {
- if (have_host)
- lookup->defname = ISC_FALSE;
- else
- defname = ISC_FALSE;
+ lookup->defname = ISC_FALSE;
} else if (strncmp(rv[0], "+time=", 6) == 0) {
/* Global option always */
timeout = atoi(&rv[0][6]);
@@ -656,150 +642,71 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
timeout = 1;
debug("timeout set to %d", timeout);
} else if (strncmp(rv[0], "+tries=", 7) == 0) {
- if (have_host) {
- lookup->retries = atoi(&rv[0][7]);
- if (lookup->retries <= 0)
- lookup->retries = 1;
- } else {
- tries = atoi(&rv[0][7]);
- if (tries <= 0)
- tries = 1;
- }
+ lookup->retries = atoi(&rv[0][7]);
+ if (lookup->retries <= 0)
+ lookup->retries = 1;
} else if (strncmp(rv[0], "+buf=", 5) == 0) {
- if (have_host) {
- lookup->udpsize = atoi(&rv[0][5]);
- if (lookup->udpsize <= 0)
- lookup->udpsize = 0;
- if (lookup->udpsize > COMMSIZE)
- lookup->udpsize = COMMSIZE;
- } else {
- bufsize = atoi(&rv[0][5]);
- if (bufsize <= 0)
- bufsize = 0;
- if (bufsize > COMMSIZE)
- bufsize = COMMSIZE;
- }
+ lookup->udpsize = atoi(&rv[0][5]);
+ if (lookup->udpsize <= 0)
+ lookup->udpsize = 0;
+ if (lookup->udpsize > COMMSIZE)
+ lookup->udpsize = COMMSIZE;
} else if (strncmp(rv[0], "+bufsize=", 9) == 0) {
- if (have_host) {
- lookup->udpsize = atoi(&rv[0][9]);
- if (lookup->udpsize <= 0)
- lookup->udpsize = 0;
- if (lookup->udpsize > COMMSIZE)
- lookup->udpsize = COMMSIZE;
- } else {
- bufsize = atoi(&rv[0][9]);
- if (bufsize <= 0)
- bufsize = 0;
- if (bufsize > COMMSIZE)
- bufsize = COMMSIZE;
- }
+ lookup->udpsize = atoi(&rv[0][9]);
+ if (lookup->udpsize <= 0)
+ lookup->udpsize = 0;
+ if (lookup->udpsize > COMMSIZE)
+ lookup->udpsize = COMMSIZE;
} else if (strncmp(rv[0], "+ndots=", 7) == 0) {
/* Global option always */
ndots = atoi(&rv[0][7]);
if (ndots < 0)
ndots = 0;
} else if (strncmp(rv[0], "+rec", 4) == 0) {
- if (have_host)
- lookup->recurse = ISC_TRUE;
- else
- recurse = ISC_TRUE;
+ lookup->recurse = ISC_TRUE;
} else if (strncmp(rv[0], "+norec", 6) == 0) {
- if (have_host)
- lookup->recurse = ISC_FALSE;
- else
- recurse = ISC_FALSE;
+ lookup->recurse = ISC_FALSE;
} else if (strncmp(rv[0], "+aa", 3) == 0) {
- if (have_host)
- lookup->aaonly = ISC_TRUE;
- else
- aaonly = ISC_TRUE;
+ lookup->aaonly = ISC_TRUE;
} else if (strncmp(rv[0], "+noaa", 5) == 0) {
- if (have_host)
- lookup->aaonly = ISC_FALSE;
- else
- aaonly = ISC_FALSE;
+ lookup->aaonly = ISC_FALSE;
} else if (strncmp(rv[0], "+adf", 4) == 0) {
- if (have_host)
- lookup->adflag = ISC_TRUE;
- else
- adflag = ISC_TRUE;
+ lookup->adflag = ISC_TRUE;
} else if (strncmp(rv[0], "+noadf", 6) == 0) {
- if (have_host)
- lookup->adflag = ISC_FALSE;
- else
- adflag = ISC_FALSE;
+ lookup->adflag = ISC_FALSE;
} else if (strncmp(rv[0], "+cd", 3) == 0) {
- if (have_host)
- lookup->cdflag = ISC_TRUE;
- else
- cdflag = ISC_TRUE;
+ lookup->cdflag = ISC_TRUE;
} else if (strncmp(rv[0], "+nocd", 5) == 0) {
- if (have_host)
- lookup->cdflag = ISC_FALSE;
- else
- cdflag = ISC_FALSE;
+ lookup->cdflag = ISC_FALSE;
} else if (strncmp(rv[0], "+ns", 3) == 0) {
- if (have_host) {
- lookup->ns_search_only = ISC_TRUE;
- lookup->trace_root = ISC_TRUE;
- lookup->recurse = ISC_FALSE;
- lookup->identify = ISC_TRUE;
- lookup->stats = ISC_FALSE;
- if (!forcecomment)
- lookup->comments = ISC_FALSE;
- lookup->section_additional = ISC_FALSE;
- lookup->section_authority = ISC_FALSE;
- lookup->section_question = ISC_FALSE;
- } else {
- ns_search_only = ISC_TRUE;
- recurse = ISC_FALSE;
- identify = ISC_TRUE;
- stats = ISC_FALSE;
- if (!forcecomment)
- comments = ISC_FALSE;
- section_additional = ISC_FALSE;
- section_authority = ISC_FALSE;
- section_question = ISC_FALSE;
- }
+ lookup->ns_search_only = ISC_TRUE;
+ lookup->trace_root = ISC_TRUE;
+ lookup->recurse = ISC_FALSE;
+ lookup->identify = ISC_TRUE;
+ lookup->stats = ISC_FALSE;
+ if (!forcecomment)
+ lookup->comments = ISC_FALSE;
+ lookup->section_additional = ISC_FALSE;
+ lookup->section_authority = ISC_FALSE;
+ lookup->section_question = ISC_FALSE;
} else if (strncmp(rv[0], "+nons", 6) == 0) {
- if (have_host)
- lookup->ns_search_only = ISC_FALSE;
- else
- ns_search_only = ISC_FALSE;
+ lookup->ns_search_only = ISC_FALSE;
} else if (strncmp(rv[0], "+tr", 3) == 0) {
- if (have_host) {
- lookup->trace = ISC_TRUE;
- lookup->trace_root = ISC_TRUE;
- lookup->recurse = ISC_FALSE;
- lookup->identify = ISC_TRUE;
- if (!forcecomment) {
- lookup->comments = ISC_FALSE;
- lookup->stats = ISC_FALSE;
- }
- lookup->section_additional = ISC_FALSE;
- lookup->section_authority = ISC_TRUE;
- lookup->section_question = ISC_FALSE;
- show_details = ISC_TRUE;
- } else {
- trace = ISC_TRUE;
- recurse = ISC_FALSE;
- identify = ISC_TRUE;
- if (!forcecomment) {
- comments = ISC_FALSE;
- stats = ISC_FALSE;
- }
- section_additional = ISC_FALSE;
- section_authority = ISC_TRUE;
- section_question = ISC_FALSE;
- show_details = ISC_TRUE;
+ lookup->trace = ISC_TRUE;
+ lookup->trace_root = ISC_TRUE;
+ lookup->recurse = ISC_FALSE;
+ lookup->identify = ISC_TRUE;
+ if (!forcecomment) {
+ lookup->comments = ISC_FALSE;
+ lookup->stats = ISC_FALSE;
}
+ lookup->section_additional = ISC_FALSE;
+ lookup->section_authority = ISC_TRUE;
+ lookup->section_question = ISC_FALSE;
+ show_details = ISC_TRUE;
} else if (strncmp(rv[0], "+notr", 6) == 0) {
- if (have_host) {
- lookup->trace = ISC_FALSE;
- lookup->trace_root = ISC_FALSE;
- }
- else
- trace = ISC_FALSE;
+ lookup->trace = ISC_FALSE;
+ lookup->trace_root = ISC_FALSE;
} else if (strncmp(rv[0], "+det", 4) == 0) {
show_details = ISC_TRUE;
} else if (strncmp(rv[0], "+nodet", 6) == 0) {
@@ -811,156 +718,81 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
} else if (strncmp(rv[0], "+sho", 4) == 0) {
short_form = ISC_TRUE;
printcmd = ISC_FALSE;
- if (have_host) {
- lookup->section_additional = ISC_FALSE;
- lookup->section_authority = ISC_FALSE;
- lookup->section_question = ISC_FALSE;
- if (!forcecomment) {
- lookup->comments = ISC_FALSE;
- lookup->stats = ISC_FALSE;
- }
- } else {
- section_additional = ISC_FALSE;
- section_authority = ISC_FALSE;
- section_question = ISC_FALSE;
- if (!forcecomment) {
- comments = ISC_FALSE;
- stats = ISC_FALSE;
- }
+ lookup->section_additional = ISC_FALSE;
+ lookup->section_authority = ISC_FALSE;
+ lookup->section_question = ISC_FALSE;
+ if (!forcecomment) {
+ lookup->comments = ISC_FALSE;
+ lookup->stats = ISC_FALSE;
}
} else if (strncmp(rv[0], "+nosho", 6) == 0) {
short_form = ISC_FALSE;
} else if (strncmp(rv[0], "+id", 3) == 0) {
- if (have_host)
- lookup->identify = ISC_TRUE;
- else
- identify = ISC_TRUE;
+ lookup->identify = ISC_TRUE;
} else if (strncmp(rv[0], "+noid", 5) == 0) {
- if (have_host)
- lookup->identify = ISC_FALSE;
- else
- identify = ISC_FALSE;
+ lookup->identify = ISC_FALSE;
} else if (strncmp(rv[0], "+com", 4) == 0) {
- if (have_host)
- lookup->comments = ISC_TRUE;
- else
- comments = ISC_TRUE;
+ lookup->comments = ISC_TRUE;
forcecomment = ISC_TRUE;
} else if (strncmp(rv[0], "+nocom", 6) == 0) {
- if (have_host) {
- lookup->comments = ISC_FALSE;
- lookup->stats = ISC_FALSE;
- } else {
- comments = ISC_FALSE;
- stats = ISC_FALSE;
- }
+ lookup->comments = ISC_FALSE;
+ lookup->stats = ISC_FALSE;
forcecomment = ISC_FALSE;
} else if (strncmp(rv[0], "+sta", 4) == 0) {
- if (have_host)
- lookup->stats = ISC_TRUE;
- else
- stats = ISC_TRUE;
+ lookup->stats = ISC_TRUE;
} else if (strncmp(rv[0], "+nosta", 6) == 0) {
- if (have_host)
- lookup->stats = ISC_FALSE;
- else
- stats = ISC_FALSE;
+ lookup->stats = ISC_FALSE;
} else if (strncmp(rv[0], "+qr", 3) == 0) {
qr = ISC_TRUE;
} else if (strncmp(rv[0], "+noqr", 5) == 0) {
qr = ISC_FALSE;
} else if (strncmp(rv[0], "+que", 4) == 0) {
- if (have_host)
- lookup->section_question = ISC_TRUE;
- else
- section_question = ISC_TRUE;
+ lookup->section_question = ISC_TRUE;
} else if (strncmp(rv[0], "+noque", 6) == 0) {
- if (have_host)
- lookup->section_question = ISC_FALSE;
- else
- section_question = ISC_FALSE;
+ lookup->section_question = ISC_FALSE;
} else if (strncmp(rv[0], "+ans", 4) == 0) {
- if (have_host)
- lookup->section_answer = ISC_TRUE;
- else
- section_answer = ISC_TRUE;
+ lookup->section_answer = ISC_TRUE;
} else if (strncmp(rv[0], "+noans", 6) == 0) {
- if (have_host)
- lookup->section_answer = ISC_FALSE;
- else
- section_answer = ISC_FALSE;
+ lookup->section_answer = ISC_FALSE;
} else if (strncmp(rv[0], "+add", 4) == 0) {
- if (have_host)
- lookup->section_additional = ISC_TRUE;
- else
- section_additional = ISC_TRUE;
+ lookup->section_additional = ISC_TRUE;
} else if (strncmp(rv[0], "+noadd", 6) == 0) {
- if (have_host)
- lookup->section_additional = ISC_FALSE;
- else
- section_additional = ISC_FALSE;
+ lookup->section_additional = ISC_FALSE;
} else if (strncmp(rv[0], "+aut", 4) == 0) {
- if (have_host)
- lookup->section_authority = ISC_TRUE;
- else
- section_authority = ISC_TRUE;
+ lookup->section_authority = ISC_TRUE;
} else if (strncmp(rv[0], "+noaut", 6) == 0) {
- if (have_host)
lookup->section_authority = ISC_FALSE;
- else
- section_authority = ISC_FALSE;
} else if (strncmp(rv[0], "+all", 4) == 0) {
- if (have_host) {
- lookup->section_question = ISC_TRUE;
- lookup->section_authority = ISC_TRUE;
- lookup->section_answer = ISC_TRUE;
- lookup->section_additional = ISC_TRUE;
- lookup->comments = ISC_TRUE;
- } else {
- section_question = ISC_TRUE;
- section_authority = ISC_TRUE;
- section_answer = ISC_TRUE;
- section_additional = ISC_TRUE;
- comments = ISC_TRUE;
- }
+ lookup->section_question = ISC_TRUE;
+ lookup->section_authority = ISC_TRUE;
+ lookup->section_answer = ISC_TRUE;
+ lookup->section_additional = ISC_TRUE;
+ lookup->comments = ISC_TRUE;
} else if (strncmp(rv[0], "+noall", 6) == 0) {
- if (have_host) {
- lookup->section_question = ISC_FALSE;
- lookup->section_authority = ISC_FALSE;
- lookup->section_answer = ISC_FALSE;
- lookup->section_additional = ISC_FALSE;
- lookup->comments = ISC_FALSE;
- } else {
- section_question = ISC_FALSE;
- section_authority = ISC_FALSE;
- section_answer = ISC_FALSE;
- section_additional = ISC_FALSE;
- comments = ISC_FALSE;
- }
-
+ lookup->section_question = ISC_FALSE;
+ lookup->section_authority = ISC_FALSE;
+ lookup->section_answer = ISC_FALSE;
+ lookup->section_additional = ISC_FALSE;
+ lookup->comments = ISC_FALSE;
} else if (strncmp(rv[0], "-c", 2) == 0) {
- if (have_host) {
- if (rv[0][2] != 0) {
- strncpy(lookup->rctext, &rv[0][2],
- MXRD);
- } else {
- strncpy(lookup->rctext, rv[1],
- MXRD);
- rv++;
- rc--;
- }
+ if (rv[0][2] != 0) {
+ strncpy(lookup->rctext, &rv[0][2],
+ MXRD);
+ } else {
+ strncpy(lookup->rctext, rv[1],
+ MXRD);
+ rv++;
+ rc--;
}
} else if (strncmp(rv[0], "-t", 2) == 0) {
- if (have_host) {
- if (rv[0][2] != 0) {
- strncpy(lookup->rttext, &rv[0][2],
- MXRD);
- } else {
- strncpy(lookup->rttext, rv[1],
- MXRD);
- rv++;
- rc--;
- }
+ if (rv[0][2] != 0) {
+ strncpy(lookup->rttext, &rv[0][2],
+ MXRD);
+ } else {
+ strncpy(lookup->rttext, rv[1],
+ MXRD);
+ rv++;
+ rc--;
}
} else if (strncmp(rv[0], "-f", 2) == 0) {
if (rv[0][2] != 0) {
@@ -1031,12 +863,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
&adrs[2], &adrs[3]);
if (n == 0)
show_usage();
- lookup = isc_mem_allocate(mctx,
- sizeof(struct dig_lookup));
- if (lookup == NULL)
- fatal("Memory allocation failure");
- lookup->pending = ISC_FALSE;
- lookup->textname[0] = 0;
+
+ lookup = clone_lookup(default_lookup, ISC_TRUE);
+
for (i = n - 1; i >= 0; i--) {
snprintf(batchline, MXNAME/8, "%d.",
adrs[i]);
@@ -1044,50 +873,25 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
}
strncat(lookup->textname, "in-addr.arpa.", MXNAME);
debug("looking up %s", lookup->textname);
+ lookup->trace_root = ISC_TF(lookup->trace ||
+ lookup->ns_search_only);
strcpy(lookup->rttext, "ptr");
strcpy(lookup->rctext, "in");
- lookup->namespace[0] = 0;
- lookup->sendspace = NULL;
- lookup->sendmsg = NULL;
- lookup->name = NULL;
- lookup->oname = NULL;
- lookup->timer = NULL;
- lookup->xfr_q = NULL;
- lookup->origin = NULL;
- lookup->querysig = NULL;
- lookup->use_my_server_list = ISC_FALSE;
- lookup->trace = trace;
- lookup->trace_root = ISC_TF(trace || ns_search_only);
- lookup->ns_search_only = ns_search_only;
- lookup->doing_xfr = ISC_FALSE;
- lookup->ixfr_serial = 0;
- lookup->defname = ISC_FALSE;
- lookup->identify = identify;
- lookup->recurse = recurse;
- lookup->aaonly = aaonly;
- lookup->adflag = adflag;
- lookup->cdflag = cdflag;
- lookup->retries = tries;
- lookup->udpsize = bufsize;
- lookup->nsfound = 0;
- lookup->comments = comments;
- lookup->tcp_mode = tcpmode;
- lookup->stats = stats;
- lookup->section_question = section_question;
- lookup->section_answer = section_answer;
- lookup->section_authority = section_authority;
- lookup->section_additional = section_additional;
lookup->new_search = ISC_TRUE;
- ISC_LIST_INIT(lookup->q);
- lookup->origin = NULL;
- ISC_LIST_INIT(lookup->my_server_list);
+
ISC_LIST_APPEND(lookup_list, lookup, link);
have_host = ISC_TRUE;
rv++;
rc--;
} else {
+ /*
+ * If we decide to allow query type and class
+ * to be specified (without -t and -c options)
+ * before a host is given, all that needs to
+ * happen is the have_host test here get removed.
+ * Nothing should break by doing this.
+ */
if (have_host) {
- ENSURE(lookup != NULL);
if (strncmp(rv[0], "ixfr=", 5) == 0) {
strcpy(lookup->rttext, "ixfr");
lookup->ixfr_serial =
@@ -1103,49 +907,12 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
continue;
}
}
- lookup = isc_mem_allocate(mctx,
- sizeof(struct dig_lookup));
- if (lookup == NULL)
- fatal("Memory allocation failure");
- lookup->pending = ISC_FALSE;
+ lookup=clone_lookup(default_lookup, ISC_TRUE);
strncpy(lookup->textname, rv[0], MXNAME-1);
- lookup->rttext[0] = 0;
- lookup->rctext[0] = 0;
- lookup->namespace[0] = 0;
- lookup->sendspace = NULL;
- lookup->sendmsg = NULL;
- lookup->name = NULL;
- lookup->oname = NULL;
- lookup->timer = NULL;
- lookup->xfr_q = NULL;
- lookup->origin = NULL;
- lookup->querysig = NULL;
- lookup->use_my_server_list = ISC_FALSE;
- lookup->doing_xfr = ISC_FALSE;
- lookup->ixfr_serial = 0;
- lookup->defname = ISC_FALSE;
- lookup->trace_root = ISC_TF(trace || ns_search_only);
- lookup->trace = trace;
- lookup->ns_search_only = ns_search_only;
- lookup->identify = identify;
- lookup->recurse = recurse;
- lookup->aaonly = aaonly;
- lookup->adflag = adflag;
- lookup->cdflag = cdflag;
- lookup->retries = tries;
- lookup->udpsize = bufsize;
- lookup->nsfound = 0;
- lookup->comments = comments;
- lookup->tcp_mode = tcpmode;
- lookup->stats = stats;
- lookup->section_question = section_question;
- lookup->section_answer = section_answer;
- lookup->section_authority = section_authority;
- lookup->section_additional = section_additional;
+ lookup->trace_root = ISC_TF(lookup->trace ||
+ lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
- ISC_LIST_INIT(lookup->q);
ISC_LIST_APPEND(lookup_list, lookup, link);
- lookup->origin = NULL;
ISC_LIST_INIT(lookup->my_server_list);
have_host = ISC_TRUE;
debug("looking up %s", lookup->textname);
@@ -1168,63 +935,19 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
bargv[bargc] = strtok(NULL, " \t\r\n");
}
- /*
- * This silliness (instead of ``bargv[0] = "dig";'')
- * dances around the const string issue. If in
- * the future the 2nd argument to strncpy() is made
- * longer than three characters, don't forget to resize
- * bargv0 to accommodate it.
- */
- strncpy(bargv0, "dig", sizeof(bargv0));
- bargv[0] = bargv0;
+ bargv[0] = argv[0];
reorder_args(bargc, (char **)bargv);
parse_args(ISC_TRUE, bargc, (char **)bargv);
}
}
if (lookup_list.head == NULL) {
- lookup = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
- if (lookup == NULL)
- fatal("Memory allocation failure");
- lookup->pending = ISC_FALSE;
- lookup->rctext[0] = 0;
- lookup->namespace[0] = 0;
- lookup->sendspace = NULL;
- lookup->sendmsg = NULL;
- lookup->name = NULL;
- lookup->oname = NULL;
- lookup->timer = NULL;
- lookup->xfr_q = NULL;
- lookup->origin = NULL;
- lookup->querysig = NULL;
- lookup->use_my_server_list = ISC_FALSE;
- lookup->doing_xfr = ISC_FALSE;
- lookup->ixfr_serial = 0;
- lookup->defname = ISC_FALSE;
- lookup->trace_root = ISC_TF(trace || ns_search_only);
- lookup->trace = trace;
- lookup->ns_search_only = ns_search_only;
- lookup->identify = identify;
- lookup->recurse = recurse;
- lookup->aaonly = aaonly;
- lookup->adflag = adflag;
- lookup->cdflag = cdflag;
- lookup->retries = tries;
- lookup->udpsize = bufsize;
- lookup->nsfound = 0;
- lookup->comments = comments;
- lookup->tcp_mode = tcpmode;
- lookup->stats = stats;
- lookup->section_question = section_question;
- lookup->section_answer = section_answer;
- lookup->section_authority = section_authority;
- lookup->section_additional = section_additional;
+ lookup=clone_lookup(default_lookup, ISC_TRUE);
+ lookup->trace_root = ISC_TF(lookup->trace ||
+ lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
- ISC_LIST_INIT(lookup->q);
- ISC_LIST_INIT(lookup->my_server_list);
strcpy(lookup->textname, ".");
strcpy(lookup->rttext, "NS");
- lookup->rctext[0] = 0;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
if (!is_batchfile)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 477af1ea8a..1e78ee43de 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.81 2000/07/13 02:14:17 mws Exp $ */
+/* $Id: dighost.c,v 1.82 2000/07/13 18:52:57 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -231,32 +231,71 @@ istype(char *text) {
}
dig_lookup_t *
-requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
+make_empty_lookup(void) {
dig_lookup_t *looknew;
- dig_server_t *s, *srv;
- debug("requeue_lookup()");
+ debug("make_lookup()");
INSIST(!free_now);
- lookup_counter++;
- if (lookup_counter > LOOKUP_LIMIT)
- fatal("Too many lookups");
looknew = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
if (looknew == NULL)
fatal("Memory allocation failure in %s:%d",
__FILE__, __LINE__);
- looknew->pending = ISC_FALSE;
- strncpy(looknew->textname, lookold-> textname, MXNAME);
- strncpy(looknew->rttext, lookold-> rttext, 32);
- strncpy(looknew->rctext, lookold-> rctext, 32);
- looknew->namespace[0] = 0;
+ looknew->pending = ISC_TRUE;
+ looknew->textname[0]=0;
+ looknew->rttext[0]=0;
+ looknew->rctext[0]=0;
looknew->sendspace = NULL;
looknew->sendmsg = NULL;
looknew->name = NULL;
looknew->oname = NULL;
looknew->timer = NULL;
looknew->xfr_q = NULL;
+ looknew->doing_xfr = ISC_FALSE;
+ looknew->ixfr_serial = ISC_FALSE;
+ looknew->defname = ISC_FALSE;
+ looknew->trace = ISC_FALSE;
+ looknew->trace_root = ISC_FALSE;
+ looknew->identify = ISC_FALSE;
+ looknew->udpsize = 0;
+ looknew->recurse = ISC_TRUE;
+ looknew->aaonly = ISC_FALSE;
+ looknew->adflag = ISC_FALSE;
+ looknew->cdflag = ISC_FALSE;
+ looknew->ns_search_only = ISC_FALSE;
+ looknew->origin = NULL;
+ looknew->querysig = NULL;
+ looknew->retries = tries;
+ looknew->nsfound = 0;
+ looknew->tcp_mode = ISC_FALSE;
+ looknew->comments = ISC_TRUE;
+ looknew->stats = ISC_TRUE;
+ looknew->section_question = ISC_TRUE;
+ looknew->section_answer = ISC_TRUE;
+ looknew->section_authority = ISC_TRUE;
+ looknew->section_additional = ISC_TRUE;
+ looknew->new_search = ISC_FALSE;
+ ISC_LIST_INIT(looknew->my_server_list);
+ ISC_LIST_INIT(looknew->q);
+ looknew->use_my_server_list = ISC_FALSE;
+ return (looknew);
+}
+
+dig_lookup_t *
+clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
+ dig_lookup_t *looknew;
+ dig_server_t *s, *srv;
+
+ debug("clone_lookup()");
+
+ INSIST(!free_now);
+
+ looknew = make_empty_lookup();
+ INSIST(looknew != NULL);
+ strncpy(looknew->textname, lookold-> textname, MXNAME);
+ strncpy(looknew->rttext, lookold-> rttext, 32);
+ strncpy(looknew->rctext, lookold-> rctext, 32);
looknew->doing_xfr = lookold->doing_xfr;
looknew->ixfr_serial = lookold->ixfr_serial;
looknew->defname = lookold->defname;
@@ -269,10 +308,6 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
looknew->adflag = lookold->adflag;
looknew->cdflag = lookold->cdflag;
looknew->ns_search_only = lookold->ns_search_only;
- looknew->origin = NULL;
- looknew->querysig = NULL;
- looknew->retries = tries;
- looknew->nsfound = 0;
looknew->tcp_mode = lookold->tcp_mode;
looknew->comments = lookold->comments;
looknew->stats = lookold->stats;
@@ -280,11 +315,7 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
looknew->section_answer = lookold->section_answer;
looknew->section_authority = lookold->section_authority;
looknew->section_additional = lookold->section_additional;
- looknew->new_search = ISC_FALSE;
- ISC_LIST_INIT(looknew->my_server_list);
- ISC_LIST_INIT(looknew->q);
- looknew->use_my_server_list = ISC_FALSE;
if (servers) {
looknew->use_my_server_list = lookold->use_my_server_list;
if (looknew->use_my_server_list) {
@@ -303,6 +334,22 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
}
}
}
+ return (looknew);
+}
+
+dig_lookup_t *
+requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
+ dig_lookup_t *looknew;
+
+ debug("requeue_lookup()");
+
+ lookup_counter++;
+ if (lookup_counter > LOOKUP_LIMIT)
+ fatal("Too many lookups");
+
+ looknew = clone_lookup(lookold, servers);
+ INSIST(looknew != NULL);
+
debug("before insertion, init@%p "
"-> %p, new@%p -> %p",
lookold, lookold->link.next, looknew, looknew->link.next);
@@ -629,6 +676,9 @@ add_question(dns_message_t *message, dns_name_t *name,
static void
check_if_done(void) {
debug("check_if_done()");
+ debug("sockcount=%d, recvcount=%d, sendcount=%d, list %s",
+ sockcount, recvcount, sendcount,
+ ISC_LIST_EMPTY(lookup_list)?"empty":"full");
if ((sockcount == 0) && (recvcount == 0) && (sendcount == 0)
&& ISC_LIST_EMPTY(lookup_list)) {
debug("shutting down");
@@ -646,6 +696,8 @@ clear_query(dig_query_t *query) {
REQUIRE(query != NULL);
+ debug("clear_query(%p)",query);
+
lookup = query->lookup;
ISC_LIST_UNLINK(lookup->q, query, link);
if (ISC_LINK_LINKED(&query->recvbuf, link))
@@ -668,8 +720,12 @@ try_clear_lookup(dig_lookup_t *lookup) {
REQUIRE(lookup != NULL);
- if (ISC_LIST_HEAD(lookup->q) != NULL)
+ debug("try_clear_lookup(%p)", lookup);
+
+ if (ISC_LIST_HEAD(lookup->q) != NULL) {
+ debug("can't clear; query still pending.");
return (ISC_FALSE);
+ }
/*
* At this point, we know there are no queries on the lookup,
* so can make it go away also.
@@ -1363,6 +1419,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
isc_region_t r;
isc_result_t result;
dig_query_t *query=NULL;
+ dig_lookup_t *l;
isc_uint16_t length;
REQUIRE(event->ev_type == ISC_SOCKEVENT_RECVDONE);
@@ -1376,10 +1433,15 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
query = event->ev_arg;
+ recvcount--;
+ INSIST(recvcount >= 0);
+
if (sevent->result == ISC_R_CANCELED) {
query->working = ISC_FALSE;
isc_event_free(&event);
- check_next_lookup(query->lookup);
+ l = query->lookup;
+ clear_query(query);
+ check_next_lookup(l);
return;
}
if (sevent->result != ISC_R_SUCCESS) {
diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h
index 120f7c3201..bd2a52e866 100644
--- a/bin/dig/include/dig/dig.h
+++ b/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.h,v 1.31 2000/07/13 01:22:38 mws Exp $ */
+/* $Id: dig.h,v 1.32 2000/07/13 18:52:58 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -209,6 +209,12 @@ free_lists(void);
dig_lookup_t *
requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
+dig_lookup_t *
+make_empty_lookup(void);
+
+dig_lookup_t *
+clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
+
/*
* Routines needed in dig.c and host.c.
From 8f56f93547c0be53351ba2bf096e5c82de4dae25 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 21:01:00 +0000
Subject: [PATCH 073/226] Clean up duplicate code in host.c Fix a socket
cleanup problem which, in some isolated cases, prevented correct shutdown.
Remove +aa option completely.
---
bin/dig/dig.c | 8 +-------
bin/dig/dighost.c | 25 ++++++++++++-------------
bin/dig/host.c | 31 ++-----------------------------
3 files changed, 15 insertions(+), 49 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index e1d96eab00..52288028a5 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.63 2000/07/13 18:52:55 mws Exp $ */
+/* $Id: dig.c,v 1.64 2000/07/13 21:00:58 mws Exp $ */
#include
#include
@@ -86,7 +86,6 @@ isc_boolean_t
section_additional = ISC_TRUE,
recurse = ISC_TRUE,
defname = ISC_TRUE,
- aaonly = ISC_FALSE,
tcpmode = ISC_FALSE,
adflag = ISC_FALSE,
cdflag = ISC_FALSE;
@@ -159,7 +158,6 @@ show_usage(void) {
" +[no]search (Set whether to use searchlist)\n"
" +[no]defname (Set whether to use default domain)\n"
" +[no]recursive (Recursive mode)\n"
-" +[no]aaonly (Set AA flag in query)\n"
" +[no]adflag (Set AD flag in query)\n"
" +[no]cdflag (Set CD flag in query)\n"
" +[no]details (Show details of all requests)\n"
@@ -666,10 +664,6 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->recurse = ISC_TRUE;
} else if (strncmp(rv[0], "+norec", 6) == 0) {
lookup->recurse = ISC_FALSE;
- } else if (strncmp(rv[0], "+aa", 3) == 0) {
- lookup->aaonly = ISC_TRUE;
- } else if (strncmp(rv[0], "+noaa", 5) == 0) {
- lookup->aaonly = ISC_FALSE;
} else if (strncmp(rv[0], "+adf", 4) == 0) {
lookup->adflag = ISC_TRUE;
} else if (strncmp(rv[0], "+noadf", 6) == 0) {
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 1e78ee43de..eb78de81e0 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.82 2000/07/13 18:52:57 mws Exp $ */
+/* $Id: dighost.c,v 1.83 2000/07/13 21:00:59 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -260,7 +260,6 @@ make_empty_lookup(void) {
looknew->identify = ISC_FALSE;
looknew->udpsize = 0;
looknew->recurse = ISC_TRUE;
- looknew->aaonly = ISC_FALSE;
looknew->adflag = ISC_FALSE;
looknew->cdflag = ISC_FALSE;
looknew->ns_search_only = ISC_FALSE;
@@ -304,7 +303,6 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
looknew->identify = lookold->identify;
looknew->udpsize = lookold->udpsize;
looknew->recurse = lookold->recurse;
- looknew->aaonly = lookold->aaonly;
looknew->adflag = lookold->adflag;
looknew->cdflag = lookold->cdflag;
looknew->ns_search_only = lookold->ns_search_only;
@@ -707,6 +705,9 @@ clear_query(dig_query_t *query) {
ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
link);
INSIST(query->recvspace != NULL);
+ isc_socket_detach(&query->sock);
+ sockcount--;
+ debug("sockcount=%d", sockcount);
isc_mempool_put(commctx, query->recvspace);
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_invalidate(&query->lengthbuf);
@@ -1139,11 +1140,6 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->sendmsg->flags |= DNS_MESSAGEFLAG_RD;
}
- if (lookup->aaonly) {
- debug("AA query");
- lookup->sendmsg->flags |= DNS_MESSAGEFLAG_AA;
- }
-
if (lookup->adflag) {
debug("AD query");
lookup->sendmsg->flags |= DNS_MESSAGEFLAG_AD;
@@ -1287,9 +1283,6 @@ cancel_lookup(dig_lookup_t *lookup) {
if (query->sock != NULL) {
isc_socket_cancel(query->sock, global_task,
ISC_SOCKCANCEL_ALL);
- isc_socket_detach(&query->sock);
- sockcount--;
- debug("sockcount=%d", sockcount);
INSIST(sockcount >= 0);
check_if_done();
}
@@ -1406,7 +1399,7 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
ISC_SOCKCANCEL_ALL);
}
}
- ENSURE(lookup->timer != NULL);
+ INSIST(lookup->timer != NULL);
isc_timer_detach(&lookup->timer);
isc_buffer_free(&b);
debug("done with connect_timeout()");
@@ -1545,6 +1538,7 @@ connect_done(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
isc_socketevent_t *sevent = NULL;
dig_query_t *query = NULL;
+ dig_lookup_t *l;
isc_buffer_t *b = NULL;
isc_region_t r;
@@ -1572,13 +1566,18 @@ connect_done(isc_task_t *task, isc_event_t *event) {
printf(";; Connection to server %.*s for %s failed: %s.\n",
(int)r.length, r.base, query->lookup->textname,
isc_result_totext(sevent->result));
+ isc_socket_detach(&query->sock);
+ sockcount--;
+ INSIST(sockcount >= 0);
if (exitcode < 9)
exitcode = 9;
isc_buffer_free(&b);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
- check_next_lookup(query->lookup);
+ l = query->lookup;
+ clear_query(query);
+ check_next_lookup(l);
return;
}
launch_next_query(query, ISC_TRUE);
diff --git a/bin/dig/host.c b/bin/dig/host.c
index d73a1f5069..27b1205445 100644
--- a/bin/dig/host.c
+++ b/bin/dig/host.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: host.c,v 1.38 2000/07/13 01:22:35 mws Exp $ */
+/* $Id: host.c,v 1.39 2000/07/13 21:01:00 mws Exp $ */
#include
#include
@@ -627,9 +627,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
ISC_LIST_APPEND(server_list, srv, link);
}
- lookup = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
- if (lookup == NULL)
- fatal("Memory allocation failure.");
+ lookup = make_empty_lookup();
lookup->pending = ISC_FALSE;
/*
* XXXMWS Add IPv6 translation here, probably using inet_pton
@@ -660,36 +658,11 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
strcpy(queryclass, "in");
strncpy(lookup->rttext, querytype, 32);
strncpy(lookup->rctext, queryclass, 32);
- lookup->namespace[0] = 0;
- lookup->sendspace = NULL;
- lookup->sendmsg = NULL;
- lookup->name = NULL;
- lookup->oname = NULL;
- lookup->timer = NULL;
- lookup->xfr_q = NULL;
- lookup->origin = NULL;
- lookup->querysig = NULL;
- lookup->doing_xfr = ISC_FALSE;
- lookup->ixfr_serial = 0;
- lookup->defname = ISC_FALSE;
- lookup->identify = ISC_FALSE;
- lookup->recurse = recursion;
lookup->ns_search_only = showallsoa;
- lookup->use_my_server_list = ISC_FALSE;
- lookup->retries = tries;
- lookup->udpsize = 0;
- lookup->nsfound = 0;
- lookup->trace = ISC_FALSE;
lookup->trace_root = showallsoa;
lookup->tcp_mode = tcpmode;
lookup->new_search = ISC_TRUE;
- lookup->aaonly = ISC_FALSE;
- lookup->adflag = ISC_FALSE;
- lookup->cdflag = ISC_FALSE;
- ISC_LIST_INIT(lookup->q);
ISC_LIST_APPEND(lookup_list, lookup, link);
- lookup->origin = NULL;
- ISC_LIST_INIT(lookup->my_server_list);
}
int
From a31dbaa03fcb3cd5a182dab542b26bb3c4888aee Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 21:12:21 +0000
Subject: [PATCH 074/226] Replace +aa option, per AG.
---
bin/dig/dig.c | 7 ++++++-
bin/dig/dighost.c | 9 ++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index 52288028a5..6ed208ab5e 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.64 2000/07/13 21:00:58 mws Exp $ */
+/* $Id: dig.c,v 1.65 2000/07/13 21:12:20 mws Exp $ */
#include
#include
@@ -158,6 +158,7 @@ show_usage(void) {
" +[no]search (Set whether to use searchlist)\n"
" +[no]defname (Set whether to use default domain)\n"
" +[no]recursive (Recursive mode)\n"
+" +[no]aaonly (Set AA flag in query)\n"
" +[no]adflag (Set AD flag in query)\n"
" +[no]cdflag (Set CD flag in query)\n"
" +[no]details (Show details of all requests)\n"
@@ -664,6 +665,10 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->recurse = ISC_TRUE;
} else if (strncmp(rv[0], "+norec", 6) == 0) {
lookup->recurse = ISC_FALSE;
+ } else if (strncmp(rv[0], "+aa", 3) == 0) {
+ lookup->aaonly = ISC_TRUE;
+ } else if (strncmp(rv[0], "+noaa", 5) == 0) {
+ lookup->aaonly = ISC_FALSE;
} else if (strncmp(rv[0], "+adf", 4) == 0) {
lookup->adflag = ISC_TRUE;
} else if (strncmp(rv[0], "+noadf", 6) == 0) {
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index eb78de81e0..39a11b30e0 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.83 2000/07/13 21:00:59 mws Exp $ */
+/* $Id: dighost.c,v 1.84 2000/07/13 21:12:21 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -260,6 +260,7 @@ make_empty_lookup(void) {
looknew->identify = ISC_FALSE;
looknew->udpsize = 0;
looknew->recurse = ISC_TRUE;
+ looknew->aaonly = ISC_FALSE;
looknew->adflag = ISC_FALSE;
looknew->cdflag = ISC_FALSE;
looknew->ns_search_only = ISC_FALSE;
@@ -303,6 +304,7 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
looknew->identify = lookold->identify;
looknew->udpsize = lookold->udpsize;
looknew->recurse = lookold->recurse;
+ looknew->aaonly = lookold->aaonly;
looknew->adflag = lookold->adflag;
looknew->cdflag = lookold->cdflag;
looknew->ns_search_only = lookold->ns_search_only;
@@ -1140,6 +1142,11 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->sendmsg->flags |= DNS_MESSAGEFLAG_RD;
}
+ if (lookup->aaonly) {
+ debug("AA query");
+ lookup->sendmsg->flags |= DNS_MESSAGEFLAG_AA;
+ }
+
if (lookup->adflag) {
debug("AD query");
lookup->sendmsg->flags |= DNS_MESSAGEFLAG_AD;
From 0840ae769a95796a0a57da2dea8fb73086ce21d8 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Thu, 13 Jul 2000 22:53:51 +0000
Subject: [PATCH 075/226] When doing multi-stage lookups (like +trace and
+nss), don't wait for all of the servers being queried to return results if
we only need one of them.
---
bin/dig/dighost.c | 77 ++++++++++++++++++++++++++++++---------
bin/dig/include/dig/dig.h | 4 +-
2 files changed, 61 insertions(+), 20 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 39a11b30e0..9367242ff2 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.84 2000/07/13 21:12:21 mws Exp $ */
+/* $Id: dighost.c,v 1.85 2000/07/13 22:53:49 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -707,9 +707,11 @@ clear_query(dig_query_t *query) {
ISC_LIST_DEQUEUE(query->lengthlist, &query->lengthbuf,
link);
INSIST(query->recvspace != NULL);
- isc_socket_detach(&query->sock);
- sockcount--;
- debug("sockcount=%d", sockcount);
+ if (query->sock != NULL) {
+ isc_socket_detach(&query->sock);
+ sockcount--;
+ debug("sockcount=%d", sockcount);
+ }
isc_mempool_put(commctx, query->recvspace);
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_invalidate(&query->lengthbuf);
@@ -719,6 +721,7 @@ clear_query(dig_query_t *query) {
static isc_boolean_t
try_clear_lookup(dig_lookup_t *lookup) {
dig_server_t *s;
+ dig_query_t *q;
void *ptr;
REQUIRE(lookup != NULL);
@@ -726,8 +729,15 @@ try_clear_lookup(dig_lookup_t *lookup) {
debug("try_clear_lookup(%p)", lookup);
if (ISC_LIST_HEAD(lookup->q) != NULL) {
- debug("can't clear; query still pending.");
+ if (debugging) {
+ q = ISC_LIST_HEAD(lookup->q);
+ while (q != NULL) {
+ debug ("query to %s still pending",
+ q->servname);
+ q = ISC_LIST_NEXT(q, link);
+ }
return (ISC_FALSE);
+ }
}
/*
* At this point, we know there are no queries on the lookup,
@@ -773,6 +783,7 @@ static void
begin_next_lookup(void) {
dig_lookup_t *next;
+ debug("begin_next_lookup()");
next = ISC_LIST_HEAD(lookup_list);
if (next != NULL) {
setup_lookup(next);
@@ -794,7 +805,7 @@ check_next_lookup(dig_lookup_t *lookup) {
INSIST(!free_now);
- debug("is_lookup_done(%p)", lookup);
+ debug("check_next_lookup(%p)", lookup);
for (query = ISC_LIST_HEAD(lookup->q);
query != NULL;
query = ISC_LIST_NEXT(query, link)) {
@@ -851,7 +862,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
rdata.type);
if ((rdata.type == dns_rdatatype_ns) &&
(!query->lookup->trace_root ||
- (query->lookup->nsfound < ROOTNS)))
+ (query->lookup->nsfound < MXSERV)))
{
query->lookup->nsfound++;
result = isc_buffer_allocate(mctx, &b,
@@ -874,6 +885,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
if (!success) {
success = ISC_TRUE;
lookup_counter++;
+ cancel_lookup(query->lookup);
lookup = requeue_lookup
(query->lookup,
ISC_FALSE);
@@ -901,7 +913,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
my_server_list);
}
srv = isc_mem_allocate(mctx,
- sizeof(struct dig_server));
+ sizeof(struct dig_server));
if (srv == NULL)
fatal("Memory allocation "
"failure in %s:%d",
@@ -909,7 +921,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
strncpy(srv->servername,
(char *)r.base, len);
srv->servername[len] = 0;
- debug("adding server %s",
+ debug("adding1 server %s",
srv->servername);
ISC_LIST_APPEND
(lookup->my_server_list,
@@ -946,6 +958,7 @@ next_origin(dns_message_t *msg, dig_query_t *query) {
debug("made it to the root with nowhere to go");
return;
}
+ cancel_lookup(query->lookup);
lookup = requeue_lookup(query->lookup, ISC_TRUE);
lookup->defname = ISC_FALSE;
lookup->origin = ISC_LIST_NEXT(query->lookup->origin, link);
@@ -1266,14 +1279,34 @@ setup_lookup(dig_lookup_t *lookup) {
static void
send_done(isc_task_t *task, isc_event_t *event) {
+ isc_socketevent_t *sevent = NULL;
+ dig_query_t *query;
+ dig_lookup_t *l;
+
+ REQUIRE(event->ev_type == ISC_SOCKEVENT_SENDDONE);
+
UNUSED(task);
+ sevent = (isc_socketevent_t *)event;
+ query = event->ev_arg;
+
isc_event_free(&event);
debug("send_done()");
sendcount--;
debug("sendcount=%d",sendcount);
INSIST(sendcount >= 0);
+
+ if (sevent->result == ISC_R_CANCELED) {
+ debug("in send cancel handler");
+ query->working = ISC_FALSE;
+ query->waiting_connect = ISC_FALSE;
+ l = query->lookup;
+ clear_query(query);
+ check_next_lookup(l);
+ return;
+ }
+
}
void
@@ -1290,7 +1323,6 @@ cancel_lookup(dig_lookup_t *lookup) {
if (query->sock != NULL) {
isc_socket_cancel(query->sock, global_task,
ISC_SOCKCANCEL_ALL);
- INSIST(sockcount >= 0);
check_if_done();
}
}
@@ -1388,18 +1420,20 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
isc_buffer_usedregion(b, &r);
if ((q->lookup->retries > 1) &&
(!q->lookup->tcp_mode))
- printf(";; Connection to server %.*s "
+ printf(";; Connection to %.*s(%s) "
"for %s timed out. "
"Retrying %d.\n",
(int)r.length, r.base,
+ q->servname,
q->lookup->textname,
q->lookup->retries-1);
else {
printf(";; Connection to "
- "server %.*s "
+ "%.*s(%s) "
"for %s timed out. "
"Giving up.\n",
(int)r.length, r.base,
+ q->servname,
q->lookup->textname);
}
isc_socket_cancel(q->sock, task,
@@ -1493,6 +1527,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
static void
launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
isc_result_t result;
+ dig_lookup_t *l;
INSIST(!free_now);
@@ -1506,7 +1541,9 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
INSIST(sockcount >= 0);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
- check_next_lookup(query->lookup);
+ l = query->lookup;
+ clear_query(query);
+ check_next_lookup(l);
return;
}
@@ -1564,20 +1601,24 @@ connect_done(isc_task_t *task, isc_event_t *event) {
query->waiting_connect = ISC_FALSE;
if (sevent->result != ISC_R_SUCCESS) {
- debug("buffer allocate connect_timeout");
+ debug("unsuccessful connection: %s",
+ isc_result_totext(sevent->result));
result = isc_buffer_allocate(mctx, &b, 256);
check_result(result, "isc_buffer_allocate");
result = isc_sockaddr_totext(&query->sockaddr, b);
check_result(result, "isc_sockaddr_totext");
isc_buffer_usedregion(b, &r);
- printf(";; Connection to server %.*s for %s failed: %s.\n",
- (int)r.length, r.base, query->lookup->textname,
- isc_result_totext(sevent->result));
+ if (sevent->result != ISC_R_CANCELED)
+ printf(";; Connection to %.*s(%s) for %s failed: "
+ "%s.\n", (int)r.length, r.base,
+ query->servname, query->lookup->textname,
+ isc_result_totext(sevent->result));
isc_socket_detach(&query->sock);
sockcount--;
INSIST(sockcount >= 0);
if (exitcode < 9)
exitcode = 9;
+ debug("sockcount=%d",sockcount);
isc_buffer_free(&b);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
@@ -2017,7 +2058,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
* the cancel_lookup() routine clears the pending flag.
*/
if (sevent->result == ISC_R_CANCELED) {
- debug("in cancel handler");
+ debug("in recv cancel handler");
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h
index bd2a52e866..1defb0f4a7 100644
--- a/bin/dig/include/dig/dig.h
+++ b/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.h,v 1.32 2000/07/13 18:52:58 mws Exp $ */
+/* $Id: dig.h,v 1.33 2000/07/13 22:53:51 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -32,7 +32,7 @@
#include
#include
-#define MXSERV 4
+#define MXSERV 6
#define MXNAME 1005
#define MXRD 32
#define BUFSIZE 512
From 6bc1a645619a14707da68b130dafe41721fd2f25 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Thu, 13 Jul 2000 23:52:04 +0000
Subject: [PATCH 076/226] If a positive validation fails and it looks like the
reason is that there are no material DNSSEC signatures, try an insecurity
proof.
---
lib/dns/validator.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/dns/validator.c b/lib/dns/validator.c
index ec626e8104..a45a68cee4 100644
--- a/lib/dns/validator.c
+++ b/lib/dns/validator.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: validator.c,v 1.64 2000/07/07 00:44:01 bwelling Exp $ */
+/* $Id: validator.c,v 1.65 2000/07/13 23:52:04 bwelling Exp $ */
#include
@@ -72,6 +72,7 @@ struct dns_validator {
#define VALATTR_SHUTDOWN 0x01
#define VALATTR_FOUNDNONEXISTENCE 0x02
+#define VALATTR_TRIEDVERIFY 0x04
#define SHUTDOWN(v) (((v)->attributes & VALATTR_SHUTDOWN) != 0)
static void
@@ -922,6 +923,7 @@ validate(dns_validator_t *val, isc_boolean_t resume) {
}
do {
+ val->attributes |= VALATTR_TRIEDVERIFY;
result = dns_dnssec_verify(event->name,
event->rdataset,
val->key, ISC_FALSE,
@@ -1278,6 +1280,13 @@ validator_start(isc_task_t *task, isc_event_t *event) {
"attempting positive response validation");
result = validate(val, ISC_FALSE);
+ if (result == DNS_R_NOVALIDSIG &&
+ (val->attributes & VALATTR_TRIEDVERIFY) == 0)
+ {
+ validator_log(val, ISC_LOG_DEBUG(3),
+ "falling back to insecurity proof");
+ result = proveunsecure(val, ISC_FALSE);
+ }
} else if (val->event->rdataset != NULL) {
/*
* This is either an unsecure subdomain or a response from
From 5b4397d387b89d696b5eb90c328a385e07d4a380 Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Fri, 14 Jul 2000 00:03:54 +0000
Subject: [PATCH 077/226] Updated to reflect current status of insecurity
proofs on insecure and privately secured zones.
---
doc/misc/dnssec | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/doc/misc/dnssec b/doc/misc/dnssec
index 9d88f30ad1..8f33c98f68 100644
--- a/doc/misc/dnssec
+++ b/doc/misc/dnssec
@@ -49,8 +49,10 @@ successfully even if it does not contain the NXT records to prove the
nonexistence of a matching wildcard.
Proof of insecure status for insecure zones delegated from secure
-zones has been partially implemented but should not yet be expected to
-work in all cases.
+zones works when the zones are completely insecure. Privately
+secured zones delegated from secure zones will not work in all cases,
+such as when the privately secured zone is served by the same server
+as an ancestor (but not parent) zone.
Handling of the CD bit in queries is not yet fully implemented;
validation is currently attempted for all recursive queries, even if
@@ -65,4 +67,4 @@ an update occurs. Advanced access control is possible using the
"update-policy" statement in the zone definition.
-$Id: dnssec,v 1.5 2000/06/27 21:45:52 bwelling Exp $
+$Id: dnssec,v 1.6 2000/07/14 00:03:54 bwelling Exp $
From 55da37e18f378ddb78ba29b7c7f10c74bf3e4432 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Fri, 14 Jul 2000 00:33:09 +0000
Subject: [PATCH 078/226] removed dead code
---
lib/dns/resolver.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 38db487176..5d2721ab2f 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: resolver.c,v 1.145 2000/07/12 23:56:06 bwelling Exp $ */
+/* $Id: resolver.c,v 1.146 2000/07/14 00:33:09 gson Exp $ */
#include
@@ -2429,9 +2429,6 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
&need_validation);
if (result != ISC_R_SUCCESS)
return (result);
- if (need_validation) {
-
- }
adbp = NULL;
aname = NULL;
From 10f4e9668a61da4e2cf422bb5d57e62ffa31f583 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Fri, 14 Jul 2000 00:37:27 +0000
Subject: [PATCH 079/226] the INSIST condition of 1.145 was too strong,
weakened it; dded another INSIST to help track down the INSIST(!external)
crash
---
lib/dns/resolver.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 5d2721ab2f..d5681da77a 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: resolver.c,v 1.146 2000/07/14 00:33:09 gson Exp $ */
+/* $Id: resolver.c,v 1.147 2000/07/14 00:37:27 gson Exp $ */
#include
@@ -504,8 +504,12 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
event->ev_sender = fctx;
if (!HAVE_ANSWER(fctx))
event->result = result;
- if (result == ISC_R_SUCCESS)
- INSIST(dns_rdataset_isassociated(event->rdataset));
+
+ INSIST(result != ISC_R_SUCCESS ||
+ dns_rdataset_isassociated(event->rdataset) ||
+ fctx->type == dns_rdatatype_any ||
+ fctx->type == dns_rdatatype_sig);
+
isc_task_sendanddetach(&task, (isc_event_t **)&event);
}
ISC_LIST_INIT(fctx->events);
@@ -2025,6 +2029,9 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
goto cleanup_name;
dns_rdataset_clone(nameservers, &fctx->nameservers);
}
+
+ INSIST(dns_name_issubdomain(&fctx->name, &fctx->domain));
+
fctx->type = type;
fctx->options = options;
/*
From 8d51d9e67e1e5dcf10203c4147ece519c7daa57d Mon Sep 17 00:00:00 2001
From: Mark Andrews
Date: Fri, 14 Jul 2000 02:26:22 +0000
Subject: [PATCH 080/226] 331. [bug] Only log "recursion denied"
if RD is set. (RT #178)
---
CHANGES | 2 ++
bin/named/client.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGES b/CHANGES
index c2421bde6c..a706c5880a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 331. [bug] Only log "recursion denied" if RD is set. (RT #178)
+
330. [func] New function isc_log_wouldlog().
329. [func] omapi_auth_register() now takes a size_t argument for
diff --git a/bin/named/client.c b/bin/named/client.c
index b7ef7d018f..9f565a20a4 100644
--- a/bin/named/client.c
+++ b/bin/named/client.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: client.c,v 1.99 2000/07/13 00:21:27 bwelling Exp $ */
+/* $Id: client.c,v 1.100 2000/07/14 02:26:22 marka Exp $ */
#include
@@ -816,6 +816,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
dns_view_t *view;
dns_rdataset_t *opt;
isc_boolean_t ra; /* Recursion available. */
+ isc_boolean_t rd; /* Recursion desired. */
REQUIRE(event != NULL);
client = event->ev_arg;
@@ -1041,12 +1042,13 @@ client_request(isc_task_t *task, isc_event_t *event) {
* responses to ordinary queries.
*/
ra = ISC_FALSE;
+ rd = ISC_TF((client->message->flags & DNS_MESSAGEFLAG_RD) != 0);
if (client->view->resolver != NULL &&
client->view->recursion == ISC_TRUE &&
/* XXX this will log too much too early */
ns_client_checkacl(client, "recursion",
client->view->recursionacl,
- ISC_TRUE, ISC_TRUE) == ISC_R_SUCCESS)
+ ISC_TRUE, rd) == ISC_R_SUCCESS)
ra = ISC_TRUE;
if (ra == ISC_TRUE)
From 1867b6276e222cc3ea98ff3a4d0b8bc7f23f36ab Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Fri, 14 Jul 2000 14:57:24 +0000
Subject: [PATCH 081/226] char secret[], for decoding the base64 string, should
not have been const
---
bin/named/omapiconf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/named/omapiconf.c b/bin/named/omapiconf.c
index 0f4e0e18a1..f7a673f508 100644
--- a/bin/named/omapiconf.c
+++ b/bin/named/omapiconf.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: omapiconf.c,v 1.7 2000/07/12 15:33:41 tale Exp $ */
+/* $Id: omapiconf.c,v 1.8 2000/07/14 14:57:24 tale Exp $ */
/*
* Principal Author: DCL
@@ -199,7 +199,7 @@ register_keys(dns_c_ctrl_t *control, dns_c_kdeflist_t *keydeflist,
{
dns_c_kid_t *keyid;
dns_c_kdef_t *keydef;
- const char secret[1024];
+ char secret[1024];
isc_buffer_t b;
isc_result_t result;
From e715e011788a529446b8013239c33599542ece32 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Fri, 14 Jul 2000 16:35:30 +0000
Subject: [PATCH 082/226] More code duplication removal and general cleanup
Slight change in +nssearch output formatting
---
bin/dig/dig.c | 39 +++--------
bin/dig/dighost.c | 136 ++++++++++++++++++--------------------
bin/dig/host.c | 8 +--
bin/dig/include/dig/dig.h | 12 +++-
bin/dig/nslookup.c | 19 +++---
5 files changed, 90 insertions(+), 124 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index 6ed208ab5e..ecd80de2b7 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.65 2000/07/13 21:12:20 mws Exp $ */
+/* $Id: dig.c,v 1.66 2000/07/14 16:35:25 mws Exp $ */
#include
#include
@@ -34,7 +34,7 @@
#include
extern ISC_LIST(dig_lookup_t) lookup_list;
-extern ISC_LIST(dig_server_t) server_list;
+extern dig_serverlist_t server_list;
extern ISC_LIST(dig_searchlist_t) search_list;
#define ADD_STRING(b, s) { \
@@ -73,22 +73,7 @@ extern isc_boolean_t isc_mem_debugging;
isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE;
isc_uint16_t bufsize = 0;
-isc_boolean_t
- identify = ISC_FALSE,
- trace = ISC_FALSE,
- ns_search_only = ISC_FALSE,
- forcecomment = ISC_FALSE,
- stats = ISC_TRUE,
- comments = ISC_TRUE,
- section_question = ISC_TRUE,
- section_answer = ISC_TRUE,
- section_authority = ISC_TRUE,
- section_additional = ISC_TRUE,
- recurse = ISC_TRUE,
- defname = ISC_TRUE,
- tcpmode = ISC_FALSE,
- adflag = ISC_FALSE,
- cdflag = ISC_FALSE;
+isc_boolean_t forcecomment = ISC_FALSE;
static const char *opcodetext[] = {
"QUERY",
@@ -201,7 +186,8 @@ received(int bytes, int frmsize, char *frm, dig_query_t *query) {
if (query->lookup->stats) {
diff = isc_time_microdiff(&now, &query->time_sent);
printf(";; Query time: %ld msec\n", (long int)diff/1000);
- printf(";; SERVER: %.*s\n", frmsize, frm);
+ printf(";; SERVER: %.*s(%s)\n", frmsize, frm,
+ query->servname);
time(&tnow);
printf(";; WHEN: %s", ctime(&tnow));
printf(";; MSG SIZE rcvd: %d\n", bytes);
@@ -591,17 +577,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
if (strncmp(rv[0], "%", 1) == 0)
break;
if (strncmp(rv[0], "@", 1) == 0) {
- srv = isc_mem_allocate(mctx,
- sizeof(struct dig_server));
- if (srv == NULL)
- fatal("Memory allocation failure");
- strncpy(srv->servername, &rv[0][1], MXNAME-1);
- if (!lookup->use_my_server_list) {
- ISC_LIST_INIT(lookup->
- my_server_list);
- lookup->use_my_server_list =
- ISC_TRUE;
- }
+ srv = make_server(&rv[0][1]);
ISC_LIST_APPEND(lookup->my_server_list,
srv, link);
} else if ((strcmp(rv[0], "+vc") == 0)
@@ -688,6 +664,8 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
+ strcpy(lookup->rttext, "soa");
+ short_form = ISC_TRUE;
} else if (strncmp(rv[0], "+nons", 6) == 0) {
lookup->ns_search_only = ISC_FALSE;
} else if (strncmp(rv[0], "+tr", 3) == 0) {
@@ -912,7 +890,6 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
ISC_LIST_APPEND(lookup_list, lookup, link);
- ISC_LIST_INIT(lookup->my_server_list);
have_host = ISC_TRUE;
debug("looking up %s", lookup->textname);
}
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 9367242ff2..535b6268a2 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.85 2000/07/13 22:53:49 mws Exp $ */
+/* $Id: dighost.c,v 1.86 2000/07/14 16:35:26 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -64,7 +64,7 @@ extern int h_errno;
#include
ISC_LIST(dig_lookup_t) lookup_list;
-ISC_LIST(dig_server_t) server_list;
+dig_serverlist_t server_list;
ISC_LIST(dig_searchlist_t) search_list;
isc_boolean_t
@@ -230,6 +230,36 @@ istype(char *text) {
return (ISC_FALSE);
}
+dig_server_t *
+make_server(const char *servname) {
+ dig_server_t *srv;
+
+ REQUIRE(servname != NULL);
+
+ debug("make_server(%s)",servname);
+ srv = isc_mem_allocate(mctx, sizeof(struct dig_server));
+ if (srv == NULL)
+ fatal("Memory allocation failure in %s:%d",
+ __FILE__, __LINE__);
+ strncpy(srv->servername, servname, MXNAME);
+ return (srv);
+}
+
+void
+clone_server_list(dig_serverlist_t src,
+ dig_serverlist_t *dest)
+{
+ dig_server_t *srv, *newsrv;
+
+ debug("clone_server_list()");
+ srv = ISC_LIST_HEAD(src);
+ while (srv != NULL) {
+ newsrv = make_server(srv->servername);
+ ISC_LIST_ENQUEUE(*dest, newsrv, link);
+ srv = ISC_LIST_NEXT(srv, link);
+ }
+}
+
dig_lookup_t *
make_empty_lookup(void) {
dig_lookup_t *looknew;
@@ -276,16 +306,18 @@ make_empty_lookup(void) {
looknew->section_authority = ISC_TRUE;
looknew->section_additional = ISC_TRUE;
looknew->new_search = ISC_FALSE;
- ISC_LIST_INIT(looknew->my_server_list);
ISC_LIST_INIT(looknew->q);
- looknew->use_my_server_list = ISC_FALSE;
+ ISC_LIST_INIT(looknew->my_server_list);
return (looknew);
}
+/*
+ * Caution: If you don't clone the servers, you MUST clone the server
+ * list seperately from somewhere else, or construct it by hand.
+ */
dig_lookup_t *
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
dig_lookup_t *looknew;
- dig_server_t *s, *srv;
debug("clone_lookup()");
@@ -316,24 +348,9 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
looknew->section_authority = lookold->section_authority;
looknew->section_additional = lookold->section_additional;
- if (servers) {
- looknew->use_my_server_list = lookold->use_my_server_list;
- if (looknew->use_my_server_list) {
- s = ISC_LIST_HEAD(lookold->my_server_list);
- while (s != NULL) {
- srv = isc_mem_allocate(mctx,
- sizeof(struct dig_server));
- if (srv == NULL)
- fatal("Memory allocation failure "
- "in %s:%d", __FILE__, __LINE__);
- strncpy(srv->servername, s->servername,
- MXNAME);
- ISC_LIST_ENQUEUE(looknew->my_server_list, srv,
- link);
- s = ISC_LIST_NEXT(s, link);
- }
- }
- }
+ if (servers)
+ clone_server_list(lookold->my_server_list,
+ &looknew->my_server_list);
return (looknew);
}
@@ -401,22 +418,10 @@ setup_system(void) {
debug("got a nameserver line");
ptr = strtok(NULL, " \t\r\n");
if (ptr != NULL) {
- srv = isc_mem_allocate(mctx,
- sizeof(struct dig_server));
- if (srv == NULL)
- fatal("Memory "
- "allocation "
- "failure in "
- "%s:%d",
- __FILE__,
- __LINE__);
- strncpy((char *)srv->
- servername,
- ptr,
- MXNAME - 1);
- ISC_LIST_APPEND
- (server_list,
- srv, link);
+ srv = make_server(ptr);
+ ISC_LIST_APPEND
+ (server_list,
+ srv, link);
}
} else if (strcasecmp(ptr, "options") == 0) {
ptr = strtok(NULL, " \t\r\n");
@@ -485,10 +490,7 @@ setup_system(void) {
ndots = 1;
if (server_list.head == NULL) {
- srv = isc_mem_allocate(mctx, sizeof(dig_server_t));
- if (srv == NULL)
- fatal("Memory allocation failure");
- strcpy(srv->servername, "127.0.0.1");
+ srv = make_server("127.0.0.1");
ISC_LIST_APPEND(server_list, srv, link);
}
@@ -743,17 +745,15 @@ try_clear_lookup(dig_lookup_t *lookup) {
* At this point, we know there are no queries on the lookup,
* so can make it go away also.
*/
- if (lookup->use_my_server_list) {
- s = ISC_LIST_HEAD(lookup->my_server_list);
- while (s != NULL) {
- debug("freeing server %p belonging to %p",
- s, lookup);
- ptr = s;
- s = ISC_LIST_NEXT(s, link);
- ISC_LIST_DEQUEUE(lookup->my_server_list,
- (dig_server_t *)ptr, link);
- isc_mem_free(mctx, ptr);
- }
+ s = ISC_LIST_HEAD(lookup->my_server_list);
+ while (s != NULL) {
+ debug("freeing server %p belonging to %p",
+ s, lookup);
+ ptr = s;
+ s = ISC_LIST_NEXT(s, link);
+ ISC_LIST_DEQUEUE(lookup->my_server_list,
+ (dig_server_t *)ptr, link);
+ isc_mem_free(mctx, ptr);
}
if (lookup->sendmsg != NULL)
dns_message_destroy(&lookup->sendmsg);
@@ -891,8 +891,6 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
ISC_FALSE);
lookup->doing_xfr = ISC_FALSE;
lookup->defname = ISC_FALSE;
- lookup->use_my_server_list =
- ISC_TRUE;
if (section ==
DNS_SECTION_ANSWER) {
lookup->trace =
@@ -909,19 +907,10 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
lookup->ns_search_only;
}
lookup->trace_root = ISC_FALSE;
- ISC_LIST_INIT(lookup->
- my_server_list);
}
- srv = isc_mem_allocate(mctx,
- sizeof(struct dig_server));
- if (srv == NULL)
- fatal("Memory allocation "
- "failure in %s:%d",
- __FILE__, __LINE__);
- strncpy(srv->servername,
- (char *)r.base, len);
- srv->servername[len] = 0;
- debug("adding1 server %s",
+ r.base[len]=0;
+ srv = make_server(r.base);
+ debug("adding server %s",
srv->servername);
ISC_LIST_APPEND
(lookup->my_server_list,
@@ -1057,6 +1046,10 @@ setup_lookup(dig_lookup_t *lookup) {
lookup_counter = 0;
}
+ if (ISC_LIST_EMPTY(lookup->my_server_list)) {
+ debug("cloning server list");
+ clone_server_list(server_list, &lookup->my_server_list);
+ }
result = dns_message_gettempname(lookup->sendmsg, &lookup->name);
check_result(result, "dns_message_gettempname");
dns_name_init(lookup->name, NULL);
@@ -1237,10 +1230,7 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->pending = ISC_FALSE;
- if (lookup->use_my_server_list)
- serv = ISC_LIST_HEAD(lookup->my_server_list);
- else
- serv = ISC_LIST_HEAD(server_list);
+ serv = ISC_LIST_HEAD(lookup->my_server_list);
for (; serv != NULL;
serv = ISC_LIST_NEXT(serv, link)) {
query = isc_mem_allocate(mctx, sizeof(dig_query_t));
@@ -1360,7 +1350,7 @@ send_udp(dig_lookup_t *lookup) {
&lookup->timer);
check_result(result, "isc_timer_create");
}
-for (query = ISC_LIST_HEAD(lookup->q);
+ for (query = ISC_LIST_HEAD(lookup->q);
query != NULL;
query = ISC_LIST_NEXT(query, link)) {
debug("working on lookup %p, query %p",
diff --git a/bin/dig/host.c b/bin/dig/host.c
index 27b1205445..27a2d99b02 100644
--- a/bin/dig/host.c
+++ b/bin/dig/host.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: host.c,v 1.39 2000/07/13 21:01:00 mws Exp $ */
+/* $Id: host.c,v 1.40 2000/07/14 16:35:27 mws Exp $ */
#include
#include
@@ -618,11 +618,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
}
strncpy(hostname, argv[isc_commandline_index], MXNAME);
if (argc > isc_commandline_index + 1) {
- srv = isc_mem_allocate(mctx, sizeof(struct dig_server));
- if (srv == NULL)
- fatal("Memory allocation failure.");
- strncpy(srv->servername,
- argv[isc_commandline_index+1], MXNAME-1);
+ srv = make_server(argv[isc_commandline_index+1]);
debug("server is %s", srv->servername);
ISC_LIST_APPEND(server_list, srv, link);
}
diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h
index 1defb0f4a7..289e2a26aa 100644
--- a/bin/dig/include/dig/dig.h
+++ b/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.h,v 1.33 2000/07/13 22:53:51 mws Exp $ */
+/* $Id: dig.h,v 1.34 2000/07/14 16:35:30 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -66,6 +66,7 @@ ISC_LANG_BEGINDECLS
typedef struct dig_lookup dig_lookup_t;
typedef struct dig_query dig_query_t;
typedef struct dig_server dig_server_t;
+typedef ISC_LIST(dig_server_t) dig_serverlist_t;
typedef struct dig_searchlist dig_searchlist_t;
struct dig_lookup {
@@ -74,7 +75,6 @@ struct dig_lookup {
waiting_connect,
doing_xfr,
ns_search_only,
- use_my_server_list,
identify,
recurse,
aaonly,
@@ -107,7 +107,7 @@ struct dig_lookup {
dns_name_t *oname;
ISC_LINK(dig_lookup_t) link;
ISC_LIST(dig_query_t) q;
- ISC_LIST(dig_server_t) my_server_list;
+ dig_serverlist_t my_server_list;
dig_searchlist_t *origin;
dig_query_t *xfr_q;
int retries;
@@ -215,6 +215,12 @@ make_empty_lookup(void);
dig_lookup_t *
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
+dig_server_t *
+make_server(const char *servname);
+
+void
+clone_server_list(dig_serverlist_t src,
+ dig_serverlist_t *dest);
/*
* Routines needed in dig.c and host.c.
diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c
index 5f032a4923..003af850b1 100644
--- a/bin/dig/nslookup.c
+++ b/bin/dig/nslookup.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.24 2000/07/13 01:22:36 mws Exp $ */
+/* $Id: nslookup.c,v 1.25 2000/07/14 16:35:29 mws Exp $ */
#include
@@ -659,7 +659,6 @@ addlookup(char *opt) {
lookup->xfr_q = NULL;
lookup->origin = NULL;
lookup->querysig = NULL;
- lookup->use_my_server_list = ISC_FALSE;
lookup->doing_xfr = ISC_FALSE;
lookup->ixfr_serial = 0;
lookup->defname = ISC_FALSE;
@@ -802,15 +801,13 @@ flush_lookup_list(void) {
ISC_LIST_DEQUEUE(l->q, qp, link);
isc_mem_free(mctx, qp);
}
- if (l->use_my_server_list) {
- s = ISC_LIST_HEAD(l->my_server_list);
- while (s != NULL) {
- sp = s;
- s = ISC_LIST_NEXT(s, link);
- ISC_LIST_DEQUEUE(l->my_server_list, sp, link);
- isc_mem_free(mctx, sp);
-
- }
+ s = ISC_LIST_HEAD(l->my_server_list);
+ while (s != NULL) {
+ sp = s;
+ s = ISC_LIST_NEXT(s, link);
+ ISC_LIST_DEQUEUE(l->my_server_list, sp, link);
+ isc_mem_free(mctx, sp);
+
}
if (l->sendmsg != NULL)
dns_message_destroy(&l->sendmsg);
From da892e97332b7f5080c6a56c012bc77752c290ab Mon Sep 17 00:00:00 2001
From: Brian Wellington
Date: Fri, 14 Jul 2000 16:59:32 +0000
Subject: [PATCH 083/226] Typo in comment - isc_time_microdiff returns
microseconds, not milliseconds.
---
lib/isc/unix/include/isc/time.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/isc/unix/include/isc/time.h b/lib/isc/unix/include/isc/time.h
index 0d2e3dbb77..a43e2217e8 100644
--- a/lib/isc/unix/include/isc/time.h
+++ b/lib/isc/unix/include/isc/time.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: time.h,v 1.21 2000/06/30 22:40:30 tale Exp $ */
+/* $Id: time.h,v 1.22 2000/07/14 16:59:32 bwelling Exp $ */
#ifndef ISC_TIME_H
#define ISC_TIME_H 1
@@ -218,7 +218,7 @@ isc_time_subtract(isc_time_t *t, isc_interval_t *i, isc_time_t *result);
isc_uint64_t
isc_time_microdiff(isc_time_t *t1, isc_time_t *t2);
/*
- * Find the difference in milliseconds between time t1 and time t2.
+ * Find the difference in microseconds between time t1 and time t2.
* t2 is the subtrahend of t1; ie, difference = t1 - t2.
*
* Requires:
From 074ae7bf0993ced96b32e3e85553a401f3f3eca9 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Fri, 14 Jul 2000 17:11:07 +0000
Subject: [PATCH 084/226] RT #169: note that logging categories have changed
from BIND 8
---
doc/misc/migration | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/doc/misc/migration b/doc/misc/migration
index ab20894abb..5706a767ce 100644
--- a/doc/misc/migration
+++ b/doc/misc/migration
@@ -25,6 +25,22 @@ warning message. A message is also logged about each option whose
default has changed unless the option is set explicitly in named.conf.
+1.2. Logging
+
+The set of logging categories in BIND 9 is different from that
+in BIND 8. If you have customized your logging on a per-category
+basis, you need to modify your logging statement to use the
+new categories.
+
+Another difference is that the "logging" statement only takes effect
+after the entire named.conf file has been read. This means that when
+the server starts up, any messages about errors in the configuration
+file are always logged to the default destination (syslog) when the
+server first starts up, regardless of the contents of the "logging"
+statement. In BIND 8, the new logging configuration took effect
+immediately after the "logging" statement was read.
+
+
2. Zone File Compatibility
2.1. Strict RFC1035 Interpretation of TTLs in Zone Files
@@ -79,4 +95,4 @@ completely. We have contacted the manufacturer of the name server in
case and are trying to resolve the issue with them.
-$Id: migration,v 1.2 2000/07/12 05:06:33 gson Exp $
+$Id: migration,v 1.3 2000/07/14 17:11:07 gson Exp $
From 16836f6ab6dec7f75ebccbaf7098b62484fa2624 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Fri, 14 Jul 2000 17:13:49 +0000
Subject: [PATCH 085/226] 9.0.0b5 was built from the release branch, not the
mainline
---
CHANGES | 2 --
1 file changed, 2 deletions(-)
diff --git a/CHANGES b/CHANGES
index a706c5880a..316dea74df 100644
--- a/CHANGES
+++ b/CHANGES
@@ -141,8 +141,6 @@
keep a copy of the user and group databases in the
chroot'ed environment. Suggested by Hakan Olsson.
- --- 9.0.0b5 released ---
-
298. [bug] A mutex deadlock occurred during shutdown of the
interface manager under certain conditions.
Digital Unix systems were the most affected.
From 8cd54a7461ad183f9e839d96cedb7b7ad03fb244 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Fri, 14 Jul 2000 17:57:27 +0000
Subject: [PATCH 086/226] Lots of changes to the shutdown code. Get rid of the
annoying "just exit" method of shutting down. Known bug: SIGINT while doing
batch mode causes assertion.
---
bin/dig/dig.c | 36 ++++++-------
bin/dig/dighost.c | 106 +++++++++++++++++++++++++++++---------
bin/dig/host.c | 19 ++-----
bin/dig/include/dig/dig.h | 8 ++-
4 files changed, 111 insertions(+), 58 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index ecd80de2b7..52036f92a3 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.66 2000/07/14 16:35:25 mws Exp $ */
+/* $Id: dig.c,v 1.67 2000/07/14 17:57:23 mws Exp $ */
#include
#include
@@ -66,6 +66,7 @@ extern dns_tsigkey_t *key;
extern isc_boolean_t validated;
extern isc_taskmgr_t *taskmgr;
extern isc_task_t *global_task;
+extern isc_boolean_t free_now;
extern isc_boolean_t debugging;
extern isc_boolean_t isc_mem_debugging;
@@ -539,7 +540,7 @@ reorder_args(int argc, char *argv[]) {
static void
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
isc_boolean_t have_host = ISC_FALSE;
- dig_server_t *srv = NULL;
+ dig_server_t *srv = NULL, *s, *s2;
dig_lookup_t *lookup = NULL;
static dig_lookup_t *default_lookup = NULL;
char *batchname = NULL;
@@ -926,8 +927,20 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
strcpy(lookup->rttext, "NS");
ISC_LIST_APPEND(lookup_list, lookup, link);
}
- if (!is_batchfile)
+ if (!is_batchfile) {
printgreeting(argc, argv);
+ s = ISC_LIST_HEAD(default_lookup->my_server_list);
+ while (s != NULL) {
+ debug("freeing server %p belonging to %p",
+ s, default_lookup);
+ s2 = s;
+ s = ISC_LIST_NEXT(s, link);
+ ISC_LIST_DEQUEUE(default_lookup->my_server_list,
+ (dig_server_t *)s2, link);
+ isc_mem_free(mctx, s2);
+ }
+ isc_mem_free(mctx, default_lookup);
+ }
}
int
@@ -946,22 +959,9 @@ main(int argc, char **argv) {
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
check_result(result, "isc_app_onrun");
isc_app_run();
- /*
- * XXXMWS This code should really NOT be bypassed. However,
- * until the proper code can be added to handle SIGTERM/INT
- * correctly, just exit out "hard" and deal as best we can.
- */
-#if 0
- if (taskmgr != NULL) {
- debug("Freeing taskmgr");
- isc_taskmgr_destroy(&taskmgr);
- }
- if (isc_mem_debugging)
- isc_mem_stats(mctx, stderr);
- if (mctx != NULL)
- isc_mem_destroy(&mctx);
+ cancel_all();
+ destroy_libs();
isc_app_finish();
-#endif
return (exitcode);
}
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 535b6268a2..9331cf8ac6 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.86 2000/07/14 16:35:26 mws Exp $ */
+/* $Id: dighost.c,v 1.87 2000/07/14 17:57:25 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -71,6 +71,7 @@ isc_boolean_t
have_ipv6 = ISC_FALSE,
specified_source = ISC_FALSE,
free_now = ISC_FALSE,
+ cancel_now = ISC_FALSE,
show_details = ISC_FALSE,
usesearch = ISC_FALSE,
qr = ISC_FALSE,
@@ -107,6 +108,21 @@ isc_mempool_t *commctx = NULL;
extern isc_boolean_t isc_mem_debugging;
isc_boolean_t debugging = ISC_FALSE;
char *progname = NULL;
+isc_mutex_t lookup_lock;
+
+/*
+ * Apply and clear locks at the event level in global task.
+ */
+#define LOCK_LOOKUP {\
+ debug("lock_lookup %s:%d", __FILE__, __LINE__);\
+ check_result(isc_mutex_lock((&lookup_lock)), "isc_mutex_lock");\
+ debug("success");\
+}
+#define UNLOCK_LOOKUP {\
+ debug("unlock_lookup %s:%d", __FILE__, __LINE__);\
+ check_result(isc_mutex_unlock((&lookup_lock)),\
+ "isc_mutex_unlock");\
+}
static void
cancel_lookup(dig_lookup_t *lookup);
@@ -624,6 +640,9 @@ setup_libs(void) {
*/
isc_mempool_setfreemax(commctx, 6);
isc_mempool_setfillcount(commctx, 2);
+
+ result = isc_mutex_init(&lookup_lock);
+ check_result(result, "isc_mutex_init");
}
static void
@@ -701,6 +720,7 @@ clear_query(dig_query_t *query) {
debug("clear_query(%p)",query);
lookup = query->lookup;
+
ISC_LIST_UNLINK(lookup->q, query, link);
if (ISC_LINK_LINKED(&query->recvbuf, link))
ISC_LIST_DEQUEUE(query->recvlist, &query->recvbuf,
@@ -784,6 +804,8 @@ begin_next_lookup(void) {
dig_lookup_t *next;
debug("begin_next_lookup()");
+ if (cancel_now)
+ return;
next = ISC_LIST_HEAD(lookup_list);
if (next != NULL) {
setup_lookup(next);
@@ -838,6 +860,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query,
debug("followup_lookup()");
result = dns_message_firstname(msg,section);
+
if (result != ISC_R_SUCCESS) {
debug("firstname returned %s",
isc_result_totext(result));
@@ -1277,6 +1300,7 @@ send_done(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
+ LOCK_LOOKUP;
sevent = (isc_socketevent_t *)event;
query = event->ev_arg;
@@ -1294,9 +1318,8 @@ send_done(isc_task_t *task, isc_event_t *event) {
l = query->lookup;
clear_query(query);
check_next_lookup(l);
- return;
}
-
+ UNLOCK_LOOKUP;
}
void
@@ -1392,8 +1415,9 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
REQUIRE(event->ev_type == ISC_TIMEREVENT_IDLE);
debug("connect_timeout()");
- lookup = event->ev_arg;
+ LOCK_LOOKUP;
+ lookup = event->ev_arg;
isc_event_free(&event);
debug("buffer allocate connect_timeout");
@@ -1434,6 +1458,7 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
isc_timer_detach(&lookup->timer);
isc_buffer_free(&b);
debug("done with connect_timeout()");
+ UNLOCK_LOOKUP;
}
static void
@@ -1453,8 +1478,8 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
debug("tcp_length_done()");
+ LOCK_LOOKUP;
sevent = (isc_socketevent_t *)event;
-
query = event->ev_arg;
recvcount--;
@@ -1512,6 +1537,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
debug("resubmitted recv request with length %d, recvcount=%d",
length, recvcount);
isc_event_free(&event);
+ UNLOCK_LOOKUP;
}
static void
@@ -1583,10 +1609,11 @@ connect_done(isc_task_t *task, isc_event_t *event) {
debug("connect_done()");
+ LOCK_LOOKUP;
sevent = (isc_socketevent_t *)event;
query = sevent->ev_arg;
- REQUIRE(query->waiting_connect);
+ INSIST(query->waiting_connect);
query->waiting_connect = ISC_FALSE;
@@ -1616,10 +1643,12 @@ connect_done(isc_task_t *task, isc_event_t *event) {
l = query->lookup;
clear_query(query);
check_next_lookup(l);
+ UNLOCK_LOOKUP;
return;
}
launch_next_query(query, ISC_TRUE);
isc_event_free(&event);
+ UNLOCK_LOOKUP;
}
@@ -1821,6 +1850,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
debug("recv_done()");
+ LOCK_LOOKUP;
recvcount--;
debug("recvcount=%d", recvcount);
INSIST(recvcount >= 0);
@@ -1835,7 +1865,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
if ((l->tcp_mode) && (l->timer != NULL))
isc_timer_touch(l->timer);
- if (!l->pending && !l->ns_search_only) {
+ if ((!l->pending && !l->ns_search_only)
+ || cancel_now) {
debug("no longer pending. Got %s",
isc_result_totext(sevent->result));
@@ -1845,6 +1876,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
clear_query(query);
check_next_lookup(l);
+ UNLOCK_LOOKUP;
return;
}
@@ -1892,6 +1924,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
clear_query(query);
cancel_lookup(l);
check_next_lookup(l);
+ UNLOCK_LOOKUP;
return;
}
if (key != NULL) {
@@ -1999,6 +2032,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
isc_event_free (&event);
query->working = ISC_FALSE;
query->waiting_connect = ISC_FALSE;
+ UNLOCK_LOOKUP;
return;
}
docancel = check_for_more_data(query, msg, sevent);
@@ -2041,6 +2075,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
clear_query(query);
check_next_lookup(l);
}
+ UNLOCK_LOOKUP;
return;
}
/*
@@ -2054,6 +2089,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
clear_query(query);
check_next_lookup(l);
+ UNLOCK_LOOKUP;
return;
}
fatal("recv_done got result %s",
@@ -2224,20 +2260,27 @@ void
onrun_callback(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
isc_event_free(&event);
+ LOCK_LOOKUP;
start_lookup();
+ UNLOCK_LOOKUP;
}
-#if 0
/*
* This will be used in the SIGINT handler, and perhaps other places.
*/
-static void
+void
cancel_all(void) {
dig_lookup_t *l;
dig_query_t *q;
debug("cancel_all()");
-
+
+ LOCK_LOOKUP;
+ if (free_now) {
+ UNLOCK_LOOKUP;
+ return;
+ }
+ cancel_now = ISC_TRUE;
l = ISC_LIST_HEAD(lookup_list);
while (l != NULL) {
if (l->timer != NULL)
@@ -2249,22 +2292,16 @@ cancel_all(void) {
if (q->sock != NULL) {
isc_socket_cancel(q->sock, NULL,
ISC_SOCKCANCEL_ALL);
- isc_socket_detach(&q->sock);
- sockcount--;
- debug("sockcount=%d",sockcount);
- INSIST(sockcount >= 0);
- check_if_done();
}
q = ISC_LIST_NEXT(q, link);
}
l = ISC_LIST_NEXT(l, link);
}
- check_if_done();
+ UNLOCK_LOOKUP;
}
-#endif
-void
-free_lists(void) {
+static void
+xfree_lists(void) {
void *ptr;
dig_server_t *s;
dig_searchlist_t *o;
@@ -2307,10 +2344,6 @@ free_lists(void) {
debug("freeing timermgr");
isc_timermgr_destroy(&timermgr);
}
- if (global_task != NULL) {
- debug("freeing task");
- isc_task_detach(&global_task);
- }
if (key != NULL) {
debug("freeing key %p", key);
dns_tsigkey_setdeleted(key);
@@ -2333,3 +2366,30 @@ free_lists(void) {
isc_entropy_detach(&entp);
}
}
+
+void
+destroy_libs(void) {
+ debug("destroy_libs()");
+ if (global_task != NULL) {
+ debug("freeing task");
+ isc_task_detach(&global_task);
+ }
+ if (taskmgr != NULL) {
+ debug("Freeing taskmgr");
+ isc_taskmgr_destroy(&taskmgr);
+ }
+ LOCK_LOOKUP;
+ xfree_lists();
+ isc_mutex_destroy(&lookup_lock);
+ if (isc_mem_debugging)
+ isc_mem_stats(mctx, stderr);
+ if (mctx != NULL)
+ isc_mem_destroy(&mctx);
+}
+
+/*
+ * Dummy function, soon to go away
+ */
+void
+free_lists(void) {
+}
diff --git a/bin/dig/host.c b/bin/dig/host.c
index 27a2d99b02..0364fcfe3e 100644
--- a/bin/dig/host.c
+++ b/bin/dig/host.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: host.c,v 1.40 2000/07/14 16:35:27 mws Exp $ */
+/* $Id: host.c,v 1.41 2000/07/14 17:57:26 mws Exp $ */
#include
#include
@@ -677,22 +677,9 @@ main(int argc, char **argv) {
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
check_result(result, "isc_app_onrun");
isc_app_run();
- /*
- * XXXMWS This code should really NOT be bypassed. However,
- * until the proper code can be added to handle SIGTERM/INT
- * correctly, just exit out "hard" and deal as best we can.
- */
-#if 0
- if (taskmgr != NULL) {
- debug("freeing taskmgr");
- isc_taskmgr_destroy(&taskmgr);
- }
- if (isc_mem_debugging)
- isc_mem_stats(mctx, stderr);
+ cancel_all();
+ destroy_libs();
isc_app_finish();
- if (mctx != NULL)
- isc_mem_destroy(&mctx);
-#endif
return (0);
}
diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h
index 289e2a26aa..d3d37c0598 100644
--- a/bin/dig/include/dig/dig.h
+++ b/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.h,v 1.34 2000/07/14 16:35:30 mws Exp $ */
+/* $Id: dig.h,v 1.35 2000/07/14 17:57:27 mws Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -222,6 +222,12 @@ void
clone_server_list(dig_serverlist_t src,
dig_serverlist_t *dest);
+void
+cancel_all(void);
+
+void
+destroy_libs(void);
+
/*
* Routines needed in dig.c and host.c.
*/
From da527e4ff6a013364826637963e7ac372e024f33 Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Fri, 14 Jul 2000 19:12:54 +0000
Subject: [PATCH 087/226] 332. [func] New function dns_name_reset().
---
CHANGES | 2 ++
lib/dns/include/dns/name.h | 39 +++++++++++++++++++++++++++++++++++++-
lib/dns/name.c | 14 ++++++++++++--
3 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/CHANGES b/CHANGES
index 316dea74df..39cd65195d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 332. [func] New function dns_name_reset().
+
331. [bug] Only log "recursion denied" if RD is set. (RT #178)
330. [func] New function isc_log_wouldlog().
diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h
index 1ce797c996..05a1f3dd87 100644
--- a/lib/dns/include/dns/name.h
+++ b/lib/dns/include/dns/name.h
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: name.h,v 1.74 2000/07/13 18:10:16 bwelling Exp $ */
+/* $Id: name.h,v 1.75 2000/07/14 19:12:51 tale Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
@@ -236,6 +236,32 @@ dns_name_init(dns_name_t *name, unsigned char *offsets);
* Ensures:
* 'name' is a valid name.
* dns_name_countlabels(name) == 0
+ * dns_name_isabsolute(name) == ISC_FALSE
+ */
+
+void
+dns_name_reset(dns_name_t *name);
+/*
+ * Reinitialize 'name'.
+ *
+ * Notes:
+ * This function distinguishes itself from dns_name_init() in two
+ * key ways:
+ *
+ * + If any buffer is associated with 'name' (via dns_name_setbuffer()
+ * or by being part of a dns_fixedname_t) the link to the buffer
+ * is retained but the buffer itself is cleared.
+ *
+ * + Of the attributes associated with 'name', all are retained except
+ * DNS_NAMEATTR_ABSOLUTE.
+ *
+ * Requires:
+ * 'name' is a valid name.
+ *
+ * Ensures:
+ * 'name' is a valid name.
+ * dns_name_countlabels(name) == 0
+ * dns_name_isabsolute(name) == ISC_FALSE
*/
void
@@ -1182,6 +1208,7 @@ ISC_LANG_ENDDECLS
#ifdef DNS_NAME_USEINLINE
#define dns_name_init(n, o) DNS_NAME_INIT(n, o)
+#define dns_name_reset(n) DNS_NAME_RESET(n)
#define dns_name_countlabels(n) DNS_NAME_COUNTLABELS(n)
#define dns_name_isabsolute(n) DNS_NAME_ISABSOLUTE(n)
@@ -1198,6 +1225,16 @@ do { \
ISC_LIST_INIT((n)->list); \
} while (0)
+#define DNS_NAME_RESET(n) \
+do { \
+ (n)->ndata = NULL; \
+ (n)->length = 0; \
+ (n)->labels = 0; \
+ (n)->attributes &= ~DNS_NAMEATTR_ABSOLUTE; \
+ if ((n)->buffer != NULL) \
+ isc_buffer_clear((n)->buffer); \
+} while (0)
+
#define DNS_NAME_SETBUFFER(n, b) \
(n)->buffer = (b)
diff --git a/lib/dns/name.c b/lib/dns/name.c
index 00593ff2b7..2f47192f16 100644
--- a/lib/dns/name.c
+++ b/lib/dns/name.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: name.c,v 1.94 2000/07/13 18:10:18 bwelling Exp $ */
+/* $Id: name.c,v 1.95 2000/07/14 19:12:53 tale Exp $ */
#include
@@ -320,6 +320,16 @@ dns_name_init(dns_name_t *name, unsigned char *offsets) {
ISC_LIST_INIT(name->list);
}
+void
+dns_name_reset(dns_name_t *name) {
+ REQUIRE(VALID_NAME(name));
+ REQUIRE(BINDABLE(name));
+
+ MAKE_EMPTY(name);
+ if (name->buffer != NULL)
+ isc_buffer_clear(name->buffer);
+}
+
void
dns_name_invalidate(dns_name_t *name) {
/*
@@ -2476,7 +2486,7 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name,
REQUIRE(BINDABLE(name));
/*
- * IMPORTANT NOTE
+ * XXX IMPORTANT NOTE
*
* If the most-signficant label in prefix is a bitstring,
* and the least-signficant label in suffix is a bitstring,
From 891a1bead8d02d29eb7b4993d7c0975047b0963d Mon Sep 17 00:00:00 2001
From: David Lawrence
Date: Fri, 14 Jul 2000 19:17:39 +0000
Subject: [PATCH 088/226] Use new function dns_name_reset() to make a name have
no data, instead of dns_name_concatenate(NULL, NULL, name, NULL).
Define DNS_NAME_USELINE to get macroized name functions. Removed
older FAST_COUNTLABELS and FAST_ISABSOLUTE to use standard name
interface, which are covered by DNS_NAME_USEINLINE.
---
lib/dns/rbt.c | 50 ++++++++++++++++++++++----------------------------
1 file changed, 22 insertions(+), 28 deletions(-)
diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
index f065abe926..9665df316e 100644
--- a/lib/dns/rbt.c
+++ b/lib/dns/rbt.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: rbt.c,v 1.84 2000/07/06 23:54:43 tale Exp $ */
+/* $Id: rbt.c,v 1.85 2000/07/14 19:17:39 tale Exp $ */
/* Principal Authors: DCL */
@@ -25,9 +25,15 @@
#include
#include
+/*
+ * This define is so dns/name.h (included by dns/fixedname.h) uses more
+ * efficient macro calls instead of functions for a few operations.
+ */
+#define DNS_NAME_USEINLINE 1
+
+#include
#include
#include
-#include
#define RBT_MAGIC 0x5242542BU /* RBT+. */
#define VALID_RBT(rbt) ISC_MAGIC_VALID(rbt, RBT_MAGIC)
@@ -125,12 +131,6 @@ do { \
(name)->attributes |= DNS_NAMEATTR_READONLY; \
} while (0)
-#define FAST_ISABSOLUTE(name) \
- (((name)->attributes & DNS_NAMEATTR_ABSOLUTE) ? ISC_TRUE : ISC_FALSE)
-
-#define FAST_COUNTLABELS(name) \
- ((name)->labels)
-
#ifdef DEBUG
#define inline
/*
@@ -285,17 +285,11 @@ chain_name(dns_rbtnodechain_t *chain, dns_name_t *name,
isc_boolean_t include_chain_end)
{
dns_name_t nodename;
- isc_result_t result;
+ isc_result_t result = ISC_R_SUCCESS;
unsigned int i;
dns_name_init(&nodename, NULL);
-
- /*
- * XXX DCL Is this too devilish, initializing name like this?
- */
- result = dns_name_concatenate(NULL, NULL, name, NULL);
- if (result != ISC_R_SUCCESS)
- return result;
+ dns_name_reset(name);
for (i = 0; i < chain->level_count; i++) {
NODENAME(chain->levels[i], &nodename);
@@ -359,7 +353,7 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
int order;
REQUIRE(VALID_RBT(rbt));
- REQUIRE(FAST_ISABSOLUTE(name));
+ REQUIRE(dns_name_isabsolute(name));
REQUIRE(nodep != NULL && *nodep == NULL);
/*
@@ -574,8 +568,8 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
dns_label_t label;
dns_name_getlabel(prefix,
- FAST_COUNTLABELS(¤t_name) -
- common_labels,
+ dns_name_countlabels(¤t_name)
+ - common_labels,
&label);
INSIST(dns_label_type(&label) ==
@@ -587,8 +581,8 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
label.length);
dns_name_getlabel(add_name,
- FAST_COUNTLABELS(add_name) -
- common_labels,
+ dns_name_countlabels(add_name)
+ - common_labels,
&label);
INSIST(dns_label_type(&label) ==
dns_labeltype_bitstring);
@@ -625,7 +619,7 @@ dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
ATTRS(current) &= ~DNS_NAMEATTR_ABSOLUTE;
if (common_labels ==
- FAST_COUNTLABELS(add_name) &&
+ dns_name_countlabels(add_name) &&
common_bits == add_bits) {
/*
* The name has been added by pushing
@@ -692,7 +686,7 @@ dns_rbt_addname(dns_rbt_t *rbt, dns_name_t *name, void *data) {
dns_rbtnode_t *node;
REQUIRE(VALID_RBT(rbt));
- REQUIRE(FAST_ISABSOLUTE(name));
+ REQUIRE(dns_name_isabsolute(name));
node = NULL;
@@ -732,7 +726,7 @@ dns_rbt_findnode(dns_rbt_t *rbt, dns_name_t *name, dns_name_t *foundname,
int order;
REQUIRE(VALID_RBT(rbt));
- REQUIRE(FAST_ISABSOLUTE(name));
+ REQUIRE(dns_name_isabsolute(name));
REQUIRE(node != NULL && *node == NULL);
REQUIRE((options & (DNS_RBTFIND_NOEXACT | DNS_RBTFIND_NOPREDECESSOR))
!= (DNS_RBTFIND_NOEXACT | DNS_RBTFIND_NOPREDECESSOR));
@@ -1116,7 +1110,7 @@ dns_rbt_deletename(dns_rbt_t *rbt, dns_name_t *name, isc_boolean_t recurse) {
isc_result_t result;
REQUIRE(VALID_RBT(rbt));
- REQUIRE(FAST_ISABSOLUTE(name));
+ REQUIRE(dns_name_isabsolute(name));
/*
* First, find the node.
@@ -1247,7 +1241,7 @@ create_node(isc_mem_t *mctx, dns_name_t *name, dns_rbtnode_t **nodep) {
REQUIRE(name->offsets != NULL);
dns_name_toregion(name, ®ion);
- labels = FAST_COUNTLABELS(name);
+ labels = dns_name_countlabels(name);
ENSURE(labels > 0);
/*
@@ -1972,8 +1966,8 @@ dns_rbtnodechain_current(dns_rbtnodechain_t *chain, dns_name_t *name,
/*
* Eliminate the root name, except when name is ".".
*/
- if (FAST_COUNTLABELS(name) > 1) {
- INSIST(FAST_ISABSOLUTE(name));
+ if (dns_name_countlabels(name) > 1) {
+ INSIST(dns_name_isabsolute(name));
/*
* XXX EVIL. But what _should_ I do?
From 925a734426ac10c224d5e4e6f90a108a8418a424 Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Fri, 14 Jul 2000 20:14:36 +0000
Subject: [PATCH 089/226] Handle SIGINT properly during batch mode.
---
bin/dig/dighost.c | 74 +++++++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 35 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 9331cf8ac6..dbfdf0eadc 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.87 2000/07/14 17:57:25 mws Exp $ */
+/* $Id: dighost.c,v 1.88 2000/07/14 20:14:36 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -109,6 +109,7 @@ extern isc_boolean_t isc_mem_debugging;
isc_boolean_t debugging = ISC_FALSE;
char *progname = NULL;
isc_mutex_t lookup_lock;
+dig_lookup_t *current_lookup = NULL;
/*
* Apply and clear locks at the event level in global task.
@@ -765,6 +766,7 @@ try_clear_lookup(dig_lookup_t *lookup) {
* At this point, we know there are no queries on the lookup,
* so can make it go away also.
*/
+ debug("cleared");
s = ISC_LIST_HEAD(lookup->my_server_list);
while (s != NULL) {
debug("freeing server %p belonging to %p",
@@ -783,13 +785,10 @@ try_clear_lookup(dig_lookup_t *lookup) {
}
if (lookup->timer != NULL)
isc_timer_detach(&lookup->timer);
- INSIST(lookup->sendspace != NULL);
- isc_mempool_put(commctx, lookup->sendspace);
+ if (lookup->sendspace != NULL)
+ isc_mempool_put(commctx, lookup->sendspace);
- ptr = lookup;
- lookup = ISC_LIST_NEXT(lookup, link);
- ISC_LIST_DEQUEUE(lookup_list, (dig_lookup_t *)ptr, link);
- isc_mem_free(mctx, ptr);
+ isc_mem_free(mctx, lookup);
return (ISC_TRUE);
}
@@ -799,15 +798,27 @@ try_clear_lookup(dig_lookup_t *lookup) {
* This assumes that the lookup on the head of the queue hasn't been
* started yet.
*/
-static void
-begin_next_lookup(void) {
+void
+start_lookup(void) {
dig_lookup_t *next;
- debug("begin_next_lookup()");
+ debug("start_lookup()");
if (cancel_now)
return;
+
+ /*
+ * If there's a current lookup running, we really shouldn't get
+ * here.
+ */
+ INSIST(current_lookup == NULL);
+
next = ISC_LIST_HEAD(lookup_list);
+ current_lookup = next;
+ /*
+ * Put the current lookup somewhere so cancel_all can find it
+ */
if (next != NULL) {
+ ISC_LIST_DEQUEUE(lookup_list, next, link);
setup_lookup(next);
do_lookup(next);
} else {
@@ -838,8 +849,10 @@ check_next_lookup(dig_lookup_t *lookup) {
}
if (still_working)
return;
- if (try_clear_lookup(lookup))
- begin_next_lookup();
+ if (try_clear_lookup(lookup)) {
+ current_lookup = NULL;
+ start_lookup();
+ }
}
static void
@@ -2241,21 +2254,6 @@ do_lookup(dig_lookup_t *lookup) {
do_lookup_udp(lookup);
}
-void
-start_lookup(void) {
- dig_lookup_t *lookup;
-
- INSIST(!free_now);
-
- debug("start_lookup()");
-
- lookup = ISC_LIST_HEAD(lookup_list);
- if (lookup != NULL) {
- setup_lookup(lookup);
- do_lookup(lookup);
- }
-}
-
void
onrun_callback(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
@@ -2270,7 +2268,7 @@ onrun_callback(isc_task_t *task, isc_event_t *event) {
*/
void
cancel_all(void) {
- dig_lookup_t *l;
+ dig_lookup_t *l, *n;
dig_query_t *q;
debug("cancel_all()");
@@ -2281,21 +2279,26 @@ cancel_all(void) {
return;
}
cancel_now = ISC_TRUE;
- l = ISC_LIST_HEAD(lookup_list);
- while (l != NULL) {
- if (l->timer != NULL)
- isc_timer_detach(&l->timer);
- q = ISC_LIST_HEAD(l->q);
+ if (current_lookup != NULL) {
+ if (current_lookup->timer != NULL)
+ isc_timer_detach(¤t_lookup->timer);
+ q = ISC_LIST_HEAD(current_lookup->q);
while (q != NULL) {
debug("cancelling query %p, belonging to %p",
- q, l);
+ q, current_lookup);
if (q->sock != NULL) {
isc_socket_cancel(q->sock, NULL,
ISC_SOCKCANCEL_ALL);
}
q = ISC_LIST_NEXT(q, link);
}
- l = ISC_LIST_NEXT(l, link);
+ }
+ l = ISC_LIST_HEAD(lookup_list);
+ while (l != NULL) {
+ n = ISC_LIST_NEXT(l, link);
+ ISC_LIST_DEQUEUE(lookup_list, l, link);
+ try_clear_lookup(l);
+ l = n;
}
UNLOCK_LOOKUP;
}
@@ -2313,6 +2316,7 @@ xfree_lists(void) {
REQUIRE(sendcount == 0);
INSIST(ISC_LIST_HEAD(lookup_list) == NULL);
+ INSIST(current_lookup == NULL);
INSIST(!free_now);
free_now = ISC_TRUE;
From db9455558290798935da24c3ccbc22752c017d31 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
Date: Fri, 14 Jul 2000 20:21:26 +0000
Subject: [PATCH 090/226] updated drafts
---
...txt => draft-ietf-dnsext-edns0dot5-01.txt} | 140 ++--
.../draft-ietf-dnsext-zone-status-01.txt | 640 ------------------
.../draft-ietf-dnsext-zone-status-02.txt | 464 +++++++++++++
3 files changed, 562 insertions(+), 682 deletions(-)
rename doc/draft/{draft-ietf-dnsext-edns0dot5-00.txt => draft-ietf-dnsext-edns0dot5-01.txt} (66%)
delete mode 100644 doc/draft/draft-ietf-dnsext-zone-status-01.txt
create mode 100644 doc/draft/draft-ietf-dnsext-zone-status-02.txt
diff --git a/doc/draft/draft-ietf-dnsext-edns0dot5-00.txt b/doc/draft/draft-ietf-dnsext-edns0dot5-01.txt
similarity index 66%
rename from doc/draft/draft-ietf-dnsext-edns0dot5-00.txt
rename to doc/draft/draft-ietf-dnsext-edns0dot5-01.txt
index 4e5307a139..cd9e98a1ad 100644
--- a/doc/draft/draft-ietf-dnsext-edns0dot5-00.txt
+++ b/doc/draft/draft-ietf-dnsext-edns0dot5-01.txt
@@ -5,10 +5,10 @@
Network Working Group R. Austein
-draft-ietf-dnsext-edns0dot5-00.txt InterNetShare.com, Inc.
+draft-ietf-dnsext-edns0dot5-01.txt InterNetShare.com, Inc.
H. Alvestrand
EDB MaXware AS
- February 2000
+ July 2000
A Proposed Enhancement to the EDNS0 Version Mechanism
@@ -55,9 +55,9 @@ Motivation and Scope
-Austein & Alvestrand Expires 28 August 2000 [Page 1]
+Austein & Alvestrand Expires 15 January 2001 [Page 1]
-draft-ietf-dnsext-edns0dot5-00.txt February 2000
+draft-ietf-dnsext-edns0dot5-01.txt July 2000
This note proposes to replace the monolithic version numbering
@@ -85,9 +85,10 @@ Model
of the TTL field of the OPT RR, and a variable-length list of
FEATURES, stored in the variable part of the OPT RR.
- All FEATUREs are extensions of the DNS. We reserve FEATURE numbers 1
- to 100 for describing features of the original RFC 1034/1035 DNS
- specification that we might eventually chose to deprecate.
+ All FEATUREs are extensions of the DNS. We reserve the range of
+ FEATURE numbers from 1 to 100 for describing features of the original
+ RFC 1034/1035 DNS specification that we might eventually choose to
+ deprecate.
Any query/response pair can be described as using a set of DNS
FEATUREs. Such features might for instance be:
@@ -105,18 +106,18 @@ Model
- SIG record parsing and checking;
FEATURE numbers are handed out by IANA on a first-come-first-served
- basis. Any revised specification of a format or function should have
- its own FEATURE number; in the IETF process, any significantly
- changed Internet-Draft should have a new FEATURE number assigned for
+ basis within their appropriate ranges. Any revised specification of
+ a format or function should have its own FEATURE number; in the IETF
-Austein & Alvestrand Expires 28 August 2000 [Page 2]
+Austein & Alvestrand Expires 15 January 2001 [Page 2]
-draft-ietf-dnsext-edns0dot5-00.txt February 2000
+draft-ietf-dnsext-edns0dot5-01.txt July 2000
- experimentation.
+ process, any significantly changed Internet-Draft should have a new
+ FEATURE number assigned for experimentation.
An assigned VERSION number names a set of FEATUREs. VERSION numbers
are assigned by the IETF through a standards action.
@@ -148,35 +149,46 @@ Mechanism
Usage
- When composing a query message, the client includes an OPT record
- indicating the set of FEATUREs that:
+ In most respects, the FEATURE mechanism is used symmetrically by
+ clients and servers; exceptions to this rule are stated after the
+ general explanation.
- - Allows the client to express this query;
+ When composing a DNS message, a client or server includes an OPT
+ record indicating a set of FEATUREs that:
- - Allows the server to express all responses that the client is
- prepared to accept for this query.
+ - MUST include all FEATUREs that the client or server believes are
+ relevant to this message;
+
+ - MAY include all FEATURES that the client or server is prepared to
+ receive.
This set is expressed as a VERSION and any additional FEATURES
required.
- The server will include an OPT pseudo-RR that indicates:
-
- - The highest VERSION numbers supported by the responder (for
- information only -- the client takes no action based on this);
-
-
-Austein & Alvestrand Expires 28 August 2000 [Page 3]
+Austein & Alvestrand Expires 15 January 2001 [Page 3]
-draft-ietf-dnsext-edns0dot5-00.txt February 2000
+draft-ietf-dnsext-edns0dot5-01.txt July 2000
- - The set of FEATUREs not encompassed by the VERSION that are
- necessary to express the response.
+ In general, we expect that a client or server will include an OPT
+ pseudo-RR that indicates:
- No FEATURE may be included or used that is not within the set of
- FEATUREs that the query originator indicated.
+ - The highest VERSION number that the entity generating the message
+ supports; and
+
+ - A small (possibly empty) set of additional FEATUREs not encompassed
+ by the VERSION that the entity deems necessary or desirable.
+
+ The above symmetry notwithstanding, we impose one important
+ constraint on the server: while a server is allowed to indicate
+ whatever FEATUREs it believes are relevant or useful, a server MUST
+ NOT make use of any FEATURE in a response that is not within the set
+ of FEATUREs indicated by the client that generated the corresponding
+ request. That is, a response may say "I support FEATURE FOO"
+ regardless of what the client supports, but the rest of the response
+ must not use FEATURE FOO unless the client also supports it.
As a special case, if a client explicitly queries for the OPT RR of
the root zone, the server returns an OPT record including all
@@ -190,8 +202,8 @@ Life Cycle
- VERSION X is defined and deployed.
- A new FEATURE is defined and experimentally implemented. All
- clients and servers part of the experiment use FEATURE to indicate
- support.
+ clients and servers taking part in the experiment use FEATURE to
+ indicate support.
- Community consensus is reached that this FEATURE is genuinely
useful.
@@ -209,24 +221,29 @@ Risks
all, since by any realistic estimate it takes years (decades?) to
upgrade all the DNS implementations already in the field.
+
+
+Austein & Alvestrand Expires 15 January 2001 [Page 4]
+
+draft-ietf-dnsext-edns0dot5-01.txt July 2000
+
+
A flexible extension mechanism of this type increases the risk that
some implementors might chose to deploy features designed to hinder
interoperability (so-called "labeled noninteroperability").
Security Considerations
- We do not believe that this protocol enhancement adds any new
+ We do not believe that this protocol enhancement adds any major new
security risks, but we do believe that it would be helpful in getting
complicated DNS extensions such as [DNSSEC] deployed more quickly.
-
-
-
-
-Austein & Alvestrand Expires 28 August 2000 [Page 4]
-
-draft-ietf-dnsext-edns0dot5-00.txt February 2000
-
+ As with any enhancement to or complication of the DNS protocol, this
+ enhancement offers attackers yet another way to increase the load on
+ a name server. Root, TLD and other "major" name servers should view
+ excessively complicated FEATURE sets with suspicion, and should not
+ allow themselves to be tricked into performing more work than is
+ really necessary.
IANA Considerations
@@ -234,6 +251,12 @@ IANA Considerations
IANA will need to create a new registry of feature numbers.
+Acknowledgments
+
+ The authors would like to thank the following people for their help
+ in improving this document: Randy Bush, Patrik Faltstrom, Olafur
+ Gudmundsson, Bob Halley, and XXX.
+
References
[DNSSEC] Eastlake, D., "Domain Name System Security Extensions", RFC
@@ -251,6 +274,16 @@ References
[BINARY-LABELS] Crawford, M., "Binary Labels in the Domain Name
System", RFC 2673 August 1999.
+
+
+
+
+
+Austein & Alvestrand Expires 15 January 2001 [Page 5]
+
+draft-ietf-dnsext-edns0dot5-01.txt July 2000
+
+
Author's addresses:
Rob Austein
@@ -279,4 +312,27 @@ Author's addresses:
-Austein & Alvestrand Expires 28 August 2000 [Page 5]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Austein & Alvestrand Expires 15 January 2001 [Page 6]
diff --git a/doc/draft/draft-ietf-dnsext-zone-status-01.txt b/doc/draft/draft-ietf-dnsext-zone-status-01.txt
deleted file mode 100644
index af7c85bbe3..0000000000
--- a/doc/draft/draft-ietf-dnsext-zone-status-01.txt
+++ /dev/null
@@ -1,640 +0,0 @@
-DNSEXT WG Edward Lewis
-INTERNET DRAFT NAI Labs
-Category:I-D April 13, 2000
-
- DNS Security Extension Clarification on Zone Status
-
-
-Status of this Memo
-
-This document is an Internet-Draft and is in full conformance with all
-provisions of Section 10 of RFC2026.
-
-Internet-Drafts are working documents of the Internet Engineering Task
-Force (IETF), its areas, and its working groups. Note that other
-groups may also distribute working documents as Internet-Drafts.
-
-Internet-Drafts are draft documents valid for a maximum of six months
-and may be updated, replaced, or obsoleted by other documents at any
-time. It is inappropriate to use Internet-Drafts as reference
-material or to cite them other than as "work in progress."
-
-The list of current Internet-Drafts can be accessed at
-http://www.ietf.org/ietf/1id-abstracts.txt
-
-The list of Internet-Draft Shadow Directories can be accessed at
-http://www.ietf.org/shadow.html.
-
-Comments should be sent to the authors or the DNSIND WG mailing list
-namedroppers@internic.net.
-
-This draft expires on October 13, 2000.
-
-Copyright Notice
-
-Copyright (C) The Internet Society (1999, 2000). All rights reserved.
-
-Abstract
-
-The definition of a secured zone is presented, updating RFC 2535. The
-new definition has consequences that alter the interpretation of the
-NXT record, obsolete NULL keys, and the designation of "experimentally
-secure."
-
-1 Introduction
-
-Whether a DNS zone is "secured" or not is a question asked in at least
-four contexts. A zone administrator asks the question when
-configuring a zone to use DNSSEC. A dynamic update server asks the
-question when an update request arrives, which may require DNSSEC
-processing. A delegating zone asks the question of a child zone when
-the parent enters data indicating the status the child. A resolver
-asks the question upon receipt of data belonging to the zone.
-
-A zone administrator needs to be able to determine what steps are
-needed to make the zone as secure as it can be. Realizing that due to
-the distributed nature of DNS and its administration, any single zone
-
-Expires October 13, 2000 [Page 1]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-is at the mercy of other zones when it comes to the appearance of
-security. This document will define what makes a zone qualify as
-secure (absent interaction with other zones).
-
-A name server performing dynamic updates needs to know whether a zone
-being updated is to have signatures added to the updated data, NXT
-records applied, and other required processing. In this case, it is
-conceivable that the name server is configured with the knowledge, but
-being able to determine the status of a zone by examining the data is
-a desirable alternative to configuration parameters.
-
-A delegating zone is required to indicate whether a child zone is
-secured. The reason for this requirement lies in the way in which a
-resolver makes its own determination about a zone (next paragraph). To
-shorten a long story, a parent needs to know whether a child should be
-considered secured. This is a two part question, what does a parent
-consider a secure child to be, and how does a parent know if the child
-conforms?
-
-A resolver needs to know if a zone is secured when the resolver is
-processing data from the zone. Ultimately, a resolver needs to know
-whether or not to expect a usable signature covering the data. How
-this determination is done is out of the scope of this document,
-except that, in some cases, the resolver will need to contact the
-parent of the zone to see if the parent states that the child is
-secured.
-
-This document updates several sections of RFC 2535. The definition of
-a secured zone is an update to section 3.4 of the RFC. The document
-updates section 2.3.4, by specifying a replacement for the NULL zone
-keys. Section 3.4 is updated to eliminate the definition of
-experimental keys and illustrate a way to still achieve the
-functionality they were designed to provide. Section 3.1.3 is updated
-by the specifying the value of the protocol octet in a zone key.
-
-2 Status of a Zone
-
-In this section, rules governing a zone's DNSSEC status are presented.
-There are three levels of security defined: full, private, and
-unsecured. A zone is fully secure when it complies with the strictest
-set of DNSSEC processing rules. A zone is privately secured when it
-is configured in such a way that only resolvers that are appropriately
-configured see the zone as secured. All other zones are unsecured.
-
-Note: there currently is no document completely defining DNSSEC
-verification rules. For the purposes of this document, the strictest
-rules are assumed to state that the verification chain of zone keys
-parallels the delegation tree up to the root zone. This is not
-intended to disallow alternate verification paths, just to establish a
-baseline definition.
-
-To avoid repetition in the rules below, the following terms are
-defined.
-
-
-Expires October 13, 2000 [Page 2]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-2.a. Zone signing KEY RR - A KEY RR whose flag field has the value 01
-for name type (indicating a zone key) and either value 00 or value 01
-for key type (indicating a key permitted to authenticate data). (See
-RFC 2535, section 3.1.2). The KEY RR also has a protocol octet value
-of DNSSEC (3) or All (255).
-
-The definition updates RFC 2535's definition of a zone key. The
-requirement that the protocol field be either DNSSEC or All is a new
-requirement.
-
-2.b On-tree Validation - The authorization model in which only the
-parent zone can is recognized to supply a DNSSEC-meaningful signature
-that is used by a resolver to build a chain of trust from the child's
-keys to a recognized root of security. The term "on-tree" refers to
-following up the DNS domain hierarchy to reach a trusted key,
-presumably the root key if no other key is available. The term
-"validation" refers to the digital signature by the parent to prove
-the integrity, authentication and authorization of the child' key to
-sign the child's zone data.
-
-2.c Off-tree Validation - Any authorization model that permits domain
-names other than the parent's to provide a signature over a child's
-zone keys that will enable a resolver to trust the keys.
-
-2.1 Fully Secured
-
-A fully secured zone, in a nutshell, is a zone that uses only
-mandatory to implement algorithms (RFC 2535, section 3.2) and relies
-on a key certification chain that parallels the delegation tree
-(on-tree validation). Fully secured zones are defined by the
-following rules.
-
-2.1.a. The zone's apex MUST have a KEY RR set. There MUST be at least
-one zone signing KEY RR (2.a) of a mandatory to implement algorithm in
-the set.
-
-2.1.b. The zone's apex KEY RR set MUST be signed by a private key
-belonging to the parent zone. The private key's public companion MUST
-be a zone signing KEY RR (2.a) of a mandatory to implement algorithm
-and owned by the parent's apex.
-
-If a zone cannot get a conforming signature from the parent zone, the
-child zone cannot be considered fully secured. The only exception to
-this is the root zone, for which there is no parent zone.
-
-2.1.c. NXT records MUST be deployed throughout the zone. (Updates RFC
-2535, section 2.3.2.) Note: there is some operational discomfort with
-the current NXT record. This requirement is open to modification when
-two things happen. First, an alternate mechanism to the NXT is
-defined and second, a means by which a zone can indicate that it is
-using an alternate method.
-
-2.1.d. Each RR set that qualifies for zone membership MUST be signed
-by a key that is in the apex's KEY RR set and is a zone signing KEY RR
-
-Expires October 13, 2000 [Page 3]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-(2.a) of a mandatory to implement algorithm. (Updates 2535, section
-2.3.1.)
-
-Mentioned earlier, the root zone is a special case. Defining what
-constitutes a secure root zone is difficult, as the discussion on
-securing the root zone has not come to a consensus in an open forum.
-However, the security of the root zone will be determined by the
-preconfiguration of a trusted key in resolvers. Who generates and
-distributes the trusted key is an open issue.
-
-2.2 Privately Secured
-
-Note that the term "privately" is open to debate...
-
-A privately secured zone is a zone that complies with rules like those
-for a fully secured zone with the following exceptions. The signing
-keys may be of an algorithm that is not mandatory to implement and/or
-the verification of the zone keys in use may rely on a verification
-chain that is not parallel to the delegation tree (off-tree
-validation).
-
-2.2.a. The zone's apex MUST have a KEY RR set. There MUST be at least
-one zone signing KEY RR (2.a) in the set.
-
-2.2.b. The zone's apex KEY RR set MUST be signed by a private key and
-one of the following two subclauses MUST hold true.
-
-2.2.b.1 The private key's public companion MUST be preconfigured in
-all the resolvers of interest.
-
-2.2.b.2 The private key's public component MUST be a zone signing KEY
-RR (2.a) authorized to provide validation of the zone's apex KEY RR
-set, as recognized by resolvers of interest.
-
-The previous sentence is trying to convey the notion of using a
-trusted third party to provide validation of keys. If the domain name
-owning the validating key is not the parent zone, the domain name must
-represent someone the resolver trusts to provide validation.
-
-2.2.c. NXT records MUST be deployed throughout the zone. (Updates RFC
-2535, section 2.3.2.) Note: see the discussion following 2.1.c.
-
-2.2.d. Each RR set that qualifies for zone membership MUST be signed
-by a key that is in the apex's KEY RR set and is a zone signing KEY RR
-(2.a).. (Updates 2535, section 2.3.1.)
-
-2.3 Unsecured
-
-All other zones qualify as unsecured. This includes zones that are
-designed to be experimentally secure, as defined in a later section on
-that topic.
-
-
-
-
-Expires October 13, 2000 [Page 4]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-2.4 Wrap up
-
-The designation of fully secured, privately secured, and unsecured are
-merely labels to apply to zones, based on their contents. Resolvers,
-when determining whether a signature is expected or not, will only see
-a zone as secured or unsecured.
-
-Resolvers that follow the most restrictive DNSSEC verification rules
-will only see fully secured zones as secured, and all others as
-unsecured, including zones which are privately secured. Resolvers
-that are not as restrictive, such as those that implement algorithms
-in addition to the mandatory to implement algorithms, will see some
-privately secured zones as secured.
-
-The intent of the labels "fully" and "privately" is to identify the
-specific attributes of a zone. The words are chosen to assist in the
-writing of a document recommending the actions a zone administrator
-take in making use of the DNS security extensions. The words are
-explicitly not intended to convey a state of compliance with DNS
-security standards.
-
-3 Parental Notification
-
-For a resolver to come to a definitive answer concerning a zone's
-security status there is a requirement that the parent of a zone
-signify whether the child zone is signed or not. The justification of
-this requirement requires a discussion of the resolver's activity,
-which is described in RFC 2535.
-
-In RFC 2535, a parent is required to hold a NULL key for an unsigned
-child (a bone of contention here is how this works in light of
-multiple algorithms). The parent has the option to hold the keys of
-the child if the child is signed. The parent may also hold nothing
-cryptographic if the child is signed. This, of course, assumes the
-parent is a signed zone.
-
-RFC 2535 does permit the following case, a child zone that uses DNSSEC
-capable software yet chooses to remain unsecured could hold a signed
-NULL key delivered from the parent. This is considered to be a rare
-condition, a zone administrator that goes to the trouble to get the
-keys from the parent and have it signed will likely just sign the
-whole zone, or leave the NULL key to the parent.
-
-There is a strong case for discouraging a parent from holding keys of
-a signed child, or an unsigned child for that matter. These include
-concrete concerns about performance and more abstract concerns about
-the liability of the parent.
-
-DNS [RFC 1034 and 1035] requires a parent to hold NS records for a
-child zone, this signifies the delegation. RFC 2535 requires a
-secured parent to also have signed NXT records for the child, and
-possibly a signed KEY RR set (required for some NULL key situations).
-
-By redefining the security status of a zone to be per zone and not per
-
-Expires October 13, 2000 [Page 5]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-algorithm, there is an opportunity to completely remove the need for a
-KEY RR set in the parent. Because the question of whether the zone is
-secure or not is a yes-or-no question, the notification needs just one
-bit to be expressed.
-
-Keep in mind that the following sections speak to the contents of a
-zone, not a name server. In the case of a name server speaking
-authoritatively for both the parent and child, or if a server caches
-the information for the other half of the delegation, then a server
-will have more types of data at a delegation point than a parent is
-supposed to hold. (E.g., if a parent zone's name server caches the
-SOA for the child, the SOA is not in the parent zone, but is in the
-server's cache.)
-
-3.1 Child Has Keys Bit
-
-This section is written assuming the current definition of NXT holds.
-There is some controversy surrounding the NXT record, which may result
-in a complete replacement of it for proof of non-existence. The
-current NXT definition provides an extension bit in the types present
-bit map, whose use is remains incompletely defined. The following
-text largely ignores these uncertainties, and should be rewritten to
-accommodate these uncertainties in revisions.
-
-In the parent's half of the delegation point, there will be an NXT
-record, called an "upper" NXT. According to the rules for a
-delegation point, only the NS, NXT, and SIG bits will be turned on in
-the types present field, assuming we drop the KEY set altogether.
-
-The KEY bit in the parent's NXT types present bit map is hereby
-redefined to have the following meaning. (Note that this applies to
-just delegation points.)
-
-If the bit corresponding to the KEY RR set in an upper NXT is set, the
-parent has generated and issued a currently valid SIG (KEY) RR
-validating the child's apex KEY RR set. Note that this does not
-require the child to include either a zone signing KEY RR (2.a) or a
-NULL zone KEY RR. This does assume that only on-tree validation (2.b)
-is in use.
-
-The temporal validity of the bit's setting may be enforced in the SIG
-(NXT) RR validity period, timely editing of the master file, dynamic
-updates, or whatever another mechanism.
-
-If a child submits a key set to the parent for validation that does
-not include a zone signing KEY RR (2.a), then the child will remain
-unsecured although the upper NXT KEY RR bit will be set to 1 by the
-parent. A resolver seeing this will know to look for a child key set,
-and see that there is no zone signing KEY RR (2.a) and know to treat
-the child as unsecured.
-
-If a NULL zone KEY RR is seen, the resolver ignores it. If a NULL key
-is the only zone key, then the resolver will deduce the child is
-unsecured as in the previous paragraph. If there is both a NULL and
-
-Expires October 13, 2000 [Page 6]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-one or more zone signing KEY RR (2.a), then the zone is considered
-signed in the algorithm(s) identified in the signing capable key(s).
-
-If the bit is 0 then the child has not submitted a KEY RR set for
-validation, hence is to be considered unsigned.
-
-Note that for a fully secured zone (section 2.1), the bit is on (1).
-For all unsecured zones (section 2.3) the bit is either off (0) or on
-(1) with a NULL KEY and no zone signing KEY RR at the apex. For
-privately secured zones (section 2.2), the setting of the bit is
-determined by whether the parent signs the child's keys or not.
-Hence, for privately secured zones, the parent may have no
-responsibility. A child wishing to have the parent set the bit must
-contact the parent.
-
-3.2 Rules Governing the Bit
-
-In this section, the words of the previous are turned into definitive
-MUST and SHOULDs. Note that this section does not refer to the bit in
-the NXT. This is in anticipation of a change in the way NXT indicates
-types present (e.g., if bit 0 of the field is defined) or a successor
-to the NXT is defined.
-
-3.2.a. At a delegation point, a secured parent zone MUST have a
-mechanism in place to indicate which RR sets are present. The
-mechanism MUST indicate that the NS, SIG, and the type(s)
-corresponding to the mechanism itself are present (of course, with
-these types actually being present). With the exception of the KEY RR
-type, all other types MUST be indicated as not present, and, in
-accordance with delegation rules, actually be absent from the zone.
-If, in the future, other data is permitted to be present at a
-delegation point, this requirement MUST be amended.
-
-Assuming the NXT record, the above requirement reads as follows. At a
-delegation point, a parent zone must have a secured NXT record. This
-NXT record must indicate that the NS, SIG, and NXT types are present.
-With the exception of KEY, all other types must be indicated as not
-present. The lower casing of the word "must" is intentional,
-conveying that this is an explanation of the rule above.
-
-3.2.b. The KEY set MUST be indicated as present during the time when
-the parent has issued a signature for the child's KEY set. Conversely,
-during periods of time in which the parent knows it has not generated
-a signature for the KEY RR set, the KEY set MUST be indicated to be
-absent.
-
-If the parent has issued signatures with discontinuous validity spans,
-then the presence of the KEY set will flip from present to not present
-and back as time progresses.
-
-3.2.c. When signing a child's KEY RR set, a parent SHOULD carefully
-consider the algorithm of the key used to generate the signature. The
-parent SHOULD make clear to child zones what steps are to be taken to
-
-
-Expires October 13, 2000 [Page 7]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-get the parent to indicate that the child is signed. This document
-will go no further in specifying operational considerations.
-
-(Let's say the parent signs the child's key set with an algorithm the
-child can't process. The child could elect not to advertise this
-signature, as it cannot verify that the signature covers the real key
-set. If this happens, is the parent justified in claiming that the
-child is secured?)
-
-3.2.d. The parent MUST have the capability to allow the child, through
-some trusted, probably non-DNS mechanism, to request that the
-indication of the KEY set to be turned off. This allows a child to
-revert to an unsigned state.
-
-3.2.e. The parent SHOULD NOT allow the child to request that the KEY
-set be indicated as present in the absence of a key signing request.
-
-3.3 Operational Considerations
-
-Retrieving the NXT for a delegated name from the parent zone (the
-upper NXT) is not a trivial operation. The complication arises due to
-having an NXT in the delegatee (the lower NXT) that matches the owner
-name of the upper NXT. (The case in which both the parent and child
-zones are secured is the only case mentioned here. If both are not
-secured, then there will be at most one NXT, which is easily
-retrieved.)
-
-There are two complications to describe. One involves the multiple
-NXT sets matching the same owner. The other is the pragmatic issue of
-knowing where to get the answer.
-
-With multiple NXT sets at the same owner, caches may become a problem.
-If a (for example) recursive server has cached the lower NXT, any
-query for the upper NXT may be confused for a lower NXT query. This
-is akin to the issue of the ANY query, where a server with some cached
-data will answer with just that and not seek the rest of the data.
-
-Note that distinguishing between an upper and lower NXT is a trivial
-operation, especially so if the SIG RR is available.
-
-A resolver may know the child's server's addresses and the parent zone
-may not be sharing servers with the child. In this case the resolver
-will need to be able to locate the parent zones (possibly having to go
-to the root servers and descend) in order to obtain the upper NXT
-record.
-
-A potential solution to this is to define an NXT meta-query that will
-force a recursive server to find all available NXT RR sets for a given
-name. Details of this have not been examined.
-
-3.4 Interaction with Dynamic Update
-
-Dynamic update [RFC 2136, draft-ietf-dnsext-simple-secure-update-
-xy.txt] defines a means by which a zone can change without undergoing
-
-Expires October 13, 2000 [Page 8]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-a full reload. This combination of dynamic update and the proposed
-use of the NXT record to signify a child's status raises some
-concerns.
-
-First a few elements need to be labeled. There is an off-line signer,
-which is the process that signs zone data files away from the name
-server. There is an on-line signer, part of a name server, that the
-dynamic update mechanism uses to sign the updated data. Finally,
-there is an on-line key validator, perhaps a misnomer, which accepts
-requests for parent signatures over each child zone's keys.
-
-The proposal depicted in this draft relies upon the on-line key
-validator informing the on-line and off-line signers of the status of
-a child, recall that the status of a child has a temporal element.
-E.g., a signature may be generated for just the month of July, so the
-child is secured for the month of July, but not the month of August.
-
-The first issues pertain to the way in which an off-line signer comes
-to encode a validation in an NXT record. There is a need for the
-status information to flow from the on-line validator to the off-line
-signer and then be used as input to the signing process. The way that
-this information makes the transition is an issue. The second issue
-is through what mechanism is this information ingested into the NXT
-generating process. Recall that all other information can be derived
-by the zone data, the status of the child isn't stored anywhere else
-in the parent zone.
-
-The next issue is the means in which a validation action is reported
-to the active zone. On the surface, dynamically updating the NXT
-would seem to make sense, but updating the NXT in this manner can lead
-to a race condition in the server, this is unstable. The issue here
-is deriving a mechanism by which a name server knows to signify that
-the child status has changed. Note that this applies to newly
-validated keys as well as the granting of a child's request to cancel
-a validation.
-
-The final issue is the operation of the off-line signer. When an NXT
-is being regenerated, the old NXT is needed to see what the previous
-setting of the child's status had been. The old NXT signature is also
-needed to know that, had the child been known to be secured, for what
-interval was is it thought to be secured so that the new NXT signature
-is appropriately set. Of course, if the reason for updating the NXT
-is a change as described in the previous paragraph, the old NXT is of
-lesser value.
-
-The issue raised in the last paragraph leads to a questioning of the
-sanity of using signature validity periods to signify the temporal
-status of data in a server. What does a server return if the NXT
-needed is not currently covered by a valid signature?
-
-4 NULL keys
-
-Through the use of the types present to indicate the existence of a
-signature validating the KEY set of a child, the need for NULL keys
-
-Expires October 13, 2000 [Page 9]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-effectively disappears. NULL keys are left as a defined entity, but
-are rendered meaningless in DNSSEC.
-
-5 Experimental Status
-
-Without NULL keys, an experimentally secured zone cannot be defined as
-it is in RFC 2535. The purpose of an experimentally secured zone was
-to facilitate the migration from an unsecured zone to a secured zone.
-
-The objective of facilitating the migration can be achieved without a
-special designation of an experimentally secure status. Experimentally
-secured is a special case of privately secured. A zone administrator
-can achieve this by publishing a zone with signatures and configuring
-a set of test resolvers with the corresponding public keys. Even if
-the public key is published in a KEY RR, as long as there is no parent
-signature, the resolvers will need some preconfiguration to know to
-process the signatures. This allows a zone to be secured with in the
-sphere of the experiment, yet still be registered as unsecured in the
-general Internet.
-
-6 IANA/ICANN Considerations
-
-This document does not request any action from an assigned number
-authority nor recommends any actions.
-
-7 Security Considerations
-
-Without a means to enforce compliance with specified protocols or
-recommended actions, declaring a DNS zone to be "completely" secured
-is impossible. Even if, assuming an omnipotent view of DNS, one can
-declare a zone to be properly configured for security, and all of the
-zones up to the root too, a misbehaving resolver could be duped into
-believing bad data. If a zone and resolver comply, a non-compliant or
-subverted parent could interrupt operations. The best that can be
-hoped for is that all parties are prepared to be judged secure and
-that security incidents can be traced to the cause in short order.
-
-8 Acknowledgements
-
-The need to refine the definition of a secured zone has become
-apparent through the efforts of the participants at two DNSSEC
-workshops, sponsored by the NIC-SE (.se registrar) and CAIRN (a
-DARPA-funded research network). Further discussions leading to the
-document include Olafur Gudmundsson, Russ Mundy, Robert Watson, and
-Brian Wellington.
-
-9 References
-
-[RFC1034] P. Mockapetris, "Domain Names - Concepts and Facilities,"
-RFC 1034, November 1987.
-
-[RFC1035] P. Mockapetris, "Domain Names - Implementation and
-Specification," RFC 1034, November 1987.
-
-
-Expires October 13, 2000 [Page 10]
-DNS Security Extension Clarification on Zone Status April 13, 2000
-
-[RFC2119] S. Bradner, "Key words for use in RFCs to Indicate
-Requirement Levels," RFC 2119, March 1997
-
-[RFC2136] P. Vixie (Ed.), S. Thomson, Y. Rekhter, J. Bound "Dynamic
-Updates in the Domain Name System," RFC 2136, April 1997.
-
-[RFC2535] D. Eastlake, "Domain Name System Security Extensions," RFC
-2535, March 1999.
-
-[draft-ietf-dnsext-simple-secure-update-xy.txt] B. Wellington, "Simple
-Secure Domain Name System (DNS) Dynamic Update," version 00, February
-2000.
-
-10 Author Information
-
-Edward Lewis NAI Labs 3060 Washington Road Glenwood, MD 21738 +1 443
-259 2352
-
-11 Full Copyright Statement
-
-Copyright (C) The Internet Society (1999, 2000). All Rights Reserved.
-
-This document and translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it
-or assist in its implementation may be prepared, copied, published and
-distributed, in whole or in part, without restriction of any kind,
-provided that the above copyright notice and this paragraph are
-included on all such copies and derivative works. However, this
-document itself may not be modified in any way, such as by removing
-the copyright notice or references to the Internet Society or other
-Internet organizations, except as needed for the purpose of developing
-Internet standards in which case the procedures for copyrights defined
-in the Internet Standards process must be followed, or as required to
-translate it into languages other than English.
-
-The limited permissions granted above are perpetual and will not be
-revoked by the Internet Society or its successors or assigns.
-
-This document and the information contained herein is provided on an
-"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
-TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
-WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."
-
-
-
-
-
-
-
-
-
-
-
-Expires October 13, 2000 [Page 11]
-
-
diff --git a/doc/draft/draft-ietf-dnsext-zone-status-02.txt b/doc/draft/draft-ietf-dnsext-zone-status-02.txt
new file mode 100644
index 0000000000..dc0836b113
--- /dev/null
+++ b/doc/draft/draft-ietf-dnsext-zone-status-02.txt
@@ -0,0 +1,464 @@
+DNSEXT WG Edward Lewis
+INTERNET DRAFT NAI Labs
+Category:I-D July 12, 2000
+
+ DNS Security Extension Clarification on Zone Status
+
+
+Status of this Memo
+
+This document is an Internet-Draft and is in full conformance with all
+provisions of Section 10 of RFC2026.
+
+Internet-Drafts are working documents of the Internet Engineering Task
+Force (IETF), its areas, and its working groups. Note that other
+groups may also distribute working documents as Internet-Drafts.
+
+Internet-Drafts are draft documents valid for a maximum of six months
+and may be updated, replaced, or obsoleted by other documents at any
+time. It is inappropriate to use Internet-Drafts as reference
+material or to cite them other than as "work in progress."
+
+The list of current Internet-Drafts can be accessed at
+http://www.ietf.org/ietf/1id-abstracts.txt
+
+The list of Internet-Draft Shadow Directories can be accessed at
+http://www.ietf.org/shadow.html.
+
+Comments should be sent to the authors or the DNSIND WG mailing list
+namedroppers@internic.net.
+
+This draft expires on January 12, 2001.
+
+Copyright Notice
+
+Copyright (C) The Internet Society (1999, 2000). All rights reserved.
+
+Abstract
+
+The definition of a secured zone is presented, updating RFC 2535.
+After discussion on the mailing list and other working group
+consideration, removed from earlier editions of this draft are a new
+interpretation of the NXT record and a proposal to obsolete NULL
+keys. Deprecation of "experimentally secure" remains.
+
+1 Introduction
+
+Whether a DNS zone is "secured" or not is a question asked in at least
+four contexts. A zone administrator asks the question when
+configuring a zone to use DNSSEC. A dynamic update server asks the
+question when an update request arrives, which may require DNSSEC
+processing. A delegating zone asks the question of a child zone when
+the parent enters data indicating the status the child. A resolver
+asks the question upon receipt of data belonging to the zone.
+
+
+
+
+Expires July 12, 2000 [Page 1]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+1.1 When a Zone's Status is Important
+
+A zone administrator needs to be able to determine what steps are
+needed to make the zone as secure as it can be. Realizing that due to
+the distributed nature of DNS and its administration, any single zone
+is at the mercy of other zones when it comes to the appearance of
+security. This document will define what makes a zone qualify as
+secure (absent interaction with other zones).
+
+A name server performing dynamic updates needs to know whether a zone
+being updated is to have signatures added to the updated data, NXT
+records applied, and other required processing. In this case, it is
+conceivable that the name server is configured with the knowledge, but
+being able to determine the status of a zone by examining the data is
+a desirable alternative to configuration parameters.
+
+A delegating zone is required to indicate whether a child zone is
+secured. The reason for this requirement lies in the way in which a
+resolver makes its own determination about a zone (next paragraph). To
+shorten a long story, a parent needs to know whether a child should be
+considered secured. This is a two part question, what does a parent
+consider a secure child to be, and how does a parent know if the child
+conforms?
+
+A resolver needs to know if a zone is secured when the resolver is
+processing data from the zone. Ultimately, a resolver needs to know
+whether or not to expect a usable signature covering the data. How
+this determination is done is out of the scope of this document,
+except that, in some cases, the resolver will need to contact the
+parent of the zone to see if the parent states that the child is
+secured.
+
+1.2 Islands of Security
+
+The goal of DNSSEC is to have each zone secured, from the root zone
+and the top-level domains down the hierarchy to the leaf zones.
+Transitioning from an unsecured DNS, as we have now, to a fully
+secured - or "as much as will be secured" - tree will take some time.
+During this time, DNSSEC will be applied in various locations in the
+tree, not necessarily "top down."
+
+For example, at a particular instant, the root zone and the "test."
+TLD might be secured, but region1.test. might not be. (For reference,
+let's assume that region2.test. is secured.) However,
+subarea1.region1.test. may have gone through the process of becoming
+secured, along with its delegations. The dilemma here is that
+subarea1 cannot get its zone keys properly signed as its parent zone,
+region1, is not secured.
+
+The popular term for the secured zones at or below subarea1 is an
+"island of security." The only way in which a DNSSEC resolver will
+come to trust any data from this island is if the resolver is
+pre-configured with the zone key(s) for subarea1. All other resolvers
+will not recognize this island as secured.
+
+Expires July 12, 2000 [Page 2]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+Although both subarea1.region1.test. and region2.test. have both been
+properly brought to a secure state by the administering staff, only
+the latter of the two is actually fully secured - in the sense that
+all DNSSEC resolvers can and will verify its data. The former,
+subarea1, will be seen as secured by a subset of those resolvers, just
+those appropriately configured.
+
+In RFC 2535, there is a provision for "certification authorities,"
+entities that will sign public keys for zones such as subarea1. There
+is another draft (currently in last call) that restricts this
+activity. Regardless of the other draft, resolvers would still need
+proper configuration to be able to use the certification authority to
+verify the data for the subarea1 island.
+
+1.3 Impact on RFC 2535
+
+This document updates several sections of RFC 2535. The definition of
+a secured zone is an update to section 3.4 of the RFC. Section 3.4 is
+updated to eliminate the definition of experimental keys and
+illustrate a way to still achieve the functionality they were designed
+to provide. Section 3.1.3 is updated by the specifying the value of
+the protocol octet in a zone key.
+
+2 Status of a Zone
+
+In this section, rules governing a zone's DNSSEC status are presented.
+There are three levels of security defined: full, private, and
+unsecured. A zone is fully secure when it complies with the strictest
+set of DNSSEC processing rules. A zone is privately secured when it
+is configured in such a way that only resolvers that are appropriately
+configured see the zone as secured. All other zones are unsecured.
+
+Note: there currently is no document completely defining DNSSEC
+verification rules. For the purposes of this document, the strictest
+rules are assumed to state that the verification chain of zone keys
+parallels the delegation tree up to the root zone. This is not
+intended to disallow alternate verification paths, just to establish a
+baseline definition.
+
+To avoid repetition in the rules below, the following terms are
+defined.
+
+2.a. Zone signing KEY RR - A KEY RR whose flag field has the value 01
+for name type (indicating a zone key) and either value 00 or value 01
+for key type (indicating a key permitted to authenticate data). (See
+RFC 2535, section 3.1.2). The KEY RR also has a protocol octet value
+of DNSSEC (3) or ALL (255).
+
+The definition updates RFC 2535's definition of a zone key. The
+requirement that the protocol field be either DNSSEC or ALL is a new
+requirement.
+
+2.b On-tree Validation - The authorization model in which only the
+parent zone can is recognized to supply a DNSSEC-meaningful signature
+
+Expires July 12, 2000 [Page 3]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+that is used by a resolver to build a chain of trust from the child's
+keys to a recognized root of security. The term "on-tree" refers to
+following up the DNS domain hierarchy to reach a trusted key,
+presumably the root key if no other key is available. The term
+"validation" refers to the digital signature by the parent to prove
+the integrity, authentication and authorization of the child' key to
+sign the child's zone data.
+
+2.c Off-tree Validation - Any authorization model that permits domain
+names other than the parent's to provide a signature over a child's
+zone keys that will enable a resolver to trust the keys.
+
+2.1 Fully Secured
+
+A fully secured zone, in a nutshell, is a zone that uses only
+mandatory to implement algorithms (RFC 2535, section 3.2) and relies
+on a key certification chain that parallels the delegation tree
+(on-tree validation). Fully secured zones are defined by the
+following rules.
+
+2.1.a. The zone's apex MUST have a KEY RR set. There MUST be at least
+one zone signing KEY RR (2.a) of a mandatory to implement algorithm in
+the set.
+
+2.1.b. The zone's apex KEY RR set MUST be signed by a private key
+belonging to the parent zone. The private key's public companion MUST
+be a zone signing KEY RR (2.a) of a mandatory to implement algorithm
+and owned by the parent's apex.
+
+If a zone cannot get a conforming signature from the parent zone, the
+child zone cannot be considered fully secured. The only exception to
+this is the root zone, for which there is no parent zone.
+
+2.1.c. NXT records MUST be deployed throughout the zone. (Updates RFC
+2535, section 2.3.2.) Note: there is some operational discomfort with
+the current NXT record. This requirement is open to modification when
+two things happen. First, an alternate mechanism to the NXT is
+defined and second, a means by which a zone can indicate that it is
+using an alternate method.
+
+2.1.d. Each RR set that qualifies for zone membership MUST be signed
+by a key that is in the apex's KEY RR set and is a zone signing KEY RR
+(2.a) of a mandatory to implement algorithm. (Updates 2535, section
+2.3.1.)
+
+Mentioned earlier, the root zone is a special case. Defining what
+constitutes a secure root zone is difficult, as the discussion on
+securing the root zone has not come to a consensus in an open forum.
+However, the security of the root zone will be determined by the
+pre-configuration of a trusted key in resolvers. Who generates and
+distributes the trusted key is an open issue.
+
+
+
+
+Expires July 12, 2000 [Page 4]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+2.2 Privately Secured
+
+Note that the term "privately" is open to debate. The term stems from
+the likely hood that the only resolvers to be configured for a
+particular zone will be resolvers "private" to an organization.
+Perhaps the more clumsy "colloquially secure" is more accurate.
+
+A privately secured zone is a zone that complies with rules like those
+for a fully secured zone with the following exceptions. The signing
+keys may be of an algorithm that is not mandatory to implement and/or
+the verification of the zone keys in use may rely on a verification
+chain that is not parallel to the delegation tree (off-tree
+validation).
+
+2.2.a. The zone's apex MUST have a KEY RR set. There MUST be at least
+one zone signing KEY RR (2.a) in the set.
+
+2.2.b. The zone's apex KEY RR set MUST be signed by a private key and
+one of the following two subclauses MUST hold true.
+
+2.2.b.1 The private key's public companion MUST be pre-configured in
+all the resolvers of interest.
+
+2.2.b.2 The private key's public component MUST be a zone signing KEY
+RR (2.a) authorized to provide validation of the zone's apex KEY RR
+set, as recognized by resolvers of interest.
+
+The previous sentence is trying to convey the notion of using a
+trusted third party to provide validation of keys. If the domain name
+owning the validating key is not the parent zone, the domain name must
+represent someone the resolver trusts to provide validation.
+
+2.2.c. NXT records MUST be deployed throughout the zone. (Updates RFC
+2535, section 2.3.2.) Note: see the discussion following 2.1.c.
+
+2.2.d. Each RR set that qualifies for zone membership MUST be signed
+by a key that is in the apex's KEY RR set and is a zone signing KEY RR
+(2.a). (Updates 2535, section 2.3.1.)
+
+2.3 Unsecured
+
+All other zones qualify as unsecured. This includes zones that are
+designed to be experimentally secure, as defined in a later section on
+that topic.
+
+2.4 Wrap up
+
+The designation of fully secured, privately secured, and unsecured are
+merely labels to apply to zones, based on their contents. Resolvers,
+when determining whether a signature is expected or not, will only see
+a zone as secured or unsecured.
+
+Resolvers that follow the most restrictive DNSSEC verification rules
+will only see fully secured zones as secured, and all others as
+
+Expires July 12, 2000 [Page 5]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+unsecured, including zones which are privately secured. Resolvers
+that are not as restrictive, such as those that implement algorithms
+in addition to the mandatory to implement algorithms, will see some
+privately secured zones as secured.
+
+The intent of the labels "fully" and "privately" is to identify the
+specific attributes of a zone. The words are chosen to assist in the
+writing of a document recommending the actions a zone administrator
+take in making use of the DNS security extensions. The words are
+explicitly not intended to convey a state of compliance with DNS
+security standards.
+
+3 Deleted
+
+4 Deleted
+
+5 Experimental Status
+
+The purpose of an experimentally secured zone is to facilitate the
+migration from an unsecured zone to a secured zone. This distinction
+is dropped.
+
+The objective of facilitating the migration can be achieved without a
+special designation of an experimentally secure status.
+Experimentally secured is a special case of privately secured. A zone
+administrator can achieve this by publishing a zone with signatures
+and configuring a set of test resolvers with the corresponding public
+keys. Even if the public key is published in a KEY RR, as long as
+there is no parent signature, the resolvers will need some
+pre-configuration to know to process the signatures. This allows a
+zone to be secured with in the sphere of the experiment, yet still be
+registered as unsecured in the general Internet.
+
+6 IANA/ICANN Considerations
+
+This document does not request any action from an assigned number
+authority nor recommends any actions.
+
+7 Security Considerations
+
+Without a means to enforce compliance with specified protocols or
+recommended actions, declaring a DNS zone to be "completely" secured
+is impossible. Even if, assuming an omnipotent view of DNS, one can
+declare a zone to be properly configured for security, and all of the
+zones up to the root too, a misbehaving resolver could be duped into
+believing bad data. If a zone and resolver comply, a non-compliant or
+subverted parent could interrupt operations. The best that can be
+hoped for is that all parties are prepared to be judged secure and
+that security incidents can be traced to the cause in short order.
+
+8 Acknowledgements
+
+The need to refine the definition of a secured zone has become
+apparent through the efforts of the participants at two DNSSEC
+
+Expires July 12, 2000 [Page 6]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+workshops, sponsored by the NIC-SE (.se registrar), CAIRN (a
+DARPA-funded research network), and other workshops. Further
+discussions leading to the document include Olafur Gudmundsson, Russ
+Mundy, Robert Watson, and Brian Wellington. Roy Arends, Ted Lindgreen
+and others have contributed significant input via the namedroppers
+mailing list.
+
+9 References
+
+[RFC1034] P. Mockapetris, "Domain Names - Concepts and Facilities,"
+RFC 1034, November 1987.
+
+[RFC1035] P. Mockapetris, "Domain Names - Implementation and
+Specification," RFC 1034, November 1987.
+
+[RFC2119] S. Bradner, "Key words for use in RFCs to Indicate
+Requirement Levels," RFC 2119, March 1997
+
+[RFC2136] P. Vixie (Ed.), S. Thomson, Y. Rekhter, J. Bound "Dynamic
+Updates in the Domain Name System," RFC 2136, April 1997.
+
+[RFC2535] D. Eastlake, "Domain Name System Security Extensions," RFC
+2535, March 1999.
+
+[draft-ietf-dnsext-simple-secure-update-xy.txt] B. Wellington, "Simple
+Secure Domain Name System (DNS) Dynamic Update," version 00, February
+2000.
+
+10 Author Information
+
+Edward Lewis
+NAI Labs
+3060 Washington Road
+Glenwood, MD 21738
++1 443 259 2352
+
+
+11 Full Copyright Statement
+
+Copyright (C) The Internet Society (1999, 2000). All Rights Reserved.
+
+This document and translations of it may be copied and furnished to
+others, and derivative works that comment on or otherwise explain it
+or assist in its implementation may be prepared, copied, published and
+distributed, in whole or in part, without restriction of any kind,
+provided that the above copyright notice and this paragraph are
+included on all such copies and derivative works. However, this
+document itself may not be modified in any way, such as by removing
+the copyright notice or references to the Internet Society or other
+Internet organizations, except as needed for the purpose of developing
+Internet standards in which case the procedures for copyrights defined
+in the Internet Standards process must be followed, or as required to
+translate it into languages other than English.
+
+
+Expires July 12, 2000 [Page 7]
+^LDNS Security Extension Clarification on Zone Status January 12, 2001
+
+The limited permissions granted above are perpetual and will not be
+revoked by the Internet Society or its successors or assigns.
+
+This document and the information contained herein is provided on an
+"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
+WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Expires July 12, 2000 [Page 8]
From 4b7d316065e104fcc3e9a985514442951b95a8de Mon Sep 17 00:00:00 2001
From: Michael Sawyer
Date: Fri, 14 Jul 2000 21:33:03 +0000
Subject: [PATCH 091/226] A few bug fixes.
---
bin/dig/dig.c | 37 ++++++++++++++-----------------------
bin/dig/dighost.c | 12 +++++++-----
2 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/bin/dig/dig.c b/bin/dig/dig.c
index 52036f92a3..1557272a42 100644
--- a/bin/dig/dig.c
+++ b/bin/dig/dig.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dig.c,v 1.67 2000/07/14 17:57:23 mws Exp $ */
+/* $Id: dig.c,v 1.68 2000/07/14 21:33:02 mws Exp $ */
#include
#include
@@ -862,28 +862,19 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
rv++;
rc--;
} else {
- /*
- * If we decide to allow query type and class
- * to be specified (without -t and -c options)
- * before a host is given, all that needs to
- * happen is the have_host test here get removed.
- * Nothing should break by doing this.
- */
- if (have_host) {
- if (strncmp(rv[0], "ixfr=", 5) == 0) {
- strcpy(lookup->rttext, "ixfr");
- lookup->ixfr_serial =
- atoi(&rv[0][5]);
- continue;
- }
- if (istype(rv[0])) {
- strncpy(lookup->rttext, rv[0], MXRD);
- continue;
- } else if (isclass(rv[0])) {
- strncpy(lookup->rctext, rv[0],
- MXRD);
- continue;
- }
+ if (strncmp(rv[0], "ixfr=", 5) == 0) {
+ strcpy(lookup->rttext, "ixfr");
+ lookup->ixfr_serial =
+ atoi(&rv[0][5]);
+ continue;
+ }
+ if (istype(rv[0])) {
+ strncpy(lookup->rttext, rv[0], MXRD);
+ continue;
+ } else if (isclass(rv[0])) {
+ strncpy(lookup->rctext, rv[0],
+ MXRD);
+ continue;
}
lookup=clone_lookup(default_lookup, ISC_TRUE);
strncpy(lookup->textname, rv[0], MXNAME-1);
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index dbfdf0eadc..ac1ae6de3b 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -15,7 +15,7 @@
* SOFTWARE.
*/
-/* $Id: dighost.c,v 1.88 2000/07/14 20:14:36 mws Exp $ */
+/* $Id: dighost.c,v 1.89 2000/07/14 21:33:03 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@@ -387,7 +387,7 @@ requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
debug("before insertion, init@%p "
"-> %p, new@%p -> %p",
lookold, lookold->link.next, looknew, looknew->link.next);
- ISC_LIST_INSERTAFTER(lookup_list, lookold, looknew, link);
+ ISC_LIST_PREPEND(lookup_list, looknew, link);
debug("after insertion, init -> "
"%p, new = %p, new -> %p",
lookold, looknew, looknew->link.next);
@@ -1504,6 +1504,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
l = query->lookup;
clear_query(query);
check_next_lookup(l);
+ UNLOCK_LOOKUP;
return;
}
if (sevent->result != ISC_R_SUCCESS) {
@@ -1523,6 +1524,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
INSIST(sockcount >= 0);
isc_event_free(&event);
check_next_lookup(query->lookup);
+ UNLOCK_LOOKUP;
return;
}
b = ISC_LIST_HEAD(sevent->bufferlist);
@@ -1971,7 +1973,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
* outages won't cause the XFR to abort
*/
if ((timeout != INT_MAX) &&
- (l->timer != NULL)) {
+ (l->timer != NULL) &&
+ l->doing_xfr ) {
if (timeout == 0) {
if (l->tcp_mode)
local_timeout = TCP_TIMEOUT;
@@ -2309,7 +2312,7 @@ xfree_lists(void) {
dig_server_t *s;
dig_searchlist_t *o;
- debug("free_lists()");
+ debug("xfree_lists()");
REQUIRE(sockcount == 0);
REQUIRE(recvcount == 0);
@@ -2326,7 +2329,6 @@ xfree_lists(void) {
debug("freeing global server %p", s);
ptr = s;
s = ISC_LIST_NEXT(s, link);
- debug("ptr is now %p", ptr);
isc_mem_free(mctx, ptr);
}
o = ISC_LIST_HEAD(search_list);
From 0e71d03672596dcf423ed8275e2772190e6d2a2e Mon Sep 17 00:00:00 2001
From: Brian Wellington