Commit 26843016 authored by chenzhengzhang's avatar chenzhengzhang
Browse files

Merge branch 'master' into trac1153

parents af632860 5baa7aa7
283. [bug] zhanglikun
Make stats and boss processes wait for answer messages from each
other in block mode to avoid orphan answer messages, add an internal
command "getstats" to boss process for getting statistics data from
boss.
(Trac #519, git 67d8e93028e014f644868fede3570abb28e5fb43)
282. [func] ocean
libdns++: Implement the NAPTR rrtype according to RFC2915,
RFC2168 and RFC3403.
(Trac #1130, git 01d8d0f13289ecdf9996d6d5d26ac0d43e30549c)
bind10-devel-20110819 released on August 19, 2011
281. [func] jelte
Added a new type for configuration data: "named set". This allows for
similar configuration as the current "list" type, but with strings
instead of indices as identifiers. The intended use is for instance
/foo/zones/example.org/bar instead of /foo/zones[2]/bar. Currently
this new type is not in use yet.
(Trac #926, git 06aeefc4787c82db7f5443651f099c5af47bd4d6)
280. [func] jerry
libdns++: Implement the MINFO rrtype according to RFC1035.
(Trac #1113, git 7a9a19d6431df02d48a7bc9de44f08d9450d3a37)
279. [func] jerry
libdns++: Implement the AFSDB rrtype according to RFC1183.
(Trac #1114, git ce052cd92cd128ea3db5a8f154bd151956c2920c)
278. [doc] jelte
Add logging configuration documentation to the guide.
(Trac #1011, git 2cc500af0929c1f268aeb6f8480bc428af70f4c4)
277. [func] jerry
Implement the SRV rrtype according to RFC2782.
libdns++: Implement the SRV rrtype according to RFC2782.
(Trac #1128, git 5fd94aa027828c50e63ae1073d9d6708e0a9c223)
276. [func] stephen
......@@ -29,7 +59,7 @@
returns is str or byte.
(Trac #1021, git 486bf91e0ecc5fbecfe637e1e75ebe373d42509b)
273. [func] vorner
273. [func] vorner
It is possible to specify ACL for the xfrout module. It is in the ACL
configuration key and has the usual ACL syntax. It currently supports
only the source address. Default ACL accepts everything.
......
This diff is collapsed.
......@@ -241,7 +241,7 @@
<section id="managing_once_running">
<title>Managing BIND 10</title>
<para>
Once BIND 10 is running, a few commands are used to interact
directly with the system:
......@@ -280,7 +280,7 @@
<!-- TODO point to these -->
In addition, manual pages are also provided in the default installation.
</para>
<!--
bin/
bindctl*
......@@ -387,7 +387,7 @@ Debian and Ubuntu:
</para>
<orderedlist>
<listitem>
<simpara>
Install required build dependencies.
......@@ -471,7 +471,7 @@ Debian and Ubuntu:
Downloading a release tar file is the recommended method to
obtain the source code.
</para>
<para>
The BIND 10 releases are available as tar file downloads from
<ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
......@@ -550,34 +550,34 @@ Debian and Ubuntu:
<simpara>Define the installation location (the
default is <filename>/usr/local/</filename>).
</simpara>
</listitem>
</listitem>
</varlistentry>
<varlistentry>
<term>--with-boost-include</term>
<listitem>
<listitem>
<simpara>Define the path to find the Boost headers.
</simpara>
</listitem>
</listitem>
</varlistentry>
<varlistentry>
<term>--with-pythonpath</term>
<listitem>
<listitem>
<simpara>Define the path to Python 3.1 if it is not in the
standard execution path.
</simpara>
</listitem>
</listitem>
</varlistentry>
<varlistentry>
<term>--with-gtest</term>
<listitem>
<listitem>
<simpara>Enable building the C++ Unit Tests using the
Google Tests framework. Optionally this can define the
path to the gtest header files and library.
</simpara>
</listitem>
</listitem>
</varlistentry>
</variablelist>
......@@ -696,13 +696,13 @@ Debian and Ubuntu:
</para>
</section>
-->
</chapter>
<chapter id="bind10">
<title>Starting BIND10 with <command>bind10</command></title>
<para>
BIND 10 provides the <command>bind10</command> command which
BIND 10 provides the <command>bind10</command> command which
starts up the required processes.
<command>bind10</command>
will also restart processes that exit unexpectedly.
......@@ -711,7 +711,7 @@ Debian and Ubuntu:
<para>
After starting the <command>b10-msgq</command> communications channel,
<command>bind10</command> connects to it,
<command>bind10</command> connects to it,
runs the configuration manager, and reads its own configuration.
Then it starts the other modules.
</para>
......@@ -779,7 +779,7 @@ Debian and Ubuntu:
<command>b10-msgq</command> service.
It listens on 127.0.0.1.
</para>
<!-- TODO: this is broken, see Trac #111
<para>
To select an alternate port for the <command>b10-msgq</command> to
......@@ -1105,10 +1105,10 @@ since we used bind10 -->
The configuration data item is:
<variablelist>
<varlistentry>
<term>database_file</term>
<listitem>
<listitem>
<simpara>This is an optional string to define the path to find
the SQLite3 database file.
<!-- TODO: -->
......@@ -1130,7 +1130,7 @@ This may be a temporary setting until then.
<varlistentry>
<term>shutdown</term>
<listitem>
<listitem>
<simpara>Stop the authoritative DNS server.
</simpara>
<!-- TODO: what happens when this is sent, will bind10 restart? -->
......@@ -1186,7 +1186,7 @@ This may be a temporary setting until then.
<varlistentry>
<term>$INCLUDE</term>
<listitem>
<listitem>
<simpara>Loads an additional zone file. This may be recursive.
</simpara>
</listitem>
......@@ -1194,7 +1194,7 @@ This may be a temporary setting until then.
<varlistentry>
<term>$ORIGIN</term>
<listitem>
<listitem>
<simpara>Defines the relative domain name.
</simpara>
</listitem>
......@@ -1202,7 +1202,7 @@ This may be a temporary setting until then.
<varlistentry>
<term>$TTL</term>
<listitem>
<listitem>
<simpara>Defines the time-to-live value used for following
records that don't include a TTL.
</simpara>
......@@ -1267,7 +1267,7 @@ TODO
<note><simpara>
The current development release of BIND 10 only supports
AXFR. (IXFR is not supported.)
AXFR. (IXFR is not supported.)
<!-- TODO: sqlite3 data source only? -->
......@@ -1314,7 +1314,7 @@ what if a NOTIFY is sent?
<note><simpara>
The current development release of BIND 10 only supports
AXFR. (IXFR is not supported.)
AXFR. (IXFR is not supported.)
Access control is not yet provided.
</simpara></note>
......@@ -1370,7 +1370,7 @@ what is XfroutClient xfr_client??
<para>
The main <command>bind10</command> process can be configured
to select to run either the authoritative or resolver.
to select to run either the authoritative or resolver or both.
By default, it starts the authoritative service.
<!-- TODO: later both -->
......@@ -1390,16 +1390,85 @@ what is XfroutClient xfr_client??
</para>
<para>
The resolver also needs to be configured to listen on an address
and port:
By default, the resolver listens on port 53 for 127.0.0.1 and ::1.
The following example shows how it can be configured to
listen on an additional address (and port):
<screen>
&gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
&gt; <userinput>config add Resolver/listen_on</userinput>
&gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/address "192.168.1.1"</userinput>
&gt; <userinput>config set Resolver/listen_on[<replaceable>2</replaceable>]/port 53</userinput>
&gt; <userinput>config commit</userinput>
</screen>
</para>
<!-- TODO: later the above will have some defaults -->
<simpara>(Replace the <quote><replaceable>2</replaceable></quote>
as needed; run <quote><userinput>config show
Resolver/listen_on</userinput></quote> if needed.)</simpara>
<!-- TODO: this example should not include the port, ticket #1185 -->
<section>
<title>Access Control</title>
<para>
By default, the <command>b10-resolver</command> daemon only accepts
DNS queries from the localhost (127.0.0.1 and ::1).
The <option>Resolver/query_acl</option> configuration may
be used to reject, drop, or allow specific IPs or networks.
This configuration list is first match.
</para>
<para>
The configuration's <option>action</option> item may be
set to <quote>ACCEPT</quote> to allow the incoming query,
<quote>REJECT</quote> to respond with a DNS REFUSED return
code, or <quote>DROP</quote> to ignore the query without
any response (such as a blackhole). For more information,
see the respective debugging messages: <ulink
url="bind10-messages.html#RESOLVER_QUERY_ACCEPTED">RESOLVER_QUERY_ACCEPTED</ulink>,
<ulink
url="bind10-messages.html#RESOLVER_QUERY_REJECTED">RESOLVER_QUERY_REJECTED</ulink>,
and <ulink
url="bind10-messages.html#RESOLVER_QUERY_DROPPED">RESOLVER_QUERY_DROPPED</ulink>.
</para>
<para>
The required configuration's <option>from</option> item is set
to an IPv4 or IPv6 address, addresses with an network mask, or to
the special lowercase keywords <quote>any6</quote> (for
any IPv6 address) or <quote>any4</quote> (for any IPv4
address).
</para>
<!-- TODO:
/0 is for any address in that address family
does that need any address too?
TODO: tsig
-->
<para>
For example to allow the <replaceable>192.168.1.0/24</replaceable>
network to use your recursive name server, at the
<command>bindctl</command> prompt run:
</para>
<screen>
&gt; <userinput>config add Resolver/query_acl</userinput>
&gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/action "ACCEPT"</userinput>
&gt; <userinput>config set Resolver/query_acl[<replaceable>2</replaceable>]/from "<replaceable>192.168.1.0/24</replaceable>"</userinput>
&gt; <userinput>config commit</userinput>
</screen>
<simpara>(Replace the <quote><replaceable>2</replaceable></quote>
as needed; run <quote><userinput>config show
Resolver/query_acl</userinput></quote> if needed.)</simpara>
<!-- TODO: check this -->
<note><simpara>This prototype access control configuration
syntax may be changed.</simpara></note>
</section>
<section>
<title>Forwarding</title>
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,12 +2,12 @@
.\" Title: b10-auth
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: March 8, 2011
.\" Date: August 11, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-AUTH" "8" "March 8, 2011" "BIND10" "BIND10"
.TH "B10\-AUTH" "8" "August 11, 2011" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
......@@ -70,18 +70,6 @@ defines the path to the SQLite3 zone file when using the sqlite datasource\&. Th
/usr/local/var/bind10\-devel/zone\&.sqlite3\&.
.PP
\fIlisten_on\fR
is a list of addresses and ports for
\fBb10\-auth\fR
to listen on\&. The list items are the
\fIaddress\fR
string and
\fIport\fR
number\&. By default,
\fBb10\-auth\fR
listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&.
.PP
\fIdatasources\fR
configures data sources\&. The list items include:
\fItype\fR
......@@ -114,6 +102,18 @@ In this development version, currently this is only used for the memory data sou
.RE
.PP
\fIlisten_on\fR
is a list of addresses and ports for
\fBb10\-auth\fR
to listen on\&. The list items are the
\fIaddress\fR
string and
\fIport\fR
number\&. By default,
\fBb10\-auth\fR
listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&.
.PP
\fIstatistics\-interval\fR
is the timer interval in seconds for
\fBb10\-auth\fR
......@@ -164,6 +164,25 @@ immediately\&.
\fBshutdown\fR
exits
\fBb10\-auth\fR\&. (Note that the BIND 10 boss process will restart this service\&.)
.SH "STATISTICS DATA"
.PP
The statistics data collected by the
\fBb10\-stats\fR
daemon include:
.PP
auth\&.queries\&.tcp
.RS 4
Total count of queries received by the
\fBb10\-auth\fR
server over TCP since startup\&.
.RE
.PP
auth\&.queries\&.udp
.RS 4
Total count of queries received by the
\fBb10\-auth\fR
server over UDP since startup\&.
.RE
.SH "FILES"
.PP
......
......@@ -20,7 +20,7 @@
<refentry>
<refentryinfo>
<date>March 8, 2011</date>
<date>August 11, 2011</date>
</refentryinfo>
<refmeta>
......@@ -131,15 +131,6 @@
<filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>.
</para>
<para>
<varname>listen_on</varname> is a list of addresses and ports for
<command>b10-auth</command> to listen on.
The list items are the <varname>address</varname> string
and <varname>port</varname> number.
By default, <command>b10-auth</command> listens on port 53
on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
</para>
<para>
<varname>datasources</varname> configures data sources.
The list items include:
......@@ -164,6 +155,15 @@
</simpara></note>
</para>
<para>
<varname>listen_on</varname> is a list of addresses and ports for
<command>b10-auth</command> to listen on.
The list items are the <varname>address</varname> string
and <varname>port</varname> number.
By default, <command>b10-auth</command> listens on port 53
on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses.
</para>
<para>
<varname>statistics-interval</varname> is the timer interval
in seconds for <command>b10-auth</command> to share its
......@@ -208,6 +208,34 @@
</refsect1>
<refsect1>
<title>STATISTICS DATA</title>
<para>
The statistics data collected by the <command>b10-stats</command>
daemon include:
</para>
<variablelist>
<varlistentry>
<term>auth.queries.tcp</term>
<listitem><simpara>Total count of queries received by the
<command>b10-auth</command> server over TCP since startup.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>auth.queries.udp</term>
<listitem><simpara>Total count of queries received by the
<command>b10-auth</command> server over UDP since startup.
</simpara></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>FILES</title>
<para>
......
......@@ -2,12 +2,12 @@
.\" Title: bind10
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: March 31, 2011
.\" Date: August 11, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "BIND10" "8" "March 31, 2011" "BIND10" "BIND10"
.TH "BIND10" "8" "August 11, 2011" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
......@@ -107,6 +107,18 @@ Display more about what is going on for
\fBbind10\fR
and its child processes\&.
.RE
.SH "STATISTICS DATA"
.PP
The statistics data collected by the
\fBb10\-stats\fR
daemon include:
.PP
bind10\&.boot_time
.RS 4
The date and time that the
\fBbind10\fR
process started\&. This is represented in ISO 8601 format\&.
.RE
.SH "SEE ALSO"
.PP
......
......@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2010-2011 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
......@@ -20,7 +20,7 @@
<refentry>
<refentryinfo>
<date>March 31, 2011</date>
<date>August 11, 2011</date>
</refentryinfo>
<refmeta>
......@@ -217,6 +217,30 @@ The default is the basename of ARG 0.
<!--
TODO: configuration section
-->
<refsect1>
<title>STATISTICS DATA</title>
<para>
The statistics data collected by the <command>b10-stats</command>
daemon include:
</para>
<variablelist>
<varlistentry>
<term>bind10.boot_time</term>
<listitem><para>
The date and time that the <command>bind10</command>
process started.
This is represented in ISO 8601 format.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<!--
<refsect1>
<title>FILES</title>
......
......@@ -307,6 +307,11 @@ class BoB:
process_list.append([pid, self.processes[pid].name])
return process_list
def _get_stats_data(self):
return { "stats_data": {
'bind10.boot_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', _BASETIME)
}}
def command_handler(self, command, args):
logger.debug(DBG_COMMANDS, BIND10_RECEIVED_COMMAND, command)
answer = isc.config.ccsession.create_answer(1, "command not implemented")
......@@ -316,14 +321,18 @@ class BoB:
if command == "shutdown":
self.runnable = False
answer = isc.config.ccsession.create_answer(0)
elif command == "getstats":
answer = isc.config.ccsession.create_answer(0, self._get_stats_data())
elif command == "sendstats":
# send statistics data to the stats daemon immediately
cmd = isc.config.ccsession.create_command(
'set', { "stats_data": {
'bind10.boot_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', _BASETIME)
}})
'set', self._get_stats_data())
seq = self.cc_session.group_sendmsg(cmd, 'Stats')
self.cc_session.group_recvmsg(True, seq)
# Consume the answer, in case it becomes a orphan message.
try:
self.cc_session.group_recvmsg(False, seq)
except isc.cc.session.SessionTimeout:
pass
answer = isc.config.ccsession.create_answer(0)
elif command == "ping":
answer = isc.config.ccsession.create_answer(0, "pong")
......
......@@ -147,6 +147,12 @@ class TestBoB(unittest.TestCase):
self.assertEqual(bob.command_handler("shutdown", None),
isc.config.ccsession.create_answer(0))
self.assertFalse(bob.runnable)
# "getstats" command
self.assertEqual(bob.command_handler("getstats", None),
isc.config.ccsession.create_answer(0,
{ "stats_data": {
'bind10.boot_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', _BASETIME)
}}))
# "sendstats" command
self.assertEqual(bob.command_handler("sendstats", None),
isc.config.ccsession.create_answer(0))
......
......@@ -2,12 +2,12 @@
.\" Title: b10-resolver
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: February 17, 2011
.\" Date: August 17, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-RESOLVER" "8" "February 17, 2011" "BIND10" "BIND10"
.TH "B10\-RESOLVER" "8" "August 17, 2011" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
......@@ -54,7 +54,7 @@ must be either a valid numeric user ID or a valid user name\&. By default the da
.PP
\fB\-v\fR
.RS 4
Enabled verbose mode\&. This enables diagnostic messages to STDERR\&.
Enable verbose mode\&. This sets logging to the maximum debugging level\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
......@@ -77,6 +77,25 @@ string and
number\&. The defaults are address ::1 port 53 and address 127\&.0\&.0\&.1 port 53\&.
.PP
\fIquery_acl\fR
is a list of query access control rules\&. The list items are the
\fIaction\fR
string and the
\fIfrom\fR
or
\fIkey\fR
strings\&. The possible actions are ACCEPT, REJECT and DROP\&. The
\fIfrom\fR