]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1729. [func] Improve check-names error messages.
authorMark Andrews <marka@isc.org>
Wed, 6 Oct 2004 05:56:29 +0000 (05:56 +0000)
committerMark Andrews <marka@isc.org>
Wed, 6 Oct 2004 05:56:29 +0000 (05:56 +0000)
1728.   [doc]           Update check-names documentation.

1727.   [bug]           named-checkzone: check-names support didn't match
                        documentation.

CHANGES
bin/check/check-tool.c
bin/check/named-checkzone.c
doc/arm/Bv9ARM-book.xml
lib/dns/rdata.c
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 9fec354559a6a0778df08d87c0061f71d7f9c0d2..59265cf90ea8b3ac171f1555d64c406705205528 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 1730.  [port]          Determine the length type used by the socket API.
                        [RT #12581]
 
-1729.  [placeholder]   rt12634
+1729.  [func]          Improve check-names error messages.
 
-1728.  [placeholder]   rt12634
+1728.  [doc]           Update check-names documentation.
 
-1727.  [placeholder]   rt12634
+1727.  [bug]           named-checkzone: check-names support didn't match
+                       documentation.
 
 1726.  [port]          aix5: add support for aix5
 
index cdfb702f3ff3cb742df3e573239f521e59cbb395..6cbc1dc519d7d262661397dba6566add2851b39c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check-tool.c,v 1.10 2004/03/05 04:57:20 marka Exp $ */
+/* $Id: check-tool.c,v 1.11 2004/10/06 05:56:28 marka Exp $ */
 
 #include <config.h>
 
@@ -48,7 +48,9 @@ static const char *dbtype[] = { "rbt" };
 
 int debug = 0;
 isc_boolean_t nomerge = ISC_TRUE;
-unsigned int zone_options = DNS_ZONEOPT_CHECKNS|DNS_ZONEOPT_MANYERRORS;
+unsigned int zone_options = DNS_ZONEOPT_CHECKNS | 
+                           DNS_ZONEOPT_MANYERRORS |
+                           DNS_ZONEOPT_CHECKNAMES;
 
 isc_result_t
 setup_logging(isc_mem_t *mctx, isc_log_t **logp) {
index 7260be9ec29eb4788f5d1977ba4726b83cdfa0c3..a201b6c61e0a054e792d0197f6319d6a4bb15aca 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named-checkzone.c,v 1.29 2004/03/05 04:57:20 marka Exp $ */
+/* $Id: named-checkzone.c,v 1.30 2004/10/06 05:56:28 marka Exp $ */
 
 #include <config.h>
 
@@ -63,7 +63,8 @@ static void
 usage(void) {
        fprintf(stderr,
                "usage: named-checkzone [-djqvD] [-c class] [-o output] "
-               "[-t directory] [-w directory] [-k option] zonename filename\n");
+               "[-t directory] [-w directory] [-k (ignore|warn|fail)] "
+               "[-n (ignore|warn|fail)] zonename filename\n");
        exit(1);
 }
 
@@ -111,12 +112,17 @@ main(int argc, char **argv) {
                        break;
 
                case 'k':
-                       if (!strcmp(isc_commandline_argument, "check-names")) {
+                       if (!strcmp(isc_commandline_argument, "warn")) {
                                zone_options |= DNS_ZONEOPT_CHECKNAMES;
+                               zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
                        } else if (!strcmp(isc_commandline_argument,
-                                          "check-names-fail")) {
+                                          "fail")) {
                                zone_options |= DNS_ZONEOPT_CHECKNAMES |
                                                DNS_ZONEOPT_CHECKNAMESFAIL;
+                       } else if (!strcmp(isc_commandline_argument,
+                                          "ignore")) {
+                               zone_options &= ~(DNS_ZONEOPT_CHECKNAMES |
+                                                 DNS_ZONEOPT_CHECKNAMESFAIL);
                        }
                        break;
 
index 25315785bbea75643928a710d570fbafbb8a8494..9a9a2aa3d5e0ab6a01520678528b9be67c760e96 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
                "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.253 2004/08/16 00:34:33 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.254 2004/10/06 05:56:29 marka Exp $ -->
 
 <book>
 <title>BIND 9 Administrator Reference Manual</title>
@@ -679,8 +679,13 @@ of a server.</para>
               syntax and consistency.</para>
               <cmdsynopsis label="Usage">
                 <command>named-checkzone</command>
-                <arg>-dq</arg>
+                <arg>-djqvD</arg>
                 <arg>-c <replaceable>class</replaceable></arg>
+                <arg>-o <replaceable>output</replaceable></arg>
+                <arg>-t <replaceable>directory</replaceable></arg>
+                <arg>-w <replaceable>directory</replaceable></arg>
+                <arg>-k <replaceable>(ignore|warn|fail)</replaceable></arg>
+                <arg>-n <replaceable>(ignore|warn|fail)</replaceable></arg>
                 <arg choice="plain"><replaceable>zone</replaceable></arg>
                 <arg><replaceable>filename</replaceable></arg>
               </cmdsynopsis>
@@ -2720,7 +2725,7 @@ statement in the <filename>named.conf</filename> file:</para>
     <optional> forward ( <replaceable>only</replaceable> | <replaceable>first</replaceable> ); </optional>
     <optional> forwarders { <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; <optional> <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ; ... </optional> }; </optional>
     <optional> dual-stack-servers <optional>port <replaceable>ip_port</replaceable></optional> { ( <replaceable>domain_name</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> | <replaceable>ip_addr</replaceable> <optional>port <replaceable>ip_port</replaceable></optional> ) ; ... }; </optional>
-    <optional> check-names ( <replaceable>master</replaceable> | <replaceable>slave</replaceable> | <replaceable> response</replaceable> )( <replaceable>warn</replaceable> | <replaceable>fail</replaceable> | <replaceable>ignore</replaceable> ); </optional>
+    <optional> check-names ( <replaceable>master</replaceable> | <replaceable>slave</replaceable> | <replaceable>response</replaceable> )( <replaceable>warn</replaceable> | <replaceable>fail</replaceable> | <replaceable>ignore</replaceable> ); </optional>
     <optional> allow-notify { <replaceable>address_match_list</replaceable> }; </optional>
     <optional> allow-query { <replaceable>address_match_list</replaceable> }; </optional>
     <optional> allow-transfer { <replaceable>address_match_list</replaceable> }; </optional>
@@ -3340,6 +3345,28 @@ If <command>querylog</command> is not specified then the query logging
 is determined by the presence of the logging category <command>queries</command>.
 </para></listitem></varlistentry>
 
+<varlistentry><term><command>check-names</command></term>
+<listitem>
+<para>
+This option is used to restrict the character set and syntax of
+certain domain names in master files and/or DNS responses received
+from the network.  The default varies according to usage area.  For
+<command>master</command> zones the default is <command>fail</command>.
+For <command>slave</command> zones the default is <command>warn</command>.
+For answer received from the network (<command>response</command>)
+the default is <command>ignore</command>.
+</para>
+<para>The rules for legal hostnames / mail domains are derived from RFC 952
+and RFC 821 as modified by RFC 1123.
+</para>
+<para><command>check-names</command> applies to the owner names of A, AAA and
+MX records.  It also applies to the domain names in the RDATA of NS, SOA and MX
+records.  It also applies to the RDATA of PTR records where the owner name
+indicated that it is a reverse lookup of a hostname (the owner name ends in
+IN-ADDR.ARPA, IP6.ARPA, IP6.INT).
+</para>
+</listitem></varlistentry>
+
 </variablelist>
 
 </sect3>
@@ -4730,7 +4757,8 @@ The default is the empty list.</para>
 <listitem><para>
 This option is used to restrict the character set and syntax of
 certain domain names in master files and/or DNS responses received from the
-network.
+network.  The default varies according to zone type.  For <command>master</command> zones the default is <command>fail</command>.  For <command>slave</command>
+zones the default is <command>warn</command>.
 </para>
 </listitem></varlistentry>
 
index a6575a588ac6949d33ffb0828d323b4e972098f6..93aaf07e1aa72134203d95da133751a9b6216365 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rdata.c,v 1.184 2004/03/16 05:52:18 marka Exp $ */
+/* $Id: rdata.c,v 1.185 2004/10/06 05:56:29 marka Exp $ */
 
 #include <config.h>
 #include <ctype.h>
@@ -1588,7 +1588,7 @@ warn_badname(dns_name_t *name, isc_lex_t *lexer,
                file = isc_lex_getsourcename(lexer);
                line = isc_lex_getsourceline(lexer);
                dns_name_format(name, namebuf, sizeof(namebuf));
-               (*callbacks->warn)(callbacks, "%s:%u: %s: %s", 
+               (*callbacks->warn)(callbacks, "%s:%u: warning: %s: %s", 
                                   file, line, namebuf,
                                   dns_result_totext(DNS_R_BADNAME));
        }
index 155fc71c798e7f68aeea58c6876751582a57498b..98b31a14f7a8d5a60e66bf64020a8d65be2a7550 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.420 2004/08/28 05:53:12 marka Exp $ */
+/* $Id: zone.c,v 1.421 2004/10/06 05:56:29 marka Exp $ */
 
 #include <config.h>
 
@@ -1266,12 +1266,13 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
                                             "no master file");
                        else if (result != DNS_R_NOMASTERFILE)
                                dns_zone_log(zone, ISC_LOG_ERROR,
-                                            "loading master file %s: %s",
+                                            "loading from master file %s "
+                                            "failed: %s",
                                             zone->masterfile,
                                             dns_result_totext(result));
                } else
                        dns_zone_log(zone, ISC_LOG_ERROR,
-                                    "loading master file %s: %s",
+                                    "loading from master file %s failed: %s",
                                     zone->masterfile,
                                     dns_result_totext(result));
                goto cleanup;