1055. [func] Version and hostname queries can now be disabled

using "version none;" and "hostname none;",
                        respectively.
(for consistency with "pid-file none" and each other)
This commit is contained in:
Andreas Gustafsson 2001-10-16 22:18:59 +00:00
parent 248732d66f
commit 3c3fe07225
4 changed files with 31 additions and 23 deletions

View file

@ -1,3 +1,7 @@
1055. [func] Version and hostname queries can now be disabled
using "version none;" and "hostname none;",
respectively.
1054. [bug] On Win32, cfg_categories and cfg_modules need to be
exported from the libisccfg DLL.

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.350 2001/10/16 20:04:36 gson Exp $ */
/* $Id: server.c,v 1.351 2001/10/16 22:18:58 gson Exp $ */
#include <config.h>
@ -917,6 +917,9 @@ create_version_zone(cfg_obj_t **maps, dns_zonemgr_t *zmgr, dns_view_t *view) {
result = ns_config_get(maps, "version", &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isvoid(obj))
return (ISC_R_SUCCESS);
versiontext = cfg_obj_asstring(obj);
len = strlen(versiontext);
if (len > 255)
@ -995,10 +998,10 @@ create_hostname_zone(cfg_obj_t **maps, dns_zonemgr_t *zmgr, dns_view_t *view) {
result = ns_config_get(maps, "hostname", &obj);
if (result == ISC_R_SUCCESS) {
if (cfg_obj_isvoid(obj))
return (ISC_R_SUCCESS);
hostnametext = cfg_obj_asstring(obj);
len = strlen(hostnametext);
if (len == 0)
return (ISC_R_SUCCESS);
if (len > 255)
len = 255; /* Silently truncate. */
buf[0] = len;

View 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.167 2001/10/16 20:04:40 gson Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.168 2001/10/16 22:18:59 gson Exp $ -->
<book>
<title>BIND 9 Administrator Reference Manual</title>
@ -2736,8 +2736,8 @@ exact match lookup before search path elements are appended.</para>
statement in the <filename>named.conf</filename> file:</para>
<programlisting>options {
<optional> hostname <replaceable>hostname_string</replaceable>; </optional>
<optional> version <replaceable>version_string</replaceable>; </optional>
<optional> hostname <replaceable>hostname_string</replaceable>; </optional>
<optional> directory <replaceable>path_name</replaceable>; </optional>
<optional> named-xfer <replaceable>path_name</replaceable>; </optional>
<optional> tkey-domain <replaceable>domainname</replaceable>; </optional>
@ -2837,23 +2837,24 @@ be used.</para>
<variablelist>
<varlistentry><term><command>hostname</command></term>
<listitem><para>This defaults to the hostname of the machine hosting
the nameserver as found by gethostname().
Its prime purpose is to be able to identify which of a
number of anycast servers is actually answering your queries by sending a
<command>TXT</command> query for <filename>hostname.bind</filename> in
class <command>CHAOS</command> to the anycast server and getting back a
unique name.
Setting the hostname to a empty string (<userinput>""</userinput>) will
disable processing of the queries.</para>
</listitem></varlistentry>
<varlistentry><term><command>version</command></term>
<listitem><para>The version the server should report
via a query of name <filename>version.bind</filename> in
class <command>CHAOS</command>.
The default is the real version number of this server.</para>
via a query of the name <filename>version.bind</filename>
with type <command>TXT</command>, class <command>CHAOS</command>.
The default is the real version number of this server.
Specifying <command>version none;</command>
disables processing of the queries.</para>
</listitem></varlistentry>
<varlistentry><term><command>hostname</command></term>
<listitem><para>The hostname the server should report via a query of
the name <filename>hostname.bind</filename>
with type <command>TXT</command>, class <command>CHAOS</command>.
This defaults to the hostname of the machine hosting the nameserver as
found by gethostname(). The primary purpose of such queries is to
identify which of a group of anycast servers is actually
answering your queries. Specifying <command>hostname none;</command>
disables processing of the queries.</para>
</listitem></varlistentry>
<varlistentry><term><command>directory</command></term>

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.80 2001/10/16 20:04:41 gson Exp $ */
/* $Id: parser.c,v 1.81 2001/10/16 22:18:57 gson Exp $ */
#include <config.h>
@ -857,7 +857,7 @@ options_clauses[] = {
{ "has-old-clients", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "heartbeat-interval", &cfg_type_uint32, 0 },
{ "host-statistics", &cfg_type_boolean, CFG_CLAUSEFLAG_NOTIMP },
{ "hostname", &cfg_type_qstring, 0 },
{ "hostname", &cfg_type_qstringornone, 0 },
{ "interface-interval", &cfg_type_uint32, 0 },
{ "listen-on", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
{ "listen-on-v6", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
@ -886,7 +886,7 @@ options_clauses[] = {
{ "treat-cr-as-space", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "use-id-pool", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "use-ixfr", &cfg_type_boolean, 0 },
{ "version", &cfg_type_qstring, 0 },
{ "version", &cfg_type_qstringornone, 0 },
{ NULL, NULL, 0 }
};