Beruflich Dokumente
Kultur Dokumente
ANS
Authoritative
Administrator’s
Name
Manual
Server
This software and documentation is subject to and made available pursuant to the terms of the Nominum
License Agreement, and may be used or copied only in accordance with the terms of that Agreement.
This manual, in whole or in part, may not be reproduced, translated or reduced to any machine-readable
form without prior written approval from Nominum, Incorporated.
Nominum, Incorporated
2000 Seaport Boulevard
Suite 400
Redwood City, CA, 94063
USA
http://www.nominum.com
Nominum ANS i
ii Table of Contents
Nominum ANS
Table of Contents iii
show-view ......................................................................................................85
show-zone ......................................................................................................87
list-drivers......................................................................................................89
statistics.........................................................................................................90
stop ................................................................................................................94
uuid................................................................................................................94
unblock-checkpoints......................................................................................94
update-data ....................................................................................................94
update-server .................................................................................................96
update-view....................................................................................................96
update-zone....................................................................................................99
version .........................................................................................................100
Nominum ANS
iv Table of Contents
11 Supporting Programs.........................................................165
ans_signer....................................................................................................165
nom_keytool.................................................................................................167
nom_maketsigsecret.....................................................................................168
nom_nanny ..................................................................................................168
Nominum ANS
Table of Contents v
A Statistics ...........................................................................175
B ANS Events ......................................................................179
C Logging Switches ..............................................................185
D Examples of Server and View Operations .........................189
Server Operations.........................................................................................189
Running Nominum ANS in a chroot() Jail ....................................................196
View Operations...........................................................................................200
Index.........................................................................................213
Nominum ANS
vi Table of Contents
Nominum ANS
List of Tables
Table 1-1 Typographical Conventions.......................................................................................3
Table 2-1 ans Command-line Options.......................................................................................9
Table 3-1 Derived Zone Elements...........................................................................................18
Table 4-1 VDB Driver Arguments...........................................................................................28
Table 4-2 cc Driver Arguments...............................................................................................29
Table 4-3 file Driver Arguments .............................................................................................30
Table 5-1 Option Formats .......................................................................................................35
Table 5-2 ANS Server Options................................................................................................36
Table 5-3 ANS View Options..................................................................................................41
Table 5-4 Zone options ...........................................................................................................47
Table 6-1 nom_tell command-line options ..............................................................................70
Table 6-2 ANS Command Channel messages..........................................................................73
Table 6-3 Zone Maintenance Status ........................................................................................82
Table 6-4 Zone Maintenance Tasks ........................................................................................83
Table 6-5 Zone Maintenance Tasks Reflected Via The Command Channel............................83
Table 7-1 Database revision flags .........................................................................................103
Table 7-2 Common Configuration Elements..........................................................................104
Table 7-3 ans_load Options ..................................................................................................105
Table 7-4 ans_import Options...............................................................................................111
Table 7-5 ans_dump Options ................................................................................................114
Table 7-6 ans_dump --revision Formats ...............................................................................115
Table 7-7 ans_listzones Options ...........................................................................................115
Table 7-8 ans_listviews Options ...........................................................................................116
Table 7-9 ans_delete Options ...............................................................................................117
Table 7-10 ans_loadzoneconf Options ....................................................................................117
Table 7-11 ans_dumpzoneconf Options ..................................................................................118
Table 7-12 ans_copy Options..................................................................................................119
Table 7-13 ans_diff Options....................................................................................................120
Table 7-14 ans_edit Options ...................................................................................................122
Table 7-15 ans_versions Options ............................................................................................123
Table 8-1 $DELETE Directives ............................................................................................134
Nominum ANS
List of Figures
Figure 2-1 Example DNS Master file..........................................................................................7
Figure 6-1 Example channel.conf entries .................................................................................68
Figure 6-2 add-view Example ..................................................................................................75
Figure 6-3 Deleting a view from the server with nom_tell ........................................................77
Figure 6-4 Flushing the cache..................................................................................................77
Figure 6-6 show-maintenance Command with Status Tag.........................................................84
Figure 6-5 Displaying a Zone’s Maintenance State With show-maintenance............................84
Figure 6-7 Displaying the Server’s Global Configuration With show-server .............................85
Figure 6-8 Sample default.vc File ............................................................................................86
Figure 6-9 Output of nom_tell show-view Command for Default View .....................................87
Figure 6-10 show-zone Results for Default Zone ........................................................................88
Figure 6-11 show-zone Results for a Specific Zone ....................................................................89
Figure 6-12 Using nom_tell to Generate Statistics for a View ....................................................92
Figure 6-13 Enabling Per-Zone Statistics With update-zone......................................................93
Figure 6-14 Stop ANS With nom_tell.........................................................................................94
Figure 6-15 update-data with nom_tell interactive mode ...........................................................95
Figure 6-16 Update Server using nom_tell .................................................................................96
Figure 6-17 Adding a View Option with update-view.................................................................97
Figure 6-18 Using show-view to see the Results of an Update ...................................................98
Figure 6-19 Setting a Log Switch with update-view....................................................................99
Figure 6-20 version command output .......................................................................................100
Figure 8-1 Adding a Master Zone...........................................................................................127
Figure 8-2 Adding Data to a Master Zone Using update-data.................................................128
Figure 8-3 Add a Slave Zone..................................................................................................128
Figure 8-4 Verifying an Added Option with show-zone ..........................................................136
Figure 8-5 Adding a Host-based allow-update Option Using update-zone .............................136
Figure E-1 Sample Server Configuration File .........................................................................208
Figure E-2 Sample View Configuration File ...........................................................................209
Nominum ANS ix
x List of Figures
Nominum ANS
1
Introduction to Nominum
ANS
The Authoritative Name Server (ANS) is an authoritative Domain Name System (DNS) nameserver. ANS
includes a full implementation of DNS authoritative server standards, and several operational and data-
base stability advantages over other authoritative nameserver implementations, including:
• High performance, which both supports the ability to serve very large datasets and amounts of
traffic, and provides resilience against sharply increased loads that typically occur during DDOS
attacks and virus epidemics.
This manual, where practical, describes these methods, which include the following:
Nominum 1
2 Chapter 1: Introduction to Nominum ANS
• Using the ans.conf configuration file. This optional method is discussed in Chapter 2, ”Getting
Started With ANS”.
• Using the Nominum Command Channel (CC) protocol via the nom_tell program. This method
is discussed in Chapter 6, ”Using the Command Channel with ANS”.
• Using a utility program (which itself communicates via the Command Channel). These utilities
are discussed in Chapter 7, ”The ANS Utilities”.
Organization
Chapter 1, ”Introduction to Nominum ANS”, this chapter, describes ANS in general terms and provides a
view of the Manual’s organization.
Chapter 2, ”Getting Started With ANS”, provides the most basic information for starting the ANS server
and loading a master zone file.
Chapter 5, ”Server, View and Zone Options”, lists each option with a brief description.
Chapter 6, ”Using the Command Channel with ANS”, provides information regarding how to manipulate
the data being served by ANS via the nom_tell program, which is an implementation of the Nominum
Command Channel protocol. Several examples of modifying data are included.
Chapter 7, ”The ANS Utilities”, describes the programs used to manipulate DNS zones and data.
Chapter D, ”Examples of Server and View Operations”, gives examples of how to perform many common
DNS administration tasks at the server and view levels.
Chapter 8, ”Examples of Zone Operations”, gives examples of common operations at the zone level.
Chapter 10, ”Secret Key Transaction Authentication (TSIG)”, describes how to configure TSIG and
GSS-TSIG with ANS.
Nominum
About This Manual 3
Chapter 11, ”Supporting Programs”, describes programs that support the use of ANS, especially with
authentication.
Appendix B, ANS Events, describes the events that can be requested by Command Channel clients. These
events are useful for organizations wishing to integrate ANS with other programs, or with an existing Sim-
ple Network Protocol Management (SNMP) monitoring system.
Appendix E, ANS Files, discusses the locations and purpose of all files that ANS creates.
Typographical Conventions
The following typographical conventions are used throughout the Administrator’s Manual:
Example Conventions
In command examples, the backslash character (\) denotes artificial linebreaks—for example:
Nominum
4 Chapter 1: Introduction to Nominum ANS
Nominum
2
Getting Started With ANS
This chapter explains the steps needed to get started with ANS.
For this section, we assume that the ANS software has already been installed according to the INSTALL
instructions included with the ANS package. We also assume that you already have some DNS zone data
that you are serving via some means other than ANS that you wish to load into ANS.
Once installed, there are only two things you need to do to start DNS service via ANS:
# /etc/init.d/nom_nanny start
Nominum 5
6 Chapter 2: Getting Started With ANS
# /etc/init.d/ans start
NOTE When an engine’s initialization script is executed, it first checks to see if the nom_nanny
process is running. If nom_nanny is already running, the initialization script instructs
nom_nanny to start the engine process. If the nom_nanny process isn’t running, the
engine’s initialization process simply starts the engine process, which then runs unmoni-
tored.
The nom_tell program uses the Nominum Command Channel to communicate with Nominum servers.
This program is described in detail in Chapter 6, "Using the Command Channel with ANS". You can use
nom_tell to determine whether ANS is running:
# ans version
{
type => 'version'
vendor => 'Nominum'
product => 'ANS'
platform => '<platform>'
version => '<version>'
}
ANS supports the RFC 1035 master file format (see ftp://ftp.rfc-editor.org/in-notes/rfc1035.txt), with
some enhancements.
(If you are not already running a DNS server, you may not have such a file and should use other ways of
loading data into ANS, which are discussed in subsequent chapters.)
The ans_load command is a utility that is provided especially to load existing zone data that is in the stan-
dard DNS Master File format. For details about this utility, see Chapter 7, "The ANS Utilities". Use the
ans_load command to read and load a DNS master file into a Nominum ANS database. This example
loads the zone example from the DNS master file example.master.
Nominum
Loading a DNS Master File 7
$TTL 3600
$ORIGIN example.
@ SOA ns1 hostmaster 100 3600 1800 604800 3600
NS ns1
NS ns2
ns1 A 10.0.0.1
ns2 A 10.0.0.2
mail1 A 10.0.0.3
mail2 A 10.0.0.4
host1 A 10.1.0.1
host2 A 10.1.0.2
A 10.2.0.2
MX 0 mail1
MX 10 mail2
host3 A 10.1.0.3
host4 A 10.1.0.4
A 10.2.0.4
MX 0 mail1
MX 10 mail2
You can load this data by issuing an ans_load command. For more detail on ans_load, see ”ans_load”
on page 104 of Chapter 7, ”The ANS Utilities”.
The server is now serving the zone. In the server’s logging output, you will see the following:
The first line says that a new zone called example was created in the default view. Views are discussed in
Chapter 2, "Getting Started With ANS" and subsequent chapters.
Nominum
8 Chapter 2: Getting Started With ANS
The second line means that this zone was modified (in this case, data was added to the empty zone that
was created).
A dig command (dig is a freely available DNS query tool) confirms that the data is now present in the
ANS server. Your ANS server is now running and serving data.
;; ANSWER SECTION:
example. 1H IN SOA ns1.example. hostmaster.example. (
100 ; serial
1H ; refresh
30M ; retry
1W ; expiry
1H ) ; minimum
;; AUTHORITY SECTION:
example. 1H IN NS ns2.example.
example. 1H IN NS ns1.example.
;; ADDITIONAL SECTION:
ns2.example. 1H IN A 10.0.0.2
ns1.example. 1H IN A 10.0.0.1
Nominum
Additional Technical Background 9
Fatal errors during server setup (for example, certain types of erro-
neous configuration) cause the server to restart itself in safe mode
rather than exiting, unless the use of safe mode has been disabled
with the --no-safe-mode option.
Nominum
10 Chapter 2: Getting Started With ANS
# /usr/local/nom/sbin/ans -f
ANS: info: starting Nominum ANS <version>
ANS: info: configuration file is '/etc/ans.conf'
ANS: info: working directory is '/var/nom/ans'
ANS: info: opening subprocess databases
Nominum
Additional Technical Background 11
The log messages show that ANS initialized itself in its working directory, /var/nom/ans, started listening
for DNS requests on both IPv4 and IPv6 interfaces, and found no zones to load in its standard master and
slave databases.
If a configuration file does not exist, ANS uses a default configuration, which:
• Listens for Nominum Command Channel requests on the ans channel as defined in /etc/chan-
nel.conf (by default on port 9353 of the loopback address).
However, if you wish to change one of these defaults, do so via the /etc/ans.conf file. If you choose to
utilize a configuration file, this section describes the server configuration file for ANS and what it can con-
tain.
The configuration file is read before any setuid() or chroot() functions requested on the command line
are executed, and if no configuration file is specified on the command line when the ans command is
given, the server tries to load /etc/ans.conf.
Nominum
12 Chapter 2: Getting Started With ANS
An ANS configuration file is a sequence of lines. Blank lines and lines starting with # are ignored. A con-
figuration line contains an option name, possibly followed by whitespace and then a value. If present, the
value is all of the remaining text on the line, including any non-leading whitespace.
A configuration file contains options and their values. Options may apply to the whole server or to a par-
ticular view. The server, view, and zone option, their formats and descriptions, are listed in Chapter 5,
"Server, View and Zone Options".
foreground
directory /var/nom/ans
listen-on 127.0.0.1#53
listen-on 128.177.193.79#53
db master vdb base=master
db slave vdb base=slave
import-view "internal"
import-view "default"
Views
Views are an integral part of how ANS presents data. ANS allows multiple views of the DNS namespace to
be presented, and selects the appropriate view based on the address of the requestor, and/or the address
of the service. That is, a query from one client can be directed to a specific view and see the data in that
view, while a different query can be directed to different data in a different view.
A view configuration file named viewname.vc will exist for every view imported by the server configura-
tion—ANS automatically creates any missing .vc files on startup.
View configuration files are text files with the same basic form as the server configuration file. The
options which may be configured are described in Table 5-3 on page 41.
Nominum recommends using the Command Channel to modify view configurations, but you may also
edit the view configuration files directly when the server is not running. Note that comments in a view
configuration file will be lost if the view is subsequently updated via the Command Channel.
Nominum
3
Zones and Templates
This chapter provides information on the key concepts of zones and templates in ANS
Zones
This section provides a brief overview of the various zone types in ANS. A zone type describes the
source(s) of the zone’s data. A zones may be only of one type.
There are four types of zones, distinguished by how each obtains its data:
• Slave zones—The zone’s DNS content is obtained from elsewhere (such as a “master” server).
• Instance zones—The zone’s DNS content is obtained by combining customized data with tem-
plate data.
• Alias zones—The zone’s DNS content is copied from a zone with the same name in another
view.
Nominum 13
14 Chapter 3: Zones and Templates
The version number of a zone is an ANS construct, not a DNS construct, and changes every time a change
is made to the zone in the database. Version numbers possess much stronger properties than the DNS
serial number. DNS serial numbers, because they are under user control, may be left unchanged and even
decremented, but the zone version number increments if the database changes. Zone versions always
increase, and are 64-bit numbers to avoid overflowing.
The SOA serial numbers of instance zones are controlled by ANS and generated using the SOA serial from
either the customization or the template. By default, the SOA serial from the customization (if present) is
used—otherwise the SOA serial is that of the template.
Master Zones
A master zone is loaded into ANS by the operator (it is not transferred from another host). Master zones
contain both configuration information and zone data. Configuration information is typically information
such as which servers to notify when updates occur. Zone data is Resource Record information, such as
the Name Server (NS) for the zone.
The key difference between master and slave zones is that master zones define “the truth”, and slaves ask
a master for a definition of “the truth”. Master zones, unlike slave zones, do not expire (for a definition of
expiration, see ”Slave Zones”).
Slave Zones
A slave zone contains data transferred from a single master server, chosen from a group of one or more
master servers that should (under normal circumstances) all contain identical data. If a slave zone is
unable to contact its master for the amount of time specified in the expire field of its SOA record, it’s
subject to expiration—the ANS server believes that the slave zone doesn’t contain valid data, and thus
cannot be served.
Slave zones must have a masters configuration element defined. This element specifies the IP addresses
from which the local server should copy its information. That is, the address of the master server that the
salve (local) server contacts for authoritative data.
Nominum
Zones 15
Instance Zones
Instance zones get their data from two sources—data templates and customization, which means data
customized for a particular zone instance. For more information on templates in ANS, see ”Templates” on
page 19.
You can think of an instance zone as a master zone whose data has been combined with that from a data
template. An instance zone can have its own configuration information and zone data and the zone data
from a data template. In this case, the zone data defined specifically for the instance zone itself is called a
customization or customized data (because it applies only to the instance zone itself). The instance may
also have no customization; that is, its data is identical to that of the data template.
The information in the data template can be applied to more than one instance zone. When a zone is
using a data template and customization data overlaps with information from the template, ANS first
looks for zone options in the instance zone’s own configuration, and then looks for zone options in the
data template. This choice is made at the RRset level, not the node level.
A zone is an instance zone if it has a data-template configuration element. If present, this element
specifies the name of the data template in which additional zone data is defined.
As explained in ”Templates” on page 19, any type of zone, including an instance zone, may have a con-
figuration template (that is, use a template for shared configuration data). As with data templates, when
a zone is using a configuration template, ANS first looks for zone options in the zone’s own configura-
tion, and then looks for zone options in its template.
Instance zones may not be transferred incrementally, but are always transferred in full, and this may both
substantially increase memory requirements for the slave server (see ”purge-zone” on page 79 for assis-
tance in alleviating this) and affect the server’s ability to transfer the resulting zone out again incremen-
tally.
Alias Zones
An alias zone is a zone whose contents are copied from a zone of the same name that is part of a differ-
ent view. Zone aliases permit content to be stored and cached only once for greater efficiency. Changing
the canonical copy instantly propagates the change to all of its aliases.
Alias zones allow a zone stored in one view to be visible in another view. This is useful in cases where mul-
tiple views are needed with identical zone content. Alias zones have a source-view configuration ele-
ment. This element specifies the name of the view in which the zone’s content is defined.
Nominum
16 Chapter 3: Zones and Templates
Alias zones can’t be aliased, but master zones, slave zones, and instance zones can.
NOTE Aliases must have the same name as their canonical copies. Aliasing simply makes a zone
available in multiple views—it is not templating.
Alias Behavior
Any operation that can be performed on the source of an alias zone, with the exception of creating an
alias, may be performed on the alias zone as well. For example, an alias of a master zone will accept
DDNS updates, an alias of a template may be used as a data template, and so on.
Example
For this example, assume that two views exist, “internal” and “external”, and that the “example” zone in
the “external” view is to be visible in “internal” as well.
Look at the canonical copy in view “external”—note the aliased-by-view field, which displays the
names of other views with aliases that refer to this zone:
Nominum
Zones 17
The next example shows a zone aliased in more than one other view. First, create the zone in the default
view with ans_load:
Next, create a few new views and alias the zone within them:
# nom_tell ans
ans> add-view view=foo match-to=10.53.0.1
ans> add-view view=bar match-to=10.53.0.2
ans> add-zone view=foo name=example source-view=default
ans> add-zone view=bar name=example source-view=default
Note that zone-type is set to alias, and that the source-view field indicates the source of the
zone’s content. The canonical zone can also be examined:
Note the aliased-by-view field, which provides a list of views that have an alias for this content—this
field isn’t present if a zone has no aliases.
Nominum
18 Chapter 3: Zones and Templates
An attempt to delete a zone that has aliases produces the following error:
Nominum
Templates 19
Templates
You may want to have ten, hundreds or even hundreds of thousands of zones with identical (or nearly
identical) content. Zone templates make it possible to create multiple zones, each containing the default
zone data, without having to separately copy data that is identical for each of the zones into each zone.
More precisely, these are really “a template with zone data” and “a template with configuration data.”
One template may actually feature both types of data, but when a template is applied to a zone, a tem-
Nominum
20 Chapter 3: Zones and Templates
plate type is specified, and the zone is configured according to constraints of the template being applied.
So, if a template with both configuration data and zone data is applied to a zone as a configuration tem-
plate, only the configuration data is used. If the same template is applied as a data template, only the
zone data is used for the zone.
Data templates are only relevant to instance zones. Instance zones are zones that are made up of a com-
bination of customized data and zone template data. See ”Instance Zones” on page 15, for more infor-
mation on instance zones.
NOTE In zones that use a configuration template, the combined configuration must be inter-
nally consistent. That is, you can’t combine a zone that uses a
masters statement with a template that includes source-view statement, and so
forth.
Configuration Templates
If you have zones which share some common configuration elements, you can create a zone configura-
tion template to store the common elements, and have your zones refer to it instead of duplicating the
configuration. You can’t “stack” configuration templates, but any zone configuration element can be put
into a template.
When a zone is using a configuration template, ANS first looks for zone options in the zone’s own config-
uration, and then looks for zone options in its template.
Any type of zone may have a configuration template (that is, use a template for shared configuration
data).
Data Templates
Only instance zones use data templates. In some cases, an instance zone may contain only data from the
data template; in other cases, instance zones combine template data with data customized for the zone
itself. When responding to DNS queries and zone transfer requests, the customization and data template
are merged.
An important restriction of data templates is that they cannot be updated using Dynamic DNS (DDNS).
Under normal circumstances, a zone query is answered with zone information from a single source—
canonical zone information from master zones, or, in the case of slave zones, canonical information that
has been obtained from an authoritative server.
Nominum
Templates 21
Whereas master zones must be “complete”, and contain all relevant information to answer DNS queries,
may be fragments, and individually contain only part of the zone’s total information. However, taken as a
whole, the combination of data from templates must comprise a complete zone.
Therefore, when a zone query is answered from a merger of instance data and template data, it is
answered from a “complete” zone.
Inevitably, there will be situations where multiple sources of data are available from which to choose
when responding to a DNS query. The “tiebreaking algorithm” is to favor customization data related to an
instance zone over information from a data template.
This choice is made at the RRset level, not the node level. This means that A records for a name may
come from the customized data in the instance zone, while MX records for the same name may come
from the data template.
ANS does not combine Resource Records from different sources to make up a single RRset.
Templating In Action
Assume that you want example.com, example.net, and example.org all to have the same data (DNS con-
tent) and configuration. ANS allows this to be done with one edit instead of three, and without duplicat-
ing storage.
Note that “the same data”, in this case, means “the same data after relativizing to the zone origin”, that
is, looking at information at the node-level rather than the domain-level.
from example.net, you notice that if you look at just the node information, you have the same Resource
Record:
So, how would we use templates to make example.com, example.net and example.org share common
information? The steps are:
Nominum
22 Chapter 3: Zones and Templates
3. Make a configuration template that uses the data from the data template.
4. Apply the configuration template to the zones you want to share the information.
Start with the data content that is shared by the domains and put it in a file called example.data:
$TTL 3600
@ SOA ns1 hostmaster 1 3600 1800 2592000 3600
@ 172800 NS ns1
@ 172800 NS ns2
@ 172800 NS ns3
ns1 A 192.168.1.29
ns2 A 192.168.1.218
ns3 A 10.0.0.9
www 86400 A 192.168.1.204
Load a Zone
ANS requires that the zone name passed to data-template is that of an existing zone, so create a zone
called example.data by loading the template zone data into ANS. Because you are loading a template,
use the --is-template option to the command.
Make a Template
Next, construct a configuration template that uses example.data for data templating.
Use show-zone to display the effects of what’s been done so far. This command will show all the zones
currently known.
ans> show-zone
{
type => 'show-zone'
zone => 'example.data.'
zone-type => 'template'
db => 'master'
version => '3'
Nominum
Templates 23
{
type => 'show-zone'
zone => 'example.com.'
zone-type => 'instance'
conf-template-of => 'example.conf.'
view => 'default'
}
A couple of notes:
• Note the data-template-of entries in example.data and example.conf and the conf-tem-
plate-of entry for example.com, respectively—they display the zones using the indicated
data or configuration template.
;; QUESTION SECTION:
;www.example.com. IN A
;; ANSWER SECTION:
www.example.com. 86400 IN A 192.168.1.204
;; AUTHORITY SECTION:
example.com. 172800 IN NS ns1.example.com.
example.com. 172800 IN NS ns2.example.com.
example.com. 172800 IN NS ns3.example.com.
;; ADDITIONAL SECTION:
Nominum
24 Chapter 3: Zones and Templates
example.com is a “pure” instance—it doesn’t have any data associated with the zone itself that would
override the information from the template. Therefore, all of the data shown comes from the template—
note how all the names that were previously subdomains of example.data in the template are now sub-
domains of example.com.
If you want a change to happen to all the zones using a template, change the data in the template itself.
When the data template is changed, those changes will appear in each instance. For example:
If you want a change to apply only to one specific zone, you create what is called a zone customization.
A customization is DNS data that may be a complete zone, that is, it may have all the data a zone needs
to be served correctly in the DNS, or it may be just a fragment of a zone and need to combine with other
data to be complete.
Now, a query for just_com.example.com yields an answer, but a query for just_com.example.net or
just_com.example.org doesn’t. The various ans_* commands can be used to work with and edit the frag-
ment, if desired. For example:
# ans_dump example.com
just_com 3600 IN A 10.0.0.1
It’s illustrative to compare this to the output of an AXFR of the instance—the view of the data via the DNS
for instance zones is always a fusion of the customized data and the template data.
Nominum
Templates 25
Notice the SOA serial number—ANS controls this value when using templating. Regardless of whether
you change the data in the template, the customization data, or both, ANS ensures that a new and
greater serial number is associated with the new content—this is important for slaves of a templated
zone.
Note that if the instance and the template both provide an RRset, the RRset of the instance is the one
used.
Nominum
26 Chapter 3: Zones and Templates
Nominum
4
Database Drivers
Database Drivers
ANS supports a number of database drivers, which either store DNS data or provide access to sources of
DNS data. This section provides information about configuring drivers for the backend databases that can
currently be used with ANS. In addition, tips for backing up databases are included.
Overview
To indicate that you wish to use a particular database as your backend to ANS, you use the db option in
the ANS configuration file and supply the name of the database driver as its argument:
• cc—A special pseudo-driver that uses the Command Channel protocol to communicate with
the ANS server.
• file—An ANS database driver that creates a virtual read-only ANS database.
Nominum 27
28 Chapter 4: Database Drivers
The engine always updates older database formats to the latest version of that database when you run it.
There are no database conversion steps needed. It is always good practice, however, to copy your data-
bases before you upgrade in case you decide later to back out of a release. Doing so permits easier down-
grading, if that becomes necessary.
When a VDB is opened, the database image is copied from disk to memory. When a VDB is closed, it is
written back to disk. VDB is fully transactional; all changes are journalled on disk, allowing automatic
recovery in the event of system or server failure. The vdb driver also periodically checkpoints the data-
base, to prevent excessive journal sizes on long-running systems.
Argument Description
base=name Use name as the base when constructing database pathnames. The
default name is master. If name has a directory prefix, then the
base_dir will be that prefix, and the base_name will be name
minus the directory prefix. If there is no directory prefix, then
base_dir will be “.” and base_name will be name.
big Use vdb-40 instead of vdb-32 when creating a new database. The
VDB driver supports both “ordinary” (vdb-32) and “big” (vdb-40)
VDBs. A vdb-32 can store up to 2^32 bytes, while a vdb-40 can
store up to 2^40 bytes. vdb-40 is only available on 64-bit platforms
where ANS has been built in 64-bit mode.
Nominum
Database Drivers 29
NOTE When interacting with an ANS database over the Command Channel driver, the default
DB name is “master”. However, if you supply the channel= driver argument, the “data-
base” argument must also be explicitly specified. Should you fail to do so, the database
on which to operate is undefined, and an error is returned.
Argument Description
channel=service_name Use the command channel specified by service_name. The service
must be specified in /etc/channel.conf. The default service_name is
ans.
database Connect to the specified database on the ANS server. The default
database is master.
Example
You can use the cc driver to help you run ANS utilities against a remote server.
use the cc driverarg channel with the appropriate logical database name:
Nominum
30 Chapter 4: Database Drivers
This driver argument can also be used to add a zone to an instance of ANS that was not in the standard
location. If, for example, you had an /etc/channel.conf entry for a second instance of ANS as ans2 and
you wanted to load a zone called test from the directory config into a database called master, the com-
mand could be:
While this driver could be used with an ANS server, it is mostly useful with the ans_diff command to com-
pare the contents of an ANS database with that of a master file. See Chapter 7, ”The ANS Utilities”, for
more information on the ans_diff command.
Argument Description
file=file Use the specified master file as the source of data. This argument
must be specified.
base=file A synonym for file, for consistency with other drivers.
zone=zone The zone into which the master file should be loaded. This argument
must be specified unless URL syntax is used, in which case it will
default to the zone name specified in the URL.
For more information on URL syntax, see ”URL Syntax” on page 102
of Chapter 7, ”The ANS Utilities”.
view=view The view into which the master file should be loaded. The default
view is default.
Nominum
Database Drivers 31
Nominum
32 Chapter 4: Database Drivers
Nominum
Database Drivers 33
Nominum
34 Chapter 4: Database Drivers
Nominum
5
Server, View and Zone
Options
This chapter shows all the server, view and zone options that can be put in a configuration file. In addi-
tion, it explains the formats for the options.
Option Formats
The following formats apply to the option summaries in this chapter.
Format Description
addrport An IPv4 or IPv6 address, optionally including a # followed by a
port number. In some cases, which are noted, only IPv4 addresses
are allowed.
addrpat An IPv4 or IPv6 address, optionally followed by a “/” and a mask
length. The address may be prefixed with “!”, in which case
matching the pattern denies access instead of granting it.
range An IPv4 or IPv6 address, followed by a “-”, followed by an address
of the same family which is greater than or equal to the first one.
The range may be prefixed with “!”, in which case matching the
range will deny access instead of granting it.
Nominum 35
36 Chapter 5: Server, View and Zone Options
Format Description
builtin-acl One of “any”, “none”, “localhost” or “localnets”. A matching pat-
tern grants access unless prefixed with “!”, in which case access is
denied. “any” grants access to all hosts. “none” denies access to
all hosts (equivalent to “!any”). “localhost” matches the address of
all interfaces of the host. “localnets” matches the networks of all
interfaces of the host.
aclpat One of an addrpat, a builtin-acl or a TSIG keyname (which may
be prefixed with “!”).
Server Options
Following are the names and descriptions of the options at the server level, also called “global” options.
Option Description
checkpoint-interval interval For those database drivers that support it, ANS will start
a database checkpoint every interval seconds. The
default value is 86,400 (1 day). A value of 0 disables peri-
odic checkpointing.
Checkpointing speeds up server restart after a system
failure by limiting the number of transaction journal
entries which need to be replayed. Checkpointing is
interleaved with normal server operations, so the server
will continue to be available while checkpointing is in
progress.
Nominum
Server Options 37
Option Description
Alternately, a literal address, port, and secret may be
specified as <addr>#<port>#<secret>. (The secret
may be "*" to disable command channel authentica-
tion, but this is not recommended.)
commands-not-logged command Lists Command Channel message types that should not
be logged when command/executed logging is enabled.
Nominum
38 Chapter 5: Server, View and Zone Options
Option Description
driver name [filename] Registers a database driver with the server. If specified,
[filename] is the name of the shared object that
implements the driver. If not specified, the name and
location of the driver’s shared object are constructed
based on the specified name.
Nominum
Server Options 39
Option Description
listen-on-port port The default port to listen on. The default port is used
when a listener address is specified via a lis-
ten-on-matching statement, or when it is specified by
a listen-on statement which does not specify a port.
The default value is 53 or the value of dns-port if one
is specified.
lock-filename Creates a file containing the server’s process ID (PID). The
server holds a write lock on this file while it is running.
Nominum
40 Chapter 5: Server, View and Zone Options
Option Description
versioncheck-interval interval ANS will periodically attempt to determine if there is a
newer version available than the running version. The
default value is 7 (days). The minimum value is 1 (day)
and the maximum value is 30 (days). If the version
checked is the same as the running version, the admin
will see nothing. If the version has been updated, a mes-
sage will be printed to standard output.
without-rmi without-rmi permits Remote Method Invocation (RMI)
to be disabled for all databases.
View Options
Nominum recommends using the Command Channel to modify view configurations, but you may also
edit the view configuration files directly when the server is not running. Note that comments in a view
Nominum
View Options 41
configuration file will be lost if the view is subsequently updated via the Command Channel. The View
options are listed here:
Option Description
cache-filename file The database stores data within RAM, in a more
compressed format than BIND or ANS stores data.
The cache stores a smaller subset of the data, in a
format that is not as compact, but is faster to
access and build responses than from RAM.
• K or k for kilobytes—1024.
• M or m for megabytes—1024*1024.
• G or g for gigabytes—1024*1024*1024.
gss-credentials principal Specify the Kerberos principal name for which the
server should try to acquire credentials, enabling
the server to authenticate GSS-TSIG signed
requests.
Nominum
42 Chapter 5: Server, View and Zone Options
Option Description
import database Import zones for this view from the specified
database. It it not necessary to import slave data-
bases defined with the slave-db option; they are
automatically imported. The database called mas-
ter is always imported, though it need not be
used.
key name [algorithm] secret Defines a shared secret. name must be a valid
DNS name, and secret is encoded in base64. The
shared secret is used when responding to
TSIG-signed queries.
• hmac-md5
• hmac-sha1
• hmac-sha256
Nominum
View Options 43
Option Description
match pattern The match statement specifies the source informa-
tion used when determining which clients match
the current view. Each element may be one of the
following formats:
• addrpat
• range
• builtin-acl
• TSIG key name
Nominum
44 Chapter 5: Server, View and Zone Options
Option Description
querylog-file file Specifies the name of a file (in the server’s cur-
rent working directory) to which queries are logged
when query logging is enabled (and configured
using the query/answered, query/refused,
and query/error log switches).
Nominum
View Options 45
Option Description
slave-db database Store all slave zones in the specified database. If not
specified, the default slave database name slave
will be used. If no db named slave is registered in
the configuration when all of the configuration has
been read, a default slave database will be created
automatically. Slave databases are automatically
imported into views.
soa-query-rate rate Limit the maximum number of zone maintenance
SOA queries per second to rate. The default value
is 100.
transfers-in count Allow a maximum of count simultaneous inbound
zone transfers. The default is 10.
transfer-source addrport Specify the default IPv4 zone transfer source
address to use for this view. If not specified, the
default value is 0.0.0.0#0, which means “pick an
appropriate address and use a random port”. The
IPv4 transfer source may be overridden on a
per-zone basis using the transfer-source zone
option.
transfer-source-v6 addrport Specify the default IPv6 zone transfer source
address to use for this view. If not specified, the
default value is ::#0, which means “choose an
appropriate address and use a random port”. The
IPv6 transfer source may be overridden on a
per-zone basis using the transfer-source-v6
zone option.
zone-count-hint count Give the server an educated guess on how many
zones will be served, allowing it to pick appropriate
sizes for various internal data structures.
zone-purge-age age The server retains data from prior versions of zones
so that it can respond to IXFR requests. When peri-
odic zone purging runs, prior version data older
than age seconds is deleted. The default value is
604,800 seconds (7 days). Purging can also be
done manually, using the purge-zone command
channel message.
Nominum
46 Chapter 5: Server, View and Zone Options
Option Description
zone-purge-interval interval Periodic zone purging will be performed no more
often than every interval seconds per zone. The
value 0 disables periodic zone purging. The default
value is 86,400 seconds (1 day).
zone-purge-max-versions max Instructs the server to retain no more than max
prior versions during an automatic zone purge. The
value 0 indicates that the number of prior versions
retained is unlimited.
Zone Options
Following are names and descriptions of options that can be set at the zone level.
Nominum
Zone Options 47
Nominum
48 Chapter 5: Server, View and Zone Options
When a zone has a data template, the contents of the zone itself
and its data template are merged when responding to DNS queries
and zone-transfer requests.
empty-nonterminals A boolean. When a zone has a name with multiple labels (for
example, the "a.b.example" name in the "example" zone), but
the parent name(s) have no records, then the parent name(s) are
considered to be empty nonterminals. In the above example,
"b.example" is an empty nonterminal if there are no records asso-
ciated with it.
Nominum
Zone Options 49
If the target of the CNAME is a name within the zone that does
not exist, or a name which exists but has no records of the query
type, an NXDOMAIN or NOERROR/NODATA with an empty answer
section will be returned. This response is identical to what would
be returned if the query was for the target of the CNAME.
If the target of the CNAME is a name outside of the zone, no syn-
thesis is done; the CNAME will be returned as if the invisi-
ble-cnames option was not specified.
bar.example. A 1.2.3.4
bar.example. A 2.3.4.5
foo.example. A 1.2.3.4
foo.example. A 2.3.4.5
Nominum
50 Chapter 5: Server, View and Zone Options
• zone/added
• zone/deleted
• zone/loaded
• zone/modified
masters master... The masters option specifies the list of master servers for a slave
zone. Note that, unlike BIND configurations, there is no need to
explicitly declare a zone to be a slave zone. The presence or
absence of a masters option determines the type of zone.
Nominum
Zone Options 51
To reduce network traffic and not burden slaves, ANS will wait for
the hold interval before sending another NOTIFY message for the
zone. Once the hold interval has expired, ANS will send the next
Notify without delay.
Nominum
52 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 53
The address is also used for SOA refresh queries and forwarded
dynamic updates.
transfer-source-v6 The transfer-source-v6 option specifies the source address to
v6_addrport use when making inbound zone transfers for this zone using IPv6.
If not specified, the view's transfer-source-v6 setting is used.
The address is also used for SOA refresh queries and forwarded
dynamic updates.
update-policy rule The update-policy option specifies a fine-grained set of rules
for granting and denying DNS dynamic updates.
1. access-type—The access-type specifies whether the rule grants or denies access. The
possible values for this field are grant and deny.
3. name-type—The name-type determines the kind of pattern matching which will be used.
The possible values are name, subdomain, wildcard, self, and self-subdomain.
• name matches when the owner name of an update is equal to the name field.
• subdomain matches when the owner name of an update is subdomain of the name field.
(Note that a name is a subdomain of itself.)
• wildcard matches when the owner name of an update matches the DNS wildcard name
in the name field.
Nominum
54 Chapter 5: Server, View and Zone Options
• self matches when the owner name of an update is equal to the identity field.
4. name—The name field specifies the owner name of the zone data to which the rule applies.
5. types—The types field is a possibly-empty list of DNS RR types. ANY may be used to match all
types. The empty list means “use the default list”. The default is “all types except SOA, NS,
RRSIG, and NSEC”.
Each individual update action within a DNS dynamic update message is checked against the update-pol-
icy rules. The rules are checked in order, and the first matching rule determines access. A rule matches if
the identity of the update matches the identity field, the owner name of the individual update
matches the name field, and the RR type is contained in the types list.
For example:
Nominum
Zone Options 55
Nominum
56 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 57
Nominum
58 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 59
Nominum
60 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 61
Nominum
62 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 63
Nominum
64 Chapter 5: Server, View and Zone Options
Nominum
Zone Options 65
Nominum
66 Chapter 5: Server, View and Zone Options
Nominum
6
Using the Command
Channel with ANS
ANS accepts control commands using the Nominum Command Channel protocol, which specifies mes-
sage formats for communicating with Nominum software and defines how such messages are sent. This
chapter briefly describes the nom_tell program and describes the Command Channel commands specific
to ANS.
The commands in this chapter are the most useful for listing and deleting views and zones. Unless you are
working with the databases offline, these are the recommended commands to use for these functions.
To use this functionality, ANS must be configured to listen for Command Channel connections on a TCP
port. When ANS is installed, it is automatically configured to listen for Command Channel connections on
the loopback address (127.0.0.1) with the addition of an ans line to /etc/channel.conf. You can config-
ure Command Channels manually by editing /etc/channel.conf or by adding a command-channel state-
ment to ans.conf.
Nominum ANS ships with a utility program called nom_tell, an implementation of the Nominum Com-
mand Channel protocol. nom_tell can be used to communicate with a Nominum server while it is run-
ning.
In sending commands via nom_tell, responses for requests which failed contain an err tag indicating the
error; the absence of an err tag indicates success.
Requests which cause the server to restart itself after completion will contain a restart tag with a value
of 1.
Nominum 67
68 Chapter 6: Using the Command Channel with ANS
nom_tell
The nom_tell program is an implementation of the Nominum Command Channel specification that per-
mits control and monitoring of Nominum products from the command-line, or a Unix shell.
service is identified in the service description file, usually , and can be thought of as “Which service
needs to know this command (and where should it be sent)?” In Figure 6-1, the service consists of every-
thing on the ans line.
The what element is the part of the command that can be thought of as “What is the service being
told to do?” What nom_tell tells a service to do depends upon the type of server. The ANS-specific Com-
mand Channel commands are unique to each service and are discussed elsewhere in this document.
However, two commands that are understood by every Nominum server are stop and version.
For example:
ans> stop
ans> version
As shown in Figure 6-1, the format of a channel.conf file is a sequence of lines. Blank lines and lines start-
ing with "#" are ignored. A configuration line contains a service name followed by a addrport fol-
lowed by a secret. The items are separated by whitespace.
The service name is used to identify the service. Each server has a default service name, and can also be
configured to use alternative service names.
Nominum
nom_tell 69
The addrport has the form [<address>[%<scope>]#]<port>. For example, 9253 and
10.0.0.1#1111 are both valid addrports. If no address is specified, the loopback address (127.0.0.1) is
used. An address of 0.0.0.0 indicates that a server should listen on all interfaces, and that a client should
use the loopback address to communicate with that server.
The addrport flexibility means that If there is no entry for ans in the channel.conf file, a nom_tell com-
mand service element may take the form of an IP address and port number instead, as shown in the
following command for a Nominum ANS server.
The secret must be quoted (with double quotes) if it contains whitespace. A quote or backslash in the
secret must be quoted by prefixing it with a backslash. Specifying a secret of "*" (without the quotes)
means "no secret".
The NOM_CHANNEL_CONF environment variable may be used to tell Nominum applications an addi-
tional location to look for service entries (e.g., NOM_CHANNEL_CONF=/example/path/channel.conf).
When looking up service entries, Nominum applications, such as nom_tell, may check a number of
locations. In order, the following paths are checked:
• ~/.nom/channel.conf
• /etc/channel.conf
Example
This example uses nom_tell to determine the version of Nominum ANS. It assumes the service ans has
been defined in /etc/channel.conf:
ans> version
{
type => 'version'
vendor => 'Nominum'
product => 'ANS'
platform => 'platform'
version => 'version'
}
Nominum
70 Chapter 6: Using the Command Channel with ANS
Table 6-1 describes the options for the nom_tell command. Note that most options have two forms, a
short form preceded by a hyphen, and a longer form preceded by two hyphens.
Option Description
-e |--encrypt Require that command channel messages be encrypted. If the
service does not support encryption, an error will be returned.
Nominum
nom_tell 71
Option Description
-i | --interactive Instructs nom_tell to enter interactive mode after executing the
command specified by its command line arguments, if any.
Nominum
72 Chapter 6: Using the Command Channel with ANS
Option Description
-v | --verbose Increases verbosity.
Interactive Mode
With few exceptions, examples in this manual are given in nom_tell’s interactive mode. The prompt indi-
cates the mode. If the prompt is
ans>
ans> exit
Environment Variable
nom_tell has one environment variable: NOM_TELL_HISTFILE. This variable takes the name of the history
file used to remember commands between invocations of nom_tell. If unset, nom_tell will not keep a his-
tory. This feature is not available on Windows platforms.
Nominum
73
NOTE Many Unix shells treat some characters specially—when necessary, quote those charac-
ters. For instance, if you are using the C shell, be sure to escape “!” in ACLs with a “\” to
prevent the C shell from doing history substitution.
Table 6-2 lists the commands that can be used as the what direction of a nom_tell command for ANS.
Some of the commands take required or optional arguments, which are not shown in the table.
Command Description
add-view Add a new view to the server’s configuration. See ”add-view” on
page 75.
add-zone Add a new zone configuration. See ”add-zone” on page 75.
checkpoint Start a database checkpoint for all databases which support it. If a
checkpoint is already running, it is canceled first. See ”checkpoint” on
page 76.
delete-view Delete a view from the server’s configuration. See ”delete-view” on
page 76.
delete-zone Delete a zone. See ”delete-zone” on page 77.
flush Flush the cache. See ”flush” on page 77.
force-maintenance Force zone maintenance for the specified zone. See ”force-mainte-
nance” on page 78.
force-notify Force DNS NOTIFY messages to be sent to the notification recipients
configured for a zone. See ”force-notify” on page 78.
force-transfer Force a zone transfer of the specified zone. See ”force-transfer” on
page 78.
list-events Returns a list of all event types supported by ANS. See ”list-events” on
page 78.
Nominum
74 Chapter 6: Using the Command Channel with ANS
Command Description
list-drivers Returns a list of all database drivers supported by ANS. See ”list-driv-
ers” on page 89.
purge-zone Cleanup old versions of a zone. See ”purge-zone” on page 79.
reopen-log-files Close and reopen any open log files. See ”reopen-log-files” on page
80.
request-events Registers events to be sent over the Command Channel connection.
See ”request-events” on page 80.
restart Restarts the server. See ”restart” on page 80.
show-data Shows the contents of a zone. See ”show-data” on page 81.
show-events Returns a list of all events currently registered for the Command
Channel connection. See ”show-events” on page 80.
show-maintenance Display the zone maintenance status of a slave zone. See
”show-maintenance” on page 82.
show-server Display the server’s global configuration. See ”show-server” on page
84.
show-view Display the current configuration of a view. See ”show-view” on page
85.
show-zone Display the current configuration of a zone. See ”show-zone” on
page 87.
statistics Get view or zone statistics. See ”statistics” on page 90.
stop Stop the server. See ”stop” on page 94.
update-data Update the content of a zone. See ”update-data” on page 94.
update-server Update the server’s global configuration. See ”update-server” on
page 96.
update-view Update a view’s configuration. See ”update-view” on page 96.
update-zone Update a zone’s configuration. See ”update-zone” on page 99.
version Return version information about the server. See ”version” on page
100.
A request that fails will contain an err tag indicating the error; the absence of an err tag indicates suc-
cess.
Nominum
add-view 75
add-view
Adds a new view to the server’s configuration. View options may be any option from Table 5-3, “ANS
View Options” on page 41.
Example
The specified options in the view are set to the values given. If the command is successful, the changes
are persistent, even across server restarts, and a corresponding import-view is added to the global con-
figuration.
add-zone
Add a new zone configuration.
Example
ans> add-zone zone=internal.com view=internal notify=no
The values of several of the zone options are Access Control Lists (ACLs). An ACL is a list of aclpat val-
ues. The first matching pattern determines whether access is granted or denied. The behavior if no pat-
tern matches is specific to each zone option and is documented with the zone option.
An aclpat is either an addrpat or a TSIG keyname. A matching pattern grants access unless prefixed
with “!”, in which case access is denied.
An addrpat is an IPv4 or IPv6 address, optionally followed by a ”/” and a mask length. The address may
be prefixed with “!”, in which case the pattern will exclude matching interfaces. The pattern may also be
the name of an interface, such as eth0.
The values any, none, localhost and localnets may also be used. any grants access to all hosts.
none denies access to all hosts (none is equivalent to !any). localhost matches the address of all
interfaces of the host. localnets matches the networks of all interfaces of the host.
Nominum
76 Chapter 6: Using the Command Channel with ANS
block-checkpoints
Ensures that a database checkpoint does not occur for a period of time, so that databases can be safely
backed up. The optional timeout parameter specifies the maximum amount of time (in seconds) that
checkpoint completion is to be blocked. If no timeout is specified, a reasonable default of 1 hour is used.
See ”unblock-checkpoints” on page 94 and ”checkpoint” on page 76 for more information.
Parameters
[timeout=time]
checkpoint
Starts a database checkpoint for all databases which support it. If a checkpoint is already running, it is
canceled first. See ”unblock-checkpoints” on page 94 and ”block-checkpoints” on page 76 for more
information.
delete-view
Deletes a view from the server’s configuration.
Example
If the view is not the default view, the view and all of its associated states are deleted, and the
import-view statement for the view is removed from the server’s global configuration.
ANS requires that a default view exist at all times. If the view being deleted is the default view, all state
associated with the view is deleted, and the view’s configuration is reset to the default. No view-related
events are sent.
Nominum
delete-zone 77
delete-zone
Deletes a zone. All information about the specified zone is deleted. This includes both the zone’s configu-
ration and the actual contents of the zone. If not specified, the view defaults to default.
Example
ans> delete-zone zone=internal.com view=internal
The command yields the following message from the server logged as:
If you use the ans_listzones command, you would see that this zone is not in the master database.
flush
This command flushes the local cache of data that has been fetched from an ANS database. Flushing the
cache is almost never needed or useful because the cache coherency with the backing database is auto-
matically maintained by the server. This command may be useful for debugging in some circumstances.
Example
ans> flush view=default
If a zone is specified, then only that zone is removed, otherwise all zones are removed. If not specified,
the view defaults to default.
Nominum
78 Chapter 6: Using the Command Channel with ANS
force-maintenance
Force zone maintenance for the specified zone.
The zone maintenance process is started for the specified zone if it is not already running. The zone main-
tenance process causes an SOA query to be sent to the zone’s master(s), and if the zone is out of date, a
zone transfer will then be initiated. This command differs from force-transfer by doing the transfer only
when the zone is determined to be out of date. If not specified, the view defaults to default.
Example
ans> force-maintenance zone=internal.com view=internal
force-notify
This command forces DNS NOTIFY messages to be sent to the notification recipients configured for a
zone.
Example
ans> force-notify zone=internal.com view=internal
force-transfer
This command forces a zone transfer of the specified zone.
The zone transfer process is started for the specified zone if that process is not already running. This com-
mand differs from force-maintenance by doing the transfer unconditionally; that is, no up-to-date check
is made.
Example
ans> force-transfer zone=internal.com view=internal
list-events
Returns a list of all event types supported by a particular view in an ANS server. All views support a fixed
set of events, and the default view supports additional events not supported by other views.
Nominum
pid 79
Example
ans> list-events view=default
pid
Retrieve the server's process identifier.
process-information
Return the following information of the server:
• Arguments
purge-zone
Cleans up old versions of a zone. ANS stores old versions of zones so that it may respond to IXFR (incre-
mental transfer) requests. This data is automatically purged on a periodic basis, but administrators desir-
ing greater control may use the purge-zone command.
The command takes an age parameter. Data older than age seconds will be eligible for purging. Note
that data that is eligible for purging will not be purged if it is use by an active outbound IXFR or AXFR. If
not specified, the view defaults to default. If not specified, the age defaults to 7 days.
Example
ans> purge-zone zone=internal.com view=internal age=86400
Nominum
80 Chapter 6: Using the Command Channel with ANS
reopen-log-files
Close and reopen any open log files. This is intended for use by external log rotation programs. Currently,
there is only one log file: the query log file.
If not specified, the view defaults to default. This command must be executed separately for each view.
Example
ans> reopen-log-files [view=viewname]
restart
Restart the server.
ANS can only restart itself if it still has the privileges to do so. If it cannot restart itself, it will log a notice to
the syslog that a manual restart is required.
ans> restart
request-events
Registers events (asynchronous notifications) to be sent over this Command Channel connection.
Events are tied to connections; when this connection closes, all events will be implicitly deregistered.
A list of events may be specified, and the special values all or none can be used to indicate that all
events or no events are desired, respectively.
A list of zones may be specified, which can be used to indicate that matching events should only be sent
for zones matching those listed.
show-events
Returns the list of all events currently registered for this Command Channel connection.
The events tag contains the list of events as specified when requested; that is, it might contain the val-
ues all or none. The listening-for tag contains an explicit list of all events.
Nominum
show-data 81
request:
[ view => view ]
response:
events => events
listening-for => events
show-data
Shows the contents of a zone.
The contents of the requested node (or each node) is returned as a list of records, where each element is
a string containing the record’s name, ttl, class, type, and rdata, respectively.
By default, all names (owner names and names within rdata) in the data field of the response will be rel-
ativized with respect to the zone origin. If the absolute tag is present and has a True value, all names
will be absolute names instead.
By default, comments associated with Resource Records will be returned in the response, formatted in the
standard DNS master file format (each record will be followed by a semicolon and the comment). If the
no-comments tag is present and has a True value, comments will be omitted.
By default, if the zone is an instance, only data from the customized portion of the zone will be returned
in a show-data response. If the merge tag is present and has a True value, data from the constructed
zone will be returned.
If a zone is not specified, the most specific zone containing the name of the node will be used.
Example
ans> show-data node=internal.com
{
type => 'show-data'
zone => 'internal.com.'
data => list of records
}
Nominum
82 Chapter 6: Using the Command Channel with ANS
show-maintenance
Information about the current zone-maintenance state can be retrieved with the show-maintenance
command.
If no view is specified, the default view is used. If no zone is specified, status for all slave zones is
returned. Specifying a tag named “status” whose value is either a single status, or a list of statuses,
restricts the output to zones whose status matches the specified status(es). Figure 6-6, “show-mainte-
nance Command with Status Tag,” on page 84 shows an example using the “status” tag. The valid status
values are:
Both “show-zone” and “show-maintenance”, use two state fields to explain in detail the current mainte-
nance state of the zone. These are:
• current-task
• next-task
current-task is always present, and is the current maintenance activity of the slave zone.
Nominum
show-maintenance 83
next-task is present when current-task is sleeping or soa-receive-wait, and reflects the task
that will execute when—or if, in the case of soa-receive-wait—a timeout occurs.
Task Description
sleeping Waiting until the time specified in the sleeping-until field. When
that time arrives, next-task becomes the current-task.
soa-send-wait Waiting for its turn to send an SOA query to a master.
soa-receive-wait Waiting for the master to respond (or for a timeout if it doesn’t
respond).
transfer-start-wait Waiting for its turn to attempt a zone transfer.
transferring Zone transfer is in progress.
There are two additional states which are sometimes visible when using the Command Channel:
Task Description
destruction-wait Zone maintenance has been terminated for this slave by com-
mand of the user, but it has not yet been garbage collected.
schedule-wait The server is starting up and will start maintenance services for
this zone when it is ready to do so.
Table 6-5 Zone Maintenance Tasks Reflected Via The Command Channel
Nominum
84 Chapter 6: Using the Command Channel with ANS
show-server
Displays the server’s global configuration. By default, only explicitly configured values are returned. If the
all tag is present and has a True value, the full configuration is returned.
If the server is running in safe mode, the safe-mode option will be present in the response and set to
yes.
Nominum
show-view 85
Response returns:
[global_option=global_option_value]
ans> show-server
{
type => 'show-server'
checkpoint-interval => '86400'
directory => '/var/nom/ans'
foreground => 'no'
foreground-with-syslog => 'no'
listen-on-matching => (('0' '127.0.0.1/32' '192.168.1.207/32'))
listen-on-port => '53'
max-tcp-clients => '200'
setup-errors-fatal => 'no'
syslog-facility => 'local4'
umask => '077'
versioncheck-interval => '7'
without-rmi => 'no'
}
show-view
Display the current configuration of a view. By default, only explicitly configured values are returned. If
the all tag is present and has a True value, the full configuration is returned.
If an update-view was recently done, and the update has not completed, the reload-pending option
will be present and have the value 1.
Nominum
86 Chapter 6: Using the Command Channel with ANS
To see what results, first examine the following sample contents of a default.vc file, the data file for the
default view:
import master
import slave
cache-filename "default.cache"
zone-conf-filename "default.zc"
server-id "1304882d-551b-4e39-9ce9-53b3cc425c0f"
slave-db slave
soa-query-rate 80
transfers-in 10
transfer-source 0.0.0.0#0
transfer-source-v6 ::#0
notify-source 0.0.0.0#0
notify-source-v6 ::#0
zone-purge-interval 86400
zone-purge-age 604800
log notify-in/received yes
log notify-in/refused yes
log notify-out/acknowledged yes
log notify-out/sent yes
log query/answered yes
log query/error yes
log update/granted yes
log update/denied yes
log xfr-out/granted yes
log xfr-out/denied yes
log zone/added yes
log zone/deleted yes
log zone/loaded yes
log zone-maintenance/success yes
log zone-maintenance/failure yes
log zone-maintenance/up-to-date yes
log zone-maintenance/xfr-details yes
Now type the command show-view in nom-tell interactive mode to request to see the data in the
default view.
Nominum
show-zone 87
The following output for the sample default.vc file shown above, is displayed:
show-zone
Displays the current configuration of a zone.
If a zone is not specified, information about all zones (that match the zone-type) is returned.
Note that the response to this command can contain the additional parameter:
Nominum
88 Chapter 6: Using the Command Channel with ANS
The derived zone elements are not settable by users but provide information about zone types.
NOTE show-zone results also return any zone options set on the zone. See Table 5-4 on page
47, ”Zone options”, for a list of possible zone option elements.
By default, if the zone uses a configuration template, only the configuration of the zone itself, not config-
uration from the template, will be returned. If the merge tag is present and has a True value, configura-
tion from the template will also be included.
Example
This command, which does not specify a specific zone, could display output such as the following:
ans> show-zone
{
type => 'show-zone'
zone => 'a-example.com.'
}
{
type => 'next'
zone => 'movie.edu.'
}
{
type => 'next'
zone => 'b-example.org.'
}
{
type => 'next'
}
Nominum
list-drivers 89
A command that specifies a zone, such as the following, could return output as shown:
For example, to delete the allow-update option from the zone a-example.com:
list-drivers
Returns a list of all database drivers supported by ANS.
Example
ans> list-drivers
Nominum
90 Chapter 6: Using the Command Channel with ANS
statistics
Instructs ANS to get server, view or zone statistics.
Statistics values are 64-bit integers, reset to zero either on command or whenever the server is loaded.
Statistics are also kept on the query type (for example, the number of MX queries), and only statistics with
values greater than zero are returned, unless the all tag is set to true.
All statistics queries return the time the statistics were last reset (reset-time) and the current time
(current-time) in seconds since the epoch (00:00 UTC, January 1, 1970). Current time may also be
returned in a high-resolution format (current-time-hires) as seconds and microseconds since the
epoch.
The time the statistics were last reset, and the current time are returned in all statistics queries. Both times
are in seconds since the epoch (00:00 UTC, January 1, 1970). The current time is also returned in a
high-resolution format as seconds and microseconds since the epoch.
The amount of CPU time consumed by the ANS process, as reported by the getrusage system call, is
returned in all statistics queries. User CPU time is returned in user-time, and system CPU time in sys-
tem-time.
Specifying a tag named “reset” with any value will cause the counters to be zeroed.
Statistics Scope
Unless otherwise specified, statistics values are for the specified (or default) view as a whole.
• If server is set to true, statistics are returned for the server as a whole.
• If a zone is specified in the command, statistics are returned only for that zone—note that sta-
tistics are only kept at the zone level if the zone has the statistics zone attribute set to yes.
• If a client is specified in the command, statistics are returned only for that client — note that
statistics are only kept at the client level if the view has the per-client-statistics view
attribute set to include the client.
• Total queries
• Successful queries
• Referrals
• NXRRSET responses
Nominum
statistics 91
• NXDOMAIN responses
• Refused queries
• FORMERRs
• Failed queries
• Notifies
Parameters
[zone=name] [view=name] [reset=any_value] [client=address]
[server=boolean] [all=boolean]
In addition, individual statistics are available for the query type (qtype) for all types less than 50, as well
as type ANY. All other qtypes are combined into one qtype statistic called other.
Request:
[ server => boolean ]
[ zone => name ]
[ view => name ]
[ reset => any value ]
[ all => boolean ]
Response:
[ view => string ]
[ zone => string ]
[ reset-time => uint32 ]
[ oldest-version => uint64]
[ current-time => uint32 ]
[ current-time-hires => string ]
Nominum
92 Chapter 6: Using the Command Channel with ANS
Nominum
statistics 93
Resetting Statistics
It is possible to clear statistics counters over the Command Channel. Reloading a view resets all statistics
counters for both the view and all of its zones to zero.
To read and clear a single set of counters, add reset=yes to the statistics command. The following
example will return the current values of zone example’s counters, and then set them to zero:
The registers can be cleared at either the zone or the view level, as suggested by the following com-
mands:
Nominum
94 Chapter 6: Using the Command Channel with ANS
stop
To stop ANS, use nom_tell with the stop command. On shutdown, ANS writes the entire database to
disk, compacting it as it goes. If there have been many changes, the database will be proportionately big-
ger when dumped since multiple versions of the data are kept and shutdown may be slower.
Example
ans> stop
ans> stop
info: 'ans' closed the connection
uuid
Return the UUID (universal unique identifier) of the server. Note that this is different from the per-view
server-id.
unblock-checkpoints
Unblocks any blocked checkpoints. This is not an error if checkpoints are not currently blocked. See
”block-checkpoints” on page 76 and ”checkpoint” on page 76 for more information.
update-data
Update the contents of a zone.
The specified changes are made to the zone's contents, in an atomic and persistent manner. Changes are
made as either adds or deletes, and replacement is performed by providing both deletes and adds. Delete
operations are always applied first.
Records are added using the add tag, which may contain either one record or a list of records. Each
record is a string corresponding to a single line in DNS master file format—that is, it has a name, type,
and rdata. If not explicitly specified in the record being added, a TTL must also be present.
Nominum
update-data 95
Records are deleted using the delete tag, which should contain either one element or a list of elements.
Each element is a string corresponding to a single line of extended DNS master file format, and will be
treated as if preceded by $DELETE.
A default TTL may be provided with the ttl tag—it is treated as if the records were preceded by a $TTL
statement. The TTL for any updated RRset is aligned to the lower of either the existing or the new RR’s
TTL.
When this command is used to create a zone's contents (as opposed to update the existing contents), the
database in which to store the zone can be specified with the db tag. It is an error to specify this tag
when updating zones that already have content. If no database is specified when creating a zone's con-
tents, the “master” database is used.
If the ignore-serial tag is present and true, changes to the SOA serial number are ignored. This is use-
ful when merging changes made against an earlier version of the zone, and prevents the serial number
from going backwards. After successful completion, the zone's serial number will be one greater than it
was before the update.
Example
When using nom_tell to issue an update-data command, the interactive mode is preferred (see Table
6-1, “nom_tell command-line options” on page 70 for more information). An update-data command
can be run from a normal nom_tell non-interactive session, but many characters (quotes, parentheses)
will require escaping.
Response:
{
type => 'update-data'
}
Other examples of update-data commands that show various actions. The response for each of these
will match that shown in Figure 6-15.
Nominum
96 Chapter 6: Using the Command Channel with ANS
update-server
Updates the server’s global configuration.
The specified global options are set to the values given. If the delete tag is present, then it should give
the name (or a list of names) of options to delete from the configuration. See Table 5-2 on page 36, ”ANS
Server Options” for the list of options supported in an update-server command.
NOTE The response section of nom_tell requests that shows whether the server restarted itself
contains a restart tag with a value of 1.
To import more than one view and update the view order, the command would be:
update-view
Update a view’s configuration.
The specified options in the view are set to the values given. If the delete tag is present, then it should
give the name, or a list of names, of options (from the list in Table 5-4, “Zone options” on page 47) to
delete from the view’s configuration.
If the command is successful, the changes are persistent, even across server restarts. Views imported via
the global option import-view or created with ans_import (or imported implicitly, in the case of the
default view), may be updated. If not specified, the view defaults to default.
See Table 5-3, “ANS View Options” on page 41 for values that can be used for [view_option].
Nominum
update-view 97
For example, update the view internal. First, show the view, then update it to change the trans-
fers-in value.
If you now show the internal view you just updated, you will see the new value for the trans-
fers-in option (shown in bold type for convenience).
Nominum
98 Chapter 6: Using the Command Channel with ANS
To update the logging switches set on a view, use the log view option.
or
Nominum
update-zone 99
The following example shows adding the log option zone/loaded via update-view and then showing
that it is set with the show-view command. See Appendix C, ”Logging Switches” for a list of logging set-
tings.
update-zone
This command updates a zone’s configuration.
The specified options in the zone are set to the values given. If the delete tag is present, then it should
give the name, or a list of names, of options to delete from the zone’s configuration. If the command is
successful, the changes are persistent, even across server restarts. If not specified, the view defaults to
default. If the zone configuration doesn’t exist, it will be created. The update-view command and the
update-zone command will accept differential updates where one can use a plus sign (+) to specify an
addition to a list or a minus sign (-) to indicate the subtraction of an item from a list.
ANS will return “unknown view” if the view you specify (either explicitly or implicitly) does not exist;
“unknown zone” will be returned if the view exists, but the zone does not.
Nominum
100 Chapter 6: Using the Command Channel with ANS
See ”Zone Options” on page 46, for a list of possible zone options.
Example
ans> update-zone zone=internal.com view=internal \
delete=(allow-update) also-notify=(11.3.4.4 10.1.2.3) \
masters+=10.0.0.1
version
Return version information about the server.
ans> version
response:
{
type => 'version'
vendor => 'Nominum'
product => 'ANS'
platform => 'rhel-4-i386'
version => '2.8.3.0'
}
Nominum
7
The ANS Utilities
This chapter describes the utility programs provided with ANS. Using these utilities, you can:
• Load, import and dump ANS data—See ”ans_load” on page 104, “ans_import” on page 110,
and “ans_dump” on page 113.
• List or delete zones or views—See ”ans_listzones” on page 115, “ans_delete” on page 116 and
“ans_listviews” on page 116.
• List the versions of a zone in the ANS database—See ”ans_versions” on page 123.
This chapter also briefly explains how to execute these utilities from a machine that is remote from the
one on which ANS is running.
Nominum 101
102 Chapter 7: The ANS Utilities
# ans_listzones
to retrieve zone names from the master database. See Chapter 6, "Using the Command Channel with
ANS", for more information on setting up the channel.conf file with the name of a service.
Syntax
There are two ways to specify the database to use, “ordinary” and “URL” syntax.
Programs that require multiple inputs only support URL syntax—programs that only require a single input
support both syntaxes.
Ordinary Syntax
In “ordinary” syntax, the database driver defaults to cc, and can be overridden with the -d option. The
view name defaults to default, and can be overridden with the -v option. The zone name is specified
as the first non-optional argument, and any driver arguments are specified at the end of the non-optional
arguments.
Some programs, such as ans_load, may have other positional arguments between the zone name and
driver arguments, and some programs may also allow a zone revision to be specified with the -r option.
For example, to load the zone file “zone.example” into view “default” of the running ANS server,
# ans_load zone.example
To dump the contents of revision 10 of zone “example” in view “external” from the offline VDB database
“ans-master”.
URL Syntax
In “URL” syntax, the database (and optional view, zone, and zone revision) are specified in a form
similar to a URL, which is the first non-optional command line argument. The first component of the URL
Nominum
Syntax 103
is the driver name, which must be followed by a colon, and may be followed by a list of comma-delimited
driver arguments.
If the URL is not specifying the entire database, the driver specification is followed with a double slash and
the view name. If not specifying the entire view, the view is followed with a single slash and then the
zone name. The zone name may optionally be followed with @revision.
Depending on the program, only some of these forms may be allowed. For example, ans_load would
require the view name and zone name to be present, and disallow a zone revision, while with ans_copy,
the view and zone can be omitted.
For example, to copy the entire database (all views and zones) from the running ANS server to a VDB
database called “backup”:
To run the ans_diff command on the zone “example” in the default view of the running ANS server with
revision 1 of zone “example” in view “external” in VDB database “backup” (note that an empty view
name is equivalent to the default view):
When using URL syntax in a program that supports ordinary syntax as well, do not specify any of the
--driver, --view, or --revision command line options, or URL syntax will be disabled.
Versions
Database versions, either in ordinary or URL syntax, may be specified using several formats. If no version is
explicitly specified, the current version is used.
Syntax Description
num, version=num An absolute version. The version is a 64-bit number that increments
by one each time a change is made.
-num, version=-num A relative version. -1 indicates the current version, -2 the previous ver-
sion, -3 the next previous version, and so forth.
serial=num An SOA serial number. As an SOA serial number may be reused, this
argument is defined to match the most recent version with the given
serial.
Nominum
104 Chapter 7: The ANS Utilities
Element Description
driver The name of a backend driver for Nominum ANS. Currently, the valid drivers
are vdb and cc.
It is possible to use defaults for most values. The defaults can be overridden using command line options.
For example, here is an ans_load command that loads the zone example from the master file exam-
ple.db into the default view on the running server.
• If no driver arguments have been supplied and the cc driver is being used, master is used as
the driver argument.
ans_load
The ans_load command loads a zone stored in DNS master file format into a Nominum ANS database.
Nominum
ans_load 105
Most values have defaults, which can be overridden using command line options. The following com-
mand loads zone example from the file example.db into the default view on the running server.
If no driver is specified, the cc driver will be used. For example, the cc driver argument can be used to
add a zone to an instance of ANS that was not in the standard location. If you had an /etc/channel.conf
entry for a second instance of ANS as ans2 and you wanted to load a zone called test from the directory
config into a database called master, the command could be:
If no view is specified, the view will be default. If no zone filename is specified, then the zone will be
read from standard input. Reading from standard input may also be indicated by using “-” for zone-
file.
Option Description
-c | --check Check the zone for correctness, but do not load it.
--directory directory Use the specified directory as the working directory
for relative pathnames in any $INCLUDE state-
ments. If not specified, the default is to use the
working directory that was in effect when
ans_load was invoked.
Nominum
106 Chapter 7: The ANS Utilities
Option Description
-F | --fragment If --fragment is specified, then ans_load will
allow the loaded content to be a “zone fragment”.
A “zone fragment” is a zone missing records (for
example, NS and SOA at the origin) that are
required for normal operation. Without this option,
ans_load will emit an error and refuse to load the
zone.
Nominum
ans_load 107
Option Description
--ignore-serial Ignore changes to the SOA serial number when
doing incremental updates to the zone. This is use-
ful when merging changes that were made against
an earlier version of the zone, and prevents the
serial number from going backwards. After success-
ful completion, the zone’s serial number will be one
greater than it was before the load.
Nominum
108 Chapter 7: The ANS Utilities
Option Description
-u | --update Update an existing zone instead of replacing it.
Update mode enables the same kind of changes
that can be made with the DNS Dynamic Update
protocol, but using the familiar master file format
and without transaction size limitations. See
”Updating”.
-v | --view viewname Load into the specified ANS view. If no view is spec-
ified via this option, then the default view,
default, will be used.
--version Display the version of the program and exit.
Forcing
ans_load normally marks any existing zone content as old if the zone already exists, but it does not delete
it immediately. This is important when dealing with larger zones, because it allows the server to keep serv-
ing the existing content while new content is being loaded. The entire load is an atomic transaction, and
none of the newly loaded content will be visible in the DNS until all the data is loaded. The old data will
be reclaimed at a later time by a periodic maintenance process. When the --force option is used, the
loader immediately destroys any prior zone content.
NOTE If the --force option is used on a database being used by the nameserver, the server is
unable to answer authoritatively until the load completes. Therefore, Nominum recom-
mends that --force be used only on offline databases.
Merging
If a merge operation makes any changes to the zone's content, but does not change the serial number,
the serial number will automatically be incremented when the transaction is committed. However, this
will not happen if the serial number changes or the merge has no effect.
Updating
Update mode enables the same kind of changes that can be made with the DNS Dynamic Update proto-
col, but using the familiar master file format and without transaction size limitations. (An atomic DNS
dynamic update is limited to the maximum DNS message size of 65535 bytes. There is no limit to the size
of an atomic update made via ans_load.)
Nominum
ans_load 109
The syntax of an update is the standard master file syntax, augmented by the $DELETE and
$UNGENERATE directives. All the other master file directives (for instance, $GENERATE, $TTL, $INCLUDE,
and $ORIGIN) remain available.
When a Resource Record is read from an update file, the RRdata is merged into the existing contents (if
any) of the RRset with the specified owner name. For example, assume the database has an RR entry of:
example A 10.0.0.1
example A 10.0.0.2
example A 10.0.0.3
and that this file is submitted to ANS via ans_load in update mode. After the update, the A RRset at node
example is:
example A 10.0.0.1
example A 10.0.0.2
example A 10.0.0.3
The ans_load command can upload comments if they are present. If you have a comment in your record,
it must appear on the same line as the RR to which it applies. ANS will not preserve comments on lines by
themselves or comments which span multiple lines.
$DELETE
Specifying a TTL in a $DELETE directive is permitted, but has no effect. If a class is specified, it must
match the class of the zone. $DELETE can be used to delete an individual RR, all the RRs of a given type,
or all of the RRs with the specified owner name.
For example:
Update operations are applied in the order they occur in the master file. To replace an RRset instead of
merging new data into it, simply execute a $DELETE of the type before the replacement data.
example A 10.0.0.1
Nominum
110 Chapter 7: The ANS Utilities
$DELETE example A
example A 10.0.0.2
example A 10.0.0.3
and is read into ANS via ans_load in update mode. After the update, the A RRset at node “example” is:
example A 10.0.0.2
example A 10.0.0.3
Zone changes made via update mode create change entries in the database which allow ANS to give
slave servers an incremental zone transfer (IXFR) instead of requiring a full zone transfer (AXFR).
It is not necessary to explicitly update the SOA serial number when using update mode. The server will
automatically increment the serial number when the transaction is committed if it has not already been
changed by the transaction.
$UNGENERATE
A $GENERATE statement in a DNS master zone file facilitates bulk creation of RRs. ANS is unique in sup-
porting an $UNGENERATE statement. $UNGENERATE is permitted in master files when they are loaded in
--update mode. The effect is to delete the same RRs that the corresponding $GENERATE would create.
For example, the following statement in a master zone file, when read inans_load --update mode,
would delete the indicated records.
ans_import
The ans_import command imports BIND 8 or BIND 9 configuration data, including views, zones and
zone configuration information, and converts that data to the format used by ANS.
config is a BIND 8 or 9 configuration file, typically named.conf. Zone configuration information about
master and slave zones is taken from that file and converted into the ANS zone configuration format.
Master zones specified in the BIND configuration are loaded into an ANS database called master.
Nominum
ans_import 111
WARNING! ans_import must only be used when the server (or any BIND server from which
data will be imported) is not running.
You should “cd” to the directory you want ANS to run in before running ans_import.
One view configuration file is generated per view listed in the BIND configuration. The names of the files
will be of the form viewname.zc, where viewname is the name of the view. If no view is specified in the
BIND configuration, default is used as the view name.
The importer will also generate an ans.conf file and it may also generate master.db if one does not
already exist.
NOTE You must run the ans_import program from the directory where the databases are
stored. A typical location is the default ANS working directory, /var/nom/ans.
A BIND configuration can be re-imported into a directory where ans_import had been previously exe-
cuted. The import will compute the difference between the old and new configurations, and then exe-
cute zone loads or deletes only for the changed zones. Saved server state (such as zone maintenance info,
slave zone contents) is preserved for unchanged zones. See Chapter D, "Examples of Server and View
Operations", for examples of importing a BIND configuration.
Option Description
-c | --configuration Write the configuration to the specified file instead of the default
file configuration file, /etc/ans.conf.
-d, --driver drivername Use the specified ANS database drivername. The default is vdb for
new imports, and the driver used previously when re-importing. The cc
driver may not be used.
-k | --keep-going If a load or delete fails, skip the failing zone and continue loading,
instead of stopping the import immediately.
-m | --merge Enable merge mode. By default, the view zone configuration files are
replaced with content generated from the named configuration file. In
this mode, however, the view zone configuration files are merged
instead of replaced. This mode may be used to merge content from
several named configuration files into one ANS zone configuration set.
Nominum
112 Chapter 7: The ANS Utilities
Option Description
-p | --progress At every 5000 zones, print a +/- for each 100 zones loaded/deleted,
and the count so far.
-r | --root directory Simulate a chroot() to the specified directory when processing all BIND
pathnames. This option is used when importing a named.conf that was
run chrooted. Note that “all BIND pathnames” specifically includes the
pathname of the named.conf that is specified in the ans_import invo-
cation.
--version Display the version of the program and exit.
The importer converts only those portions of the BIND configuration that correspond to ANS configura-
tion parameters. BIND items which are not relevant or otherwise not supported by ANS are silently
ignored.
• notify-source
• notify-source-v6
• transfer-source
• transfer-source-v6
• listen-on
• masters
• notify
• also-notify
• allow-transfer
Nominum
ans_dump 113
• allow-update
• allow-update-forwarding
• update-policy
Zone content—the DNS data for the zone—is imported for master zones, and therefore the zone files
must be readable. The BIND directory option is used to determine the directory in which the zone files
are found. ANS will transfer any slave zones when it runs. In the case of a re-import, only changed slave
zones are imported.
ans_dump
The ans_dump command dumps a zone stored in an ANS database to DNS master file format.
Most values have defaults, which can be overridden using command line options. The following com-
mand dumps zone example from the default view on the running server.
# ans_dump example
If no driver is specified, the cc driver will be used. If no view is specified, the view will be default. If no
driver arguments have been supplied and the cc driver is being used, master will be used as the driver
argument.
For example, to dump the contents of revision 10 of zone example in view external from the offline
VDB database ans-master.
Nominum
114 Chapter 7: The ANS Utilities
Option Description
-a | --absolute Enable absolute names mode. Normally ans_dump “relativizes” all
domain names that are subdomains of the zone’s origin. For example, if
the zone is test.example. then node a.text.example. will be relativ-
ized to a.
When absolute mode is enabled, domain names are not relativized to the
zone’s origin.
-d | --driver driver- Use the specified ANS database drivername. If no driver is specified via
name this option, then the default driver, cc, will be used.
--list-attributes Prints the zone attributes as the first line of the output, formatted as a
master file comment, with the attributes as a comma-separated list.
--no-comments Do not emit comments. Normally, ans_dump outputs comments
attached to rdata when they are stored in the ANS database. This option
disables comment printing.
-o | --output filename The output filename. If not specified, the zone will be dumped to stan-
dard output.
-p | --pretty Generate “prettier” output. Normally ans_dump outputs each RR fully
specified (that is, containing the name, TTL, class, type, and rdata).
When pretty mode is enabled, ans_dump will use name defaulting, tabs,
and $TTL to produce more elegant output.
-r | --revision revi- Use the specified revision of the zone, which can be specified by
sion absolute or relative ANS version or SOA serial number. See ”Revisions” on
page 115 for more information.
-v | --view viewname Use the specified ANS view. If no view is specified via this option, then
the default view, default, will be used.
--version Display the version of the program and exit.
Nominum
ans_listzones 115
Revisions
The database revision, either in ordinary or URL syntax, may be specified in several formats. If no revision
is specified, the current version is used.
Option Description
num, version=num An absolute ANS version. The ANS version is a 64 bit number that incre-
ments by one each time a change is made.
-num, version=-num An relative ANS version. -1 indicates the current version, -2 the previ-
ous, and so on.
serial=num An SOA serial number. As an SOA serial number may be reused, this is
format defined as matching the most recent version with this serial num-
ber.
ans_listzones
The ans_listzones command lists the zones in a view in an ANS database.
Most values have defaults which can be overridden using command line options. The following command
lists the zones in the default view on the running server.
# ans_listzones
If no driver is specified, the cc driver will be used. If no view is specified, the view will be default. If no
driver arguments have been supplied and the cc driver is being used, master will be used as the driver
argument.
Option Description
-d | --driver Use the specified ANS database driver. If no driver is specified via this
drivername option, then the default driver, cc, will be used.
-v | --view viewname Use the specified ANS view. If no view is specified via this option, then the
default view, default, will be used.
--version Display the version of the program and exit.
Nominum
116 Chapter 7: The ANS Utilities
ans_listviews
The ans_listviews command lists the views in an ANS database.
Most values have defaults, which can be overridden using command line options. The following com-
mand lists the views on the running server. This command will not display views listed in the configuration
file if they have no zones.
# ans_listviews
If no driver is specified, the cc driver will be used. If no driver arguments have been supplied and the cc
driver is being used, master will be used as the driver argument.
Option Description
-d|--driver Use the specified ANS database driver. If no driver is specified via this
drivername option, then the default driver, cc, will be used.
--version Display the version of the program and exit.
ans_delete
The ans_delete command deletes the contents of a zone stored in an ANS database.
Most values have defaults, which can be overridden using command line options. The following com-
mand deletes zone example from the default view on the running server.
# ans_delete example
Nominum
ans_loadzoneconf 117
If no driver is specified, the cc driver will be used. If no view is specified, the view will be default. If no
driver arguments have been supplied and the cc driver is being used, master will be used as the driver
argument.
Option Description
-d | --driver driver- Use the specified ANS database driver. If no driver is specified via this
name option, then the default driver, cc, will be used.
-f | --force Normally ans_delete prints an error message and exits with non-zero
status if the zone does not exist in the database. When the --force
option is present, trying to delete a nonexistent zone does not cause an
error and the program will exit with a zero status.
-v | --view viewname Use the specified ANS view. If no view is specified via this option, then
the default view, default, will be used.
--version Display the version of the program and exit.
ans_loadzoneconf
The ans_loadzoneconf command converts a text-formatted ANS zone configuration such as those pro-
duced by ans_dumpzoneconf (see ”ans_dumpzoneconf” on page 118) into an ANS zone configuration
file for use with ANS.
input_text_filename may be “-”, in which case the text zone configuration is read from standard
input.
Option Description
-u | --update Updates the contents of the zone configuration file with the specified file
instead of replacing.
--version Display the version of the program and exit.
Nominum
118 Chapter 7: The ANS Utilities
ans_dumpzoneconf
The ans_dumpzoneconf command converts an ANS zone configuration file into text:
output_text_filename may be omitted, or may be specified as “-”. In both cases, the text zone con-
figuration is sent to standard output.
Option Description
--version Display the version of the program and exit.
ans_copy
The ans_copy command copies zones and/or views between ANS databases.
Nominum
ans_copy 119
source and target take URL syntax (see ”Syntax” on page 102) where the view and zone are optional.
A zone revision may be specified for the source, but not the target, and, if so, only that version will be
copied.
Option Description
-m, --max-versions Normally when copying a zone, ans_copy copies all existing ver-
versions sions of that zone. This uses more space, but retains the ability to
do IXFRs involving extant prior versions of the zone using the target
database. If --max-versions is specified, the number of versions
per zone copied can be limited.
-s | --shallow Normally when copying a zone, ans_copy copies all existing ver-
sions of that zone. This uses more space, but retains the ability to
do IXFRs involving extant prior versions of the zone using the target
database. If -s or --shallow is specified, then only the most
recent version will be copied.
Examples
For example, to copy all views from the VDB database “customers” to the VDB database “customers-old”:
To copy the view “default” from the VDB database “master” to the VDB database “master-backup”:
Note that the default database is master, and that if the target view name is the same as the source, it
need not be repeated.
To copy the “internal” view zone “example” to the view “internal1” in the VDB database “master”:
Nominum
120 Chapter 7: The ANS Utilities
ans_diff
The ans_diff command determines differences between two zones or two versions of a zone, producing
an output file suitable for ans_load -u.
Most values have defaults, which can be overridden using command line options. If no driver is specified,
the “cc” driver will be used. If no view is specified, the view will be default.
The zone and zone2 parameters may use URL syntax (see ”Syntax” on page 102) where the view and
zone are required, and the zone revision is optional. In this mode, two zones must be specified.
Option Description
-a | --absolute Enable absolute names mode.
Nominum
ans_diff 121
Option Description
--no-comments Do not emit comments.
Unlike most other ANS utilities, this option may specify two revisions
to compare, separated by a colon.
Examples
For example, to diff the zone called “example” in the “internal” view from the VDB “master“ database’s
“example” zone in the “external” view:
To diff the “default” view’s “example” zone from a running server with the master file “example.db”:
# ans_diff cc://default/example \
file:file=example.db//default/example
Additionally, multiple versions of a single zone may be compared if URL syntax is not used. For example,
to diff versions 10 and 11 of the “internal” view’s “example” zone in a running server:
To diff the current version of the “default” view’s “example” zone against the version with serial number
1000 in a running server:
Nominum
122 Chapter 7: The ANS Utilities
ans_edit
The ans_edit command edits a zone in an ANS database.
ans_edit invokes the user’s preferred editor on a zone stored in an ANS database. When editing is com-
plete, ans_edit loads the updated zone into the database.
The changes are merged back into the database with RRset granularity. In particular, this means that
ans_edit can be used to edit a zone which is “live” on the nameserver and being updated with DNS
Dynamic Update. (DDNS)
If no driver is specified, the cc driver will be used. If no view is specified, the view will be default. If no
driver arguments have been supplied and the cc driver is being used, master will be used as the driver
argument.
Option Description
-d, --driver driver- Use the specified ANS database driver. If no driver is specified via this
name option, then the default driver, cc, will be used.
-v, --view viewname Use the specified ANS view. If no view is specified via this option, then the
default view, default, will be used.
--version Display the version of the program and exit.
To determine which editor to invoke, ans_edit looks for the following environment variables, in the listed
order:
• ANS_EDITOR
• VISUAL
• EDITOR
Nominum
ans_versions 123
ans_versions
The ans_versions command lists the versions of a zone in an ANS database.
By default, creation times are printed in local time, and versions are printed from oldest to newest.
If the zone has no SOA record (which may be the case if it is a zone template or uses a zone template),
the serial number will be printed as a single dash.
If the creation time of a version cannot be determined, both date and time will be printed as a single
dash.
If no driver is specified, the cc driver will be used. If no view is specified, the view will be default. If no
driver arguments have been supplied and the cc driver is being used, master will be used as the driver
argument.
Option Description
-c, --count Print a simple count of the number of versions in the database instead of
information about all versions of a zone.
--current Print information only about the current version of a zone instead of all
versions of the zone.
-d, --driver Use the specified ANS database driver. If no driver is specified via this
drivername option, then the default driver, cc, will be used.
-q, --quiet Omits the column headers in the displayed output.
-r, --reverse Print zones starting with the newest zone instead of the oldest zone.
Nominum
124 Chapter 7: The ANS Utilities
Option Description
-u, --utc Prints times in UTC rather than local time.
-v, --view viewname Use the specified ANS view. If no view is specified via this option, then the
default view, default, will be used.
--version Display the version of the program and exit.
• The machine with the “target” ANS server is called target. The machine from which com-
mands will be issued is called controller.
• The two machines are connected by a network that permits traffic to pass on an ANS com-
mand-channel port, 9353 by default. This port is normally defined with an ans service entry in
/etc/channel.conf.
Take the following steps to execute ans_* commands from a “remote” machine:
2. Configure ANS on target to listen on a Command Channel port exposed to network traffic.
This is necessary because ANS listens by default only on 127.0.0.1.
3. Restart ANS.
4. Copy the new ans service entry from /etc/channel.conf on target to a file named
~/.nom/channel.conf on controller, where ~ represent’s the user’s home directory.
Nominum
Executing ans_* Commands From A Remote Machine 125
5. Confirm that an ANS instance including the ans_* commands is installed on controller.
For example:
where example.com is a zone, and example.com.db is a zone file in master file format, on
controller.
Nominum
126 Chapter 7: The ANS Utilities
Nominum
8
Examples of Zone
Operations
This chapter presents examples of common operational tasks that an ANS administrator may encounter.
These scenarios provide examples of various methods of communicating with ANS. This chapter high-
lights operations that pertain to zone management. See Chapter D, Examples of Server and View Opera-
tions, for examples of operations that pertain to server and view management.
Adding Zones
Add a Master Zone
To add a master zone, first create the zone:
Nominum 127
128 Chapter 8: Examples of Zone Operations
Then add an SOA Resource Record (RR) and an NS RR. The SOA and NS records must exist before you can
add other RRs to a zone.
Finally, you can add additional data. In this example, we add a node called www with the address
10.3.4.5 (shown in its A record).
If we now show the data for this zone, we see the updates we’ve done.
# ans
{
type => 'show-data'
view => 'default'
zone => 'test.com.'
node => '@'
data => ('@ 3600 IN SOA test.com admin 2006053101 600 120 3600000
300' '@ 3600 IN NS ns')
}
{
view => 'default'
zone => 'test.com.'
node => 'www'
data => ('www 3600 IN A 10.3.4.5')
}
Because you provide the address of a master server via the masters field, ANS adds this zone into its
slave database.
ANS will log that it does not have the zone, that it will have to perform a zone transfer, and the actual
transfer itself:
Nominum
Deleting a Zone 129
The first log entry records the command that was issued, and the user id that issued it. The
maintenance entries are informational messages about the progress the server is making slaving the
zone.
It’s important to note that the success of this command means only that the server agreed to slave the
zone. If there is a network problem or the master is down, ANS might not be able to transfer the zone
immediately. If this occurs, ANS continues to try, and reports its progress in the log.
The slave-db zone option can be used when adding a slave zone to specify a slave database different
than the default.
For example, the following command would store the big.example. zone in the database called big.
Note that the database must have been previously created with a db statement in the ans.conf file, and it
must have been previously imported into the view to which the slave zone is being added.
To make the zone c-example.net a master zone rather than a slave zone, use the following command:
Deleting a Zone
To completely delete a zone, use nom_tell to send a delete-zone command:
Nominum
130 Chapter 8: Examples of Zone Operations
Purging Zones
The server retains data from prior versions of zones so that it can respond to IXFR requests. When peri-
odic zone purging runs, prior version data older than a set number of seconds is deleted. Purging can also
be done manually, using the purge-zone command channel message.
zone-purge-age
zone-purge-interval
zone-purge-max-versions
zone-purge-age
zone-purge-interval
The following option must be used as a stand-alone command, and must not be used with other zone
purge options:
zone-purge-max-versions
This means if you specify the zone-purge-age and zone-purge-interval options, you must not
specify the zone-purge-max-versions option (or set the value to 0), and vice versa.
The following are some example scenarios where these options can be useful.
• Specify a value for the zone-purge-max-versions option to enable the server to check for
old versions each time an update is done, and to purge if necessary.
Updating Zones
Several aspects of zone configuration can be updated, of course. This section shows a few examples that
hightlight the use of the update-zone Command Channel command. The next section shows an example
of updating a zone via the ans_load command used with the --update option.
Nominum
Updating Zones 131
NOTE For information on next-task and its values, see ”show-maintenance” on page 82.
Because example.org is a slave zone, ANS also includes information about the zone maintenance state of
the zone. The status field is particularly useful. For example, the message:
indicates that the zone is up-to-date. If there were problems transferring the zone, the status would
be different. For example, if you configured an incorrect master by mistake, you would see:
It’s important to note that show-zone only shows you fields which have been explicitly configured by the
administrator. If you do a show-zone for zone example, you can see that it has the default configuration:
It’s not an error to specify configuration information for a master zone you have not yet loaded. This lets
you set up the zone the way you’d like, and when you’re ready you can then use ans_load to load the
DNS data and have ANS start serving it.
If you don’t specify a zone when you issue a show-zone command, the server will return information for
all zones in the default view.
Nominum
132 Chapter 8: Examples of Zone Operations
The result of the last command is evident when you show the zone.
You can specify as many options as you like with a single update-zone command. Zone options are listed
in Table 5-4, “Zone options,” on page 47.
Fields whose values are lists, such as the masters field, can be updated differentially. For example, to
add master 10.2.0.131, you can say:
Nominum
Updating Zones 133
Finally, you can delete fields by listing them as the values of the special delete field:
“Update” mode:
• Enables the same kind of changes that can be made with the DNS Dynamic (DDNS) Update
protocol.
• Removes transaction size limitations. (Ordinarily, using anything other than ans_load, an
atomic DNS dynamic update is limited to the maximum DNS message size of 65535 bytes.)
Nominum
134 Chapter 8: Examples of Zone Operations
The syntax of an update is the standard master file syntax, augmented by the $DELETE directive.
$DELETE can be used to delete:
• A specific RR.
• All the RRs at a name (which also results in the removal of the name).
When an RR is read from the master file in update mode, it is merged into the existing contents (if any) of
the RRset with the specified owner name.
Command Description
$DELETE example A 10.0.0.1 Delete the A RR 10.0.0.1 at example.
$DELETE example A Delete all A RRs at example.
$DELETE example Delete all RRs at example.
$TTL 3600
host1 A 10.2.0.1
$DELETE host2 A 10.2.0.2
$DELETE host2 MX
$DELETE host3
$DELETE host4 A
host4 A 10.4.0.4
This update adds the A RR 10.2.0.1 to host1, deletes the 10.2.0.2 A RR from host2, deletes all MX
records from host2, deletes all host3 entries, and replaces host4’s A RRset with a new set containing
the A RR 10.4.0.4.
The results:
# ans_dump example
@ 3600 IN NS ns1
Nominum
Updating Zone Policies 135
@ 3600 IN NS ns2
@ 3600 IN SOA ns1 hostmaster 101 3600 1800 604800 3600
host1 3600 IN A 10.1.0.1
host1 3600 IN A 10.2.0.1
host2 3600 IN A 10.1.0.2
host4 3600 IN A 10.4.0.4
host4 3600 IN MX 0 mail1
host4 3600 IN MX 10 mail2
mail1 3600 IN A 10.0.0.3
mail2 3600 IN A 10.0.0.4
ns1 3600 IN A 10.0.0.1
ns2 3600 IN A 10.0.0.2
NOTE ANS increments the zone’s serial number for all changes, even if the user
type => 'show-zone'
identity—the name of the TSIG key that a client will use to authenticate itself with the server.
To set an update policy that allows any client identifying itself with the TSIG key lab. to update A records
for any host in the domain a-example.com, use the following command:
Nominum
136 Chapter 8: Examples of Zone Operations
This command maps to the arguments of the update-policy zone option in this way:
Check the output from show-zone to see if the A record has been added.
Use update-zone with the allow-update zone option. With this option, use grant and then an IP
address followed by a subnet mask, in a notation similar to Classless Inter-Domain Routing (CIDR). 32 bits
set in the subnet mask refers to the actual IP address you specified.
Nominum
Updating Zone Policies 137
Nominum
138 Chapter 8: Examples of Zone Operations
Nominum
9
SNMP in ANS
Simple Network Monitoring Protocol (SNMP) is the primary protocol used by network management soft-
ware to monitor and control networked systems and devices.
SNMP-aware software can be used to monitor and manage Nominum products such as ANS engines.
Nominum assumes that this chapter will be used in conjunction with the documentation for Net-SNMP,
available at http://www.net-snmp.org/.
Managers
A management application (or “manager”) is any one of an array of SNMP-aware tools used for monitor-
ing and managing the status of networked systems, issuing requests for management operations and
perhaps also receiving unsolicited alerts (“notifications” or “traps”) from agents.
Agents
An agent is “go-between” software running on a managed system. Agents can be “master agents”
and/or “subagents”. A master agent communicates directly with the manager; a subagent handles spe-
cialized communication for each type of managed system. Every managed system requires its own sub-
agent. Messages can travel in either direction: managers can query agents for information, and agents
can also supply unsolicited information to managers.
MIBs
For each type of managed system, the relevant details are defined in a set of hierarchical tables called
Management Information Bases (MIBs). MIBs are defined using a common interface language; they spec-
ify the information exchanged between agents and managers. MIBs are discussed in detail in RFC 1155.
Traps (Notifications)
SNMP subagents can be configured to generate alarms when specified events occur in the managed sys-
tems. These alerts are referred to as SNMP “traps”. In SNMP version 2 and greater, traps are properly
called “notifications”.
To set up a notification, you will have to specify a master agent destination, or “trap sink”, in your agent’s
configuration file.
So, to summarize: SNMP-aware network managers send requests via agent software; specialized sub-
agents read and write data in each managed system’s set of MIBs, and can also convey unsolicited alerts
(traps) for master agents to relay back to the network manager.
nom_snmpagent is built on top of Net-SNMP and links to Net-SNMP’s agent library. Net-SNMP is included
with the operating systems supported by Nominum products. Nominum assumes that this chapter will be
used in conjunction with the documentation for Net-SNMP, available at http://www.net-snmp.org/.
Nominum ANS
nom_snmpagent 141
• nom_snmpagent can work as a subagent to master agents other than snmpd as long as they
use the AgentX protocol for communication with subagents.
• If necessary, nom_snmpagent can coexist as a master agent with a third-party master agent
running on the same host computer. To do this, you’ll have to configure one of the two master
agents to use a non-standard port, and also configure your management application accord-
ingly to send SNMP traffic to the correct port.
The nom_snmpagent package installs MIBs specific to Nominum products, along with associated docu-
mentation. For details, see “Nominum-specific MIBs” on page 143.
nom_snmpagent
The Nominum SNMP Agent (nom_snmpagent) provides SNMP notifications that correspond to events
sent by Nominum engines, and SNMP GET access to engine statistics.
Synopsis
nom_snmpagent [ -c file ] [ -f ] [ -F ] [ -h|--help ]
[ -m|--masteragent ] [ -r|--root directory ]
[ -s|--syslog-facility facility ] [ -u|--user username ]
[ --usage ] [ -v|--version ]
Options
Option Description
-c | --configuration file Reads configuration information from the specified file
instead of the default configuration file
(/etc/nom_snmpagent.conf).
Nominum ANS
142 Chapter 9: SNMP in ANS
Option Description
-F | --foreground-with-syslog Prevents the agent from daemonizing, and sends output to
both stderr and syslog.
-h | --help Displays a help message and exits.
-m | --masteragent Starts the agent as an SNMP master agent.
-r | --root directory chroot()s to the specified directory when the agents runs.
To fully provide the necessary protection, a non-root user
must also be specified with the --user option.
-s|--syslog-facility When logging to syslog, use the specified syslog facility
instead of the default facility, daemon.
-u | --user username Executes a setuid() to the specified username. If using this
option, make sure that whatever user is indicated is able to
write to the directory from which nom_snmpagent is run.
--usage Displays usage information and exits.
-v | --version Displays the agent version and exits.
Configuration Files
nom_snmpagent can run as either an SNMP master agent or as an SNMP subagent. By default it runs as
a subagent.
In a simple, fresh installation with Net-SNMP’s snmpd functioning as a master agent, nom_snmpagent
can run as a subagent without further configuration. If your environment is more complex — for
instance, if you are running nom_snmpagent as a master agent or adding it to an existing NetSNMP
installation that has already been customized — more configuration will be involved.
These options are described in this manual, in “The nom_snmpagent Configuration File” on
page 146 and “Using the Command Channel with nom_snmpagent” on page 150.
Nominum ANS
Nominum-specific MIBs 143
Nominum-specific MIBs
The nom_snmpagent package installs MIBs specific to Nominum products, along with their associated
documentation. The documentation is in /usr/local/nom/doc/snmpagent, and the MIBs themselves are in
/usr/local/nom/share/snmp/mibs.
Nominum ANS
144 Chapter 9: SNMP in ANS
• NOMINUM-TC-MIB—Defines a set of textual conventions that concisely convey the syntax and
semantics of MIB objects as defined in Nominum enterprise MIB modules.
If you anticipate a large number of updates, consider disabling the update/success event in the inter-
ests of performance: the corresponding SNMP notification is nnsnZoneEventUpdateSuccess.
Running as a Subagent
By default, nom_snmpagent runs as a subagent, typically in conjunction with NetSNMP’s master agent,
snmpd. In the simplest instance, this may not require any configuration at all.
If your environment is more complex — for instance, if you are running a master agent other than
Net-SNMP’s snmpd, or if you are extending an existing NetSNMP installation that has already been cus-
tomized — more configuration may be involved. Nominum assumes that you are familiar with Net-SNMP
and that you have access to its documentation at http://www.net-snmp.org/.
For SNMP configuration file options, see “The nom_snmpagent Configuration File” on page 146.
Details specific to atypical installations are beyond the scope of this chapter, but the following broadly
outlines the necessary steps:
2. Ensure that the installation supports the AgentX protocol. See ”Configuration Files” on page
142.
5. Ensure that a master SNMP agent is configured and running on the same machine, and that the
SNMP agent supports the AgentX protocol.
6. Perform any Net-SNMP configuration necessary for your specific environment. For details on
configuring Net-SNMP, see the Net-SNMP documentation (available from
Nominum ANS
Using SNMP with ANS 145
http://www.net-snmp.org).
# /etc/init.d/nom_snmpagent start
8. If your installation requires it, configure your SNMP management application to interact with
the provided MIBs and the events they define.
Nominum assumes that you are familiar with Net-SNMP and that you have access to its documentation at
http://www.net-snmp.org/.
For complete SNMP configuration file options, see “The nom_snmpagent Configuration File” on
page 146.
Details are beyond the scope of this chapter, but the following broadly outlines the necessary steps:
masteragent
driver ans ans
3. Perform any Net-SNMP configuration necessary for your specific environment, adding relevant
Net-SNMP configuration data to /var/nom/snmpagent/snmpagent_master.conf. You can do
this either by hand-editing the file or by using the Net-SNMP snmpconf utility (part of the
Net-SNMP package) to do so.
Further details on configuring Net-SNMP are beyond the scope of this chapter.
Nominum ANS
146 Chapter 9: SNMP in ANS
sysservices 12
rwuser fflintstone
rwcommunity test
trap2sink localhost
master agentx
# /etc/init.d/nom_snmpagent start
5. If your installation requires it, configure your SNMP management application to interact with
the provided MIBs and the events they define.
If there are no driver directives present in the configuration file, nom_snmpagent tries to read /etc/chan-
nel.conf and monitor any currently running Nominum engines. If driver directives are present in the con-
figuration file, nom_snmpagent doesn’t search /etc/channel.conf.
NOTE If you want nom_snmpagent to scan /etc/channel.conf to discover engines, then all the
engines to be monitored must be running before nom_snmpagent starts. First start the
engines, make sure they’re running, and then start nom_snmpagent.
A nom_snmpagent configuration file is a sequence of lines. Blank lines and lines starting with the # com-
ment character are ignored. Each configuration line contains an option name, optionally followed by
whitespace and a value. If a value is present, it is set to the remaining text on the line, including any
non-leading whitespace.
command-channel
Specifies the address and port to use for Command Channel messages. If no secret is
specified, then who specifies the name of a service in /etc/channel.conf. If a secret is
specified, then who specifies an addrport (restricted to IPv4 addresses), and a port must
be specified.
If secret is anything other than “*”, only Command Channel requests signed with
secret are allowed to execute, and Command Channel responses are signed with the
Nominum ANS
The nom_snmpagent Configuration File 147
secret. If secret is specified as “*”, then Command Channel messages are neither val-
idated nor signed.
Specifying
command-channel none
NOTE This address and port setting has nothing to do with how nom_snmpagent communi-
cates with the engines it monitors. It is only relevant to interaction with the Command
Channel.
directory
directory directory
Instructs the agent to use the specified directory as the working directory of the
server. This command takes effect immediately. Only one directory statement may appear
in a configuration.
driver
Instructs the agent to load an SNMP agent driver for a given Nominum engine. The
engine-type is the type of Nominum engine specified, such as ans. It connects to the
engine corresponding to the appropriate
/etc/channel.conf entry, sends SNMP notifications when the monitored engine sends
events, and presents the engine’s statistics via SNMP.
Any remaining arguments are passed to the driver’s setup function, and multiple driver
statements may be specified.
At this time, the only valid arg is a comma-separated list of events to request from the
engine and convert into SNMP notifications. If unspecified, all events are requested.
log
Nominum ANS
148 Chapter 9: SNMP in ANS
Instructs the agent to set a logging control switch. snmpagent allows fine-grained con-
trol over what is logged.
• command/executed - Logs details about the valid Command Channel commands exe-
cuted by the agent. The default value of this switch is “no”.
• snmp/get - Logs SNMP GET requests. The default value of this switch is “no”.
• snmp/set - Logs SNMP SET requests. The default value of this switch is ”no”.
• snmp/trap - Logs SNMP traps and notifications. The default value of this switch is
“no”.
• snmp/status - Logs SNMP status changes. The default value of this switch is “no”.
• ans/event - Logs details of events received from ANS. The default value of this switch
is “no”.
yes_or_no is either
• no - Disables logging.
masteragent
masteragent
minseverity
minseverity severity
Sets the minimum severity assigned to a Nominum notification. A notification will not be
sent if it has a severity less than the specified severity. severity is specified as a number
from zero to six, as defined in the NominumPerceivedSeverity textual convention in
NOMINUM-TC-MIB.
This has no effect on clearing notifications (for example, those with a severity of
cleared(1)).
Nominum ANS
The nom_snmpagent Configuration File 149
observer-address
observer-address addrport
Instructs the agent to include the specified address and (optional) port in SNMP notifica-
tions. If not specified, no address or port is included in SNMP notifications.
setseverity
Sets the severity assigned to a Nominum notification. notification must be the name
of one of the notifications defined in NOMINUM-NSN-MIB, such as “nnsnServerEvent-
Stop”. severity is specified as a number from zero to six, as defined in the Nominum-
PerceivedSeverity textual convention in NOMINUM-TC-MIB.
This has no effect on clearing notifications (for example, those with a severity of
cleared(1)).
syslog-facility
syslog-facility facility
Instructs the agent to use the specified syslog facility instead of the default facility
(daemon).
• The agent has no trap sinks configured and hence does not need to receive most events from
the engines it is monitoring.
• The engines are generating large numbers of events, causing the SNMP agent to use CPU
cycles needlessly.
NOTE Do not enable request-minimal-events if you wish the SNMP agent to send SNMP
traps or notifications.
Nominum ANS
150 Chapter 9: SNMP in ANS
events
A comma-separated list of events to be requested from the engine and converted into
SNMP notifications. If this value is not specified, all events are requested.
For example:
request-minimal-events
request-minimal-events permits you to control the number of events you receive from the
ANS SNMP driver.
If “yes”, the driver requests only the minimal set of events needed to keep applTable
up to date. This supersedes the events configuration element.
For example:
load-driver
If the engine name is anything other than the default for the given engine,
engine-type must also be specified, and any additional arguments are passed on to
the driver.
It is also possible to use the events argument to restrict the list of events to be
requested from the engine and converted into SNMP notifications. If this value is not
specified, all events are requested.
snmpagent>load-driver name=<EngineName>\
[engine-type=ans] [events=events]
Nominum ANS
Using the Command Channel with nom_snmpagent 151
Response:
name => engine_name
[engine-type => engine_type] [events => events]
pid
snmpagent>pid
Response:
pid => pid
process-information
Response:
stop
snmpagent>stop
show-drivers
Shows the currently loaded drivers. The Command Channel result contains a list of driv-
ers, and each driver-list item contains a list of currently instantiated drivers for that driver
type.
snmpagent> show-drivers
{
type => 'show-drivers'
drivers => {
ans => ('ans')
}
}
Nominum ANS
152 Chapter 9: SNMP in ANS
uuid
snmpagent>uuid
Response:
uuid => uuid
unload-driver
snmpagent>unload-driver name
Response:
name => engine_name
version
snmpagent>version
Response:
type = > 'version'
vendor => 'Nominum'
product => 'snmpagent'
platform => 'platform'
version => 'version'
If you have installed the nom_snmpagent package, all the MIBs and driver libraries will be where both
nom_snmpagent and the Net-SNMP tools expect them to be. However, you will still have to configure
the command-line tools to use all the MIBs. You can do that by calling the tools with the -m ALL option
each time, or more neatly by adding the following line to /etc/snmp/snmp.conf:
mibs +ALL
If you built the tools yourself rather than by installing nom_snmpagent, you will also have to set the mib-
dirs environment variable by including the following line:
Nominum ANS
Using Net-SNMP Command-line Tools with nom_snmpagent 153
mibdirs +/usr/local/nom/share/snmp/mibs
It is beyond the scope of this chapter to discuss the Net-SNMP tools in detail. A few examples are pro-
vided for each of the most useful tools: snmptranslate, snmpwalk, snmpget, and snmptrapd. Please see
the Net-SNMP documentation at http://www.net-snmp.org/.
In all examples below that require a hostname, localhost is used. If nom_snmpagent is not running on
the local host, you can replace this with the hostname or IP address of the appropriate host computer.
snmptranslate
To verify that the tools can find what they need, use snmptranslate:
NETWORK-SERVICES-MIB::applTable
and
NOMINUM-NSM-MIB::nnsmViewTable
You can also display full object identifiers (OIDs), in numeric or symbolic form:
.1.3.6.1.4.1.5901.4.5.1.2.2
.iso.org.dod.internet.private.enterprises.nominum.nominum-
Mibs.nominumNsmMib.nnsmObjects.nnsmViewObjects.nnsm-
ViewTable
snmpwalk
NETWORK-SERVICES-MIB::applDirectoryName.1 = STRING:
Nominum ANS
154 Chapter 9: SNMP in ANS
NETWORK-SERVICES-MIB::applURL.1 = STRING:
This example assumes that your “community string” (SNMP password) is test, and that nom_snmpagent
is running on the localhost.
One crucial piece of information the applTable provides is a mapping from the human-readable server
name (ans in this example) to the application ID (in this case, 1). The application ID is the number after
each column name (applName.1). The application ID will appear in the indexes of all Nominum SMI
objects, and provides the only reference to which Nominum engine a given SMI object refers.
snmpwalk can dump any table in the set of MIBs that nom_snmpagent supports. This includes a large
number of standard MIBs in addition to Nominum’s MIBs.
NOMINUM-NSM-MIB::nnsmViewNameToViewID.1."default" = Gauge32:
1
NOMINUM-NSM-MIB::nnsmViewAuthLoadTime.1.1 = STRING:
27136-7-25,17:24:20.0
NOMINUM-NSM-MIB::nnsmViewAuthZonesActive.1.1 = Gauge32: 2
DNS zones
NOMINUM-NSM-MIB::nnsmViewAuthSlavesActive.1.1 = Gauge32: 0
DNS zones
snmpget
You can use snmpget to retrieve single instances. To get the zone name and zone type indexed by appli-
cation ID 2, view ID 1, and zone ID 2:
Nominum ANS
Using Net-SNMP Command-line Tools with nom_snmpagent 155
and
To get the zone name to zone ID mapping for example.com, look in the
nnsmZoneNameToZoneIdTable. This one is a bit trickier since the zone name is encoded as an index, as
the number of characters followed by the ASCII codes for each letter. In this example, the 2.1 following
nnsmZoneNameToZoneID refer to the application ID (2) and the view ID (1).
NOMINUM-NSM-MIB::nnsmZoneNameToZoneID.2.1."example.com." =
Gauge32: 2
snmptrapd
You can use snmptrapd to display traps. With some configuration, snmptrapd can also take action on
them.
To configure snmptrapd you’ll need the same security information you configured your trap sink with in
snmpagent_master.conf. To be consistent with the sample configuration file given in “Running as a Mas-
ter Agent” on page 145, for example, you would add the following to /etc/snmp/snmptrapd.conf:
Run snmptrapd in the foreground (-f) with logging redirected to stderr (-Le). Since you’ve installed
the nom_snmpagent package, your MIBS and MIBDIRS environment variable will already be where
snmptrapd expects them to be).
Here is what a typical trap looks like when displayed by snmptrapd. (This example was triggered by a Van-
tio server reload event.)
Nominum ANS
156 Chapter 9: SNMP in ANS
NOMINUM-NSN-MIB::nnsnEventPerceivedSeverity = INTEGER:\
information(0)
NOMINUM-NSN-MIB::nnsnEventDateAndTime = STRING:\
27648-1-9,17:7:51.0
NOMINUM-NSN-MIB::nnsnEventReferenceID = Gauge32: 0
NOMINUM-NSN-MIB::nnsnEventSerialNumber = Counter64: 2
Nominum ANS
10
Secret Key Transaction
Authentication (TSIG)
This chapter provides an overview of authentication in ANS. Specifically, this chapter shows how to use
both TSIG and GSS-TSIG with ANS.
DNS TSIG
RFC 2845, “Secret Key Transaction Authentication for DNS (TSIG)”, provides transaction level authentica-
tion. TSIG is an additional RR type, used to cryptographically sign a DNS packet. The standard specifies
the use of shared secrets and one-way hashing to accomplish authentication. It does not provide a distri-
bution mechanism for the shared secrets, but suggests “an out of band mechanism such as example.net.”
To remedy the lack of a key distribution mechanism for DNS TSIG, a TKEY RR was proposed in RFC 2930,
“Secret Key Establishment for DNS (TKEY RR)”. The TKEY proposed standard provides a means for the
resolver and server to agree on secret material for use with TSIG without their communication being
secret.
Nominum 157
158 Chapter 10: Secret Key Transaction Authentication (TSIG)
6JA7IxydIGPkr3Tw5ij0pQ==
If you have imported a BIND configuration with TSIG keys in it, ANS will know about them. If you would
like to define a key specifying the key name and secret, jump to ”Defining a TSIG Key” below.
# nom_maketsigsecret
8+a3Y5plhddf603oIVITTw==
If you run on a platform that does not have /dev/random, or if it can’t provide enough randomness, you’ll
see something like this instead.
# nom_maketsigsecret
Random data is needed to generate a shared secret for use by the nom_tell
program. Please type a secret phrase least 40 characters long, or at
least 40 random characters. Each character will be echoed as "*".
There is no need to remember what you typed.
***************************************************************
EdIfNV4FxxAiWfnNxgu3iQ==
You should enter something uncommon and secret—random characters are best—but you don’t need to
remember what you entered, since it will be hashed with the MD5 algorithm to produce a value suitable
for TSIG. The nom_maketsigsecret program is also summarized in Chapter 11, "Supporting Programs".
Nominum
DNS TSIG 159
Note that you used the “+=” differential update syntax to say that you wanted to add to the key list and
not replace it. Display the key with the show-view command:
ans> show-view
{
type => 'show-view'
view => 'default'
import => ('master' 'slave')
key => (('ns1-ns2.' '8+a3Y5plhddf603oIVITTw=='))
cache-filename => 'default.cache'
zone-conf-filename => 'default.zc'
server-id => 'bf20b630-7e18-411a-8ab2-a09d5f6caa41'
cache-size => '16777216'
transfers-in => '10'
slave-db => 'slave'
transfer-source => '0.0.0.0#0'
transfer-source-v6 => '::#0'
notify-source => '0.0.0.0#0'
notify-source-v6 => '::#0'
zone-purge-interval => '86400'
zone-purge-age => '604800'
log => nil
}
If you prefer, you can stop the server and add a key line to the view’s configuration file instead. Since
you’re using the default view, you’d edit /var/nom/ans/default.vc.
Here’s what the configuration file for the view shown above looks like:
# cat /var/nom/ans/default.vc
import master
import slave
cache-size 16777216
cache-filename "default.cache"
zone-conf-filename "default.zc"
server-id "bf20b630-7e18-411a-8ab2-a09d5f6caa41"
slave-db slave
transfers-in 10
transfer-source 0.0.0.0#0
transfer-source-v6 ::#0
notify-source 0.0.0.0#0
notify-source-v6 ::#0
key ns1-ns2. 8+a3Y5plhddf603oIVITTw==
zone-purge-interval 86400
zone-purge-age 604800
Nominum
160 Chapter 10: Secret Key Transaction Authentication (TSIG)
When used in this fashion, TSIG keys also apply to zone transfers and dynamic updates, and in order to
select the correct view, the key may also need to be specified in the match statement.
Specifying a TSIG key in an ACL (such as allow-* or an update policy) does not automatically force the
selection of the view containing that ACL. ACLs referring to the same key may appear in several views.
ANS applies the normal “first-match” semantics to view selection—a match on the key used to sign a
query or update or a match on the source address immediately terminates the selection process.
• Denied to any client that signs queries with otherkey, regardless of source-address.
• Denied to queries from network 192.168.0.0/16, unless queries are signed with privkey.
• Granted to all clients in the 10.0.0.0/8 network, unless queries are signed with otherkey.
Nominum
GSS-TSIG 161
GSS-TSIG
RFC 3645, “GSS Algorithm for TSIG (GSS-TSIG)” specifies a Generic Security Service API. RFC 2743,
“Generic Security Services Application Program Interface” provides a uniform, high-level API to security
services like authentication and confidentiality.
GSS-TSIG uses the GSS-API, TKEY and DNS TSIG to establish security context between a DNS Client and a
DNS server. This security context can then be used to authenticate, for example, dynamic updates as used
in Microsoft™ Active Directory™.
1. Set up MIT Kerberos on the machine running ANS to point at the Microsoft™ domain controller
by editing the krb5.conf file. MIT Kerberos may be obtained from http://web.mit.edu/kerbe-
ros/www/.
2. Follow the Microsoft™ procedures for setting up Kerberos on the Windows™ system.
Set up Kerberos
First, set up Kerberos, pointed at the Microsoft™ domain controller, on the host running ANS.
The following is an example krb5.conf file—change OUTBACK.EXAMPLE.COM to the realm of the Micro-
soft™ domain controller, and change 10.2.0.128 to the IP address of the Microsoft™ domain controller.
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
ticket_lifetime = 24000
default_realm = OUTBACK.EXAMPLE.COM
dns_lookup_realm = true
dns_lookup_kdc = true
Nominum
162 Chapter 10: Secret Key Transaction Authentication (TSIG)
[realms]
OUTBACK.EXAMPLE.COM = {
kdc = 10.2.0.128:88
admin_server = 10.2.0.128:749
default_domain = outback.example.com
}
[domain_realm]
.outback.example.com = OUTBACK.EXAMPLE.COM
outback.example.com = OUTBACK.EXAMPLE.COM
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
1. Create two users, one for the ANS server, and one for the DNS service, via the Account tab of
the User Properties command box.
In the examples below, the examples used are host/linux.outback.example.com for the ANS
server and DNS/linux.outback.example.com for the DNS service. These are the names entered
in the User Logon field of the Account tab. The linux.outback.example.com portion is the
domain name of the ANS server. The OUTBACK.EXAMPLE.COM portion is the Kerberos realm
and is entered in another field in the Account tab.
In the General tab on the same User Properties command box, the Display Name field is where
the value for -mapuser is entered. These can also be referred to as “Kerberos names.” In the
examples below, hostuser and dnsuser are used.
2. Once these users are configured, type the following from a command shell on the Windows™
system, carefully entering each as one long line to Windows™. Case is significant—in particular
“DNS” should be capitalized:
C:\>ktpass -princ \
host/linux.outback.example.com@OUTBACK.example.COM -mapuser\
hostuser -pass the_password_here -out host.keytab
Nominum
GSS-TSIG 163
C:\>ktpass -princ \
DNS/linux.outback.example.com@OUTBACK.example.COM -mapuser\
dnsuser -pass the_password_here -out dns.keytab
3. Next, list linux.outback.example.com in the SOA MNAME field of a zone, and in the zone’s NS
records. If the Windows™ system needs to update that zone, it will use GSS-TSIG to do it.
# /usr/kerberos/sbin/ktutil
Ktutil will prompt you with ktutil. Enter the following commands, pressing return after each
one. If you have an existing /etc/krb5.keytab you’d like to preserve, read it in with:
ktutil>rkt /etc/krb5.keytab
ktutil>rkt /wherever/you/put/it/host.keytab
ktutil>rkt /wherever/you/put/it/dns.keytab
ktutil>wkt /etc/krb5.keytab
ktutil>q
3. Create a simple ans.conf file in the directory where you want to run ANS. For example, the
directory /wherever/you/like.
4. To test whether your configuration is correct to this point, from the ANS server host, type:
# kinit host/linux.outback.example.com@OUTBACK.EXAMPLE.COM
You will be asked for a password. Enter the password for this user as you did for the -pass
option above. If you do not receive an error, your setup is correct. Repeat the command to test
the DNS user.
5. Start ANS:
# /usr/local/nom/sbin/ans -c /wherever/you/like/ans.conf
Nominum
164 Chapter 10: Secret Key Transaction Authentication (TSIG)
Here’s what the domain controller at 10.2.0.124, updating its own PTR RR to bark.outback.exam-
ple.com, looks like in the log:
Nominum
11
Supporting Programs
This chapter describes utility programs intended to complement the use of ANS. Several programs sup-
port authentication.
ans_signer
The ans_signer program is a DNS zone signer that takes a zone in standard DNS master file format as
input, and produces a DNSSEC signed zone as output. DNSSEC is a security protocol designed to sign DNS
data to protect it from unauthorized modification, and ans_signer’s output is generated in accordance
with the DNSSEC specification.
NOTE ans_signer is currently limited to signing with RSA keys (either RSA-MD5 or RSA-SHA1),
as there is no way to obtain the high-quality entropy necessary for secure DSA signatures.
ans_signer should only be used to sign zone files, not to maintain existing signed zone files, as it will drop
any existing RRSIG and NSEC records on load. Existing signed zones can be maintained by using DNS
Dynamic update to ans to update the contents of those zones.
ans_signer [-f outfile] [-o origin] [-s starttime][-e endtime] [-t] [-d
directory] [-k dskeyid] [-K keystore] [-v] [-h] [--version]
zonefile [keyid...]
Nominum 165
166 Chapter 11: Supporting Programs
ans_signer will look for keyset files at delegation points, which are named keyset-name, where name is
the name of the delegation point, from which to generate DS records. It will also generate a keyset file for
the zone being signed. If the keyset contains more than one key, then the keyset file will also contain sig-
natures of the keyset made by each key; this facilitates non-emergency rollover.
The zonefile parameter specifies the input master file. If specified as stdin, standard input will be
used. The keyid parameters list the keys used to sign the zone. If no keys are specified on the command
line, all zone keys from the master file will be used. If there are keys specified on the command line and
none in the master file, the keys will be added to the signed output file. The key ids are specified on the
command line; the keys are stored in the keystore file.
Option Description
-d directory The directory where keyset files are located. If not specified, the current
directory is used.
-e endtime The date and time when the generated SIG records expire. This can be
either absolute, relative to the start time, or relative to the current time. As
with starttime, an absolute time is indicated by YYYYMMDDHHMMSS
notation. A time relative to the start time is indicated by +N, and a time rel-
ative to the current time is indicated by now+N, where N is a number of
seconds. If no endtime is specified, 30 days from the start time is used.
-f outfile Specify the output file name. If specified as -, output will be written to
standard output. If not specified, the default is to append .signed to the
input file name, or to the zone origin if reading from standard input.
-h Print help and exit.
-k dskeyid The keyid of a key-signing key (KSK) for the zone. This option may be speci-
fied more than once. If any KSKs are specified, then they will be used to
sign the zone keyset and no other records, and will be the only keys put into
the output keyset file.
If no KSKs are specified, then ans_signer looks for keys with the secure
entry point (SEP) flag set. If any SEP keys are found, then they are used as
the KSKs. Otherwise, all of the keys specified are used as KSKs.
-K keystore The location of the keystore file containing the zone keys. If not specified, it
will default to a file called “keystore” in the current directory. The keystore
file is manipulated with nom_keytool. See ”nom_keytool” on page 161.
-o origin The zone origin. If not specified, the name of the zone file is assumed to be
the same as the origin.
Nominum
nom_keytool 167
Option Description
-s starttime The date and time when the generated SIG records become valid. This can
be either an absolute or relative time. An absolute start time is indicated by
a number in YYYYMMDDHHMMSS notation; 20020530144500 denotes
14:45:00 UTC on May 30th, 2002. A relative start time is indicated by +N,
where N is a number of seconds. If no starttime is specified, the current
time is used.
-t Generate statistics and print them at completion.
-v Verbose mode. Among other things, this enables a one-line progress bar.
--version Display the version of the program and exit.
nom_keytool
The nom_keytool program maintains a keystore file and supports generating, importing, exporting, delet-
ing and listing keys. If a keystore filename is not specified with the --keystore option, the default file-
name keystore in the current working directory will be used.
NOTE --sep is a key signing key that sets the Secure Entry Point flag on a key.
Subcommand Description
delete Deletes a key from the keystore.
generate Generates a key and adds it to the keystore. The key id is printed to stan-
dard output.
list Lists all keys in the keystore, printing the key name and id.
make-ds Print a DS RRset containing the SHA-256 and SHA-1 hashes of the specified
key to standard output.
to-bind-dnskey Creates BIND style .key and .private files containing the key as a DNSKEY
RR.
to-bind-key Creates BIND style .key and .private files containing the key as a KEY RR.
Nominum
168 Chapter 11: Supporting Programs
Subcommand Description
to-dnskey Prints the rdata of a DNS DNSKEY record to standard output.
to-key Prints the rdata of a DNS KEY record to standard output.
from-bind-key Imports a key from BIND style .key and .private files containing the key in
the form of a KEY RR.
from-bind-dnskey Imports a key from BIND style .key and .private files containing the key in
the form of a DNSKEY RR.
nom_maketsigsecret
The nom_maketsigsecret program creates a new shared secret to be used to create DNS TSIG (transaction
signatures). The shared secret will be generated from /dev/random if it is available. Otherwise, the user
will be prompted to make up a secret.
nom_maketsigsecret [keyname]
If keyname is present, the program will output a TSIG key statement suitable for use with the Nominum
ANS server. If keyname is not present, a base64-encoded secret is produced.
nom_nanny
The Nominum Nanny (“the Nanny”) monitors the state of Nominum products. It may be configured either
using the Nominum Command Channel or with a configuration file.
# nom_nanny
Command-Line Options
nom_nanny [ -c|--configuration file ] [ -f|--foreground ] \
[ -F|--foreground-with-syslog ] [ -h|--help ] [ -v|--version ]\
[ -V|--check ]
Nominum
nom_nanny 169
Option Description
-c , --configuration file Loads additional configuration from the configuration file.
Multiple configuration statements may appear.
-f, --foreground Runs the Nanny in the foreground, directing logging to the
terminal.
-F, --foreground-with-syslog Runs the Nanny in the foreground, directing logging to the
terminal as well as syslog.
-h, --help Displays the Nanny’s help message.
-v, --version Displays the version of the Nanny and exits.
-V, --check Reads and checks the Nanny's configuration for validity, and
exits. A 0 status indicates a valid configuration.
Or you can use nom_tell’s interactive mode, which is easier for sending several messages. To do so, type
the following to get to the nanny> prompt. Once at the nanny> prompt, you can type messages as
shown in the examples listed for each command. To start interactive mode, type:
# nom_tell nanny
nanny>
Nominum
170 Chapter 11: Supporting Programs
Command Description
deregister Deregisters a child process. The syntax is:
deregister name
nanny> die
kill Signals a child. If the signal tag is not specified, SIGTERM is
sent. If name is not specified, all child processes are signaled.
The syntax is:
nanny> lock
pid Returns the process ID of nom_nanny.
nanny> pid
process-information Retrieves process information for nom_nanny.
nanny> process-information
Nominum
nom_nanny 171
Command Description
register Registers a child. The syntax is:
restart [name]
nanny> restart
nanny> restart name=ans
start Starts a child. If the child is not already registered, the start com-
mand registers it and sets the auto-deregister option. The syntax
is:
start name
status [name]
nanny> status
nanny> status name=ans
Nominum
172 Chapter 11: Supporting Programs
Command Description
stop Stops a child process. If wait is a value interpreted as true,
the response isn’t sent until the child has stopped.
nanny> uuid
version Returns the version of nom_nanny.
nanny> version
NOTE A configuration file is not required, and is loaded only when directed by the user.
A configuration line contains an option name, possibly followed by whitespace and then a value. If pres-
ent, the value is all of the remaining text on the line, including any non-leading whitespace. Blank lines
and lines starting with # are ignored.
Option Description
auto-deregister Deregisters the current child when it is stopped. The Nanny
“forgets” everything about this child after a stop command
for it is sent.
command value Sets the command to be executed for the current child to
value.
Nominum
nom_nanny 173
Option Description
command-channel who secret Specifies the address and port to which Command Channel
commands should be sent.
Nominum
174 Chapter 11: Supporting Programs
Option Description
lock Locks out Command Channel changes that register or dereg-
ister children.
Nominum
A
Statistics
Name Description
cache-hit The number of cache lookups that found an existing node.
cache-miss The number of cache lookups that did not find an existing node.
cc-update-failure The number of Command Channel update-data messages that
resulted in a failure.
cc-update-success The number of Command Channel update-data messages that
resulted in success.
current-time The current time. Returned in all statistics queries, expressed as seconds
since the epoch (00:00 UTC, January 1, 1970).
current-time-hires The current time, in high resolution format. Returned in all statistics
queries, expressed as seconds since the epoch (00:00 UTC, January 1,
1970).
failure The number of queries that result in a failure response other than those
listed as specific types.
formerr A format error that resulted in a FORMERR response.
Nominum 175
176 Appendix A: Statistics
Name Description
notify-total The number of notifies received.
nxdomain The number of queries that result in an NXDOMAIN response.
nxrrset The number of queries that result in a NOERROR response with no data.
qtypes The number of queries of each type, such as MX queries.
referral The number of queries that resulted in referral responses.
refused A query to which a REFUSED response is returned.
reset-time The time of the last reset. Returned in all statistics queries and expressed
as seconds since the epoch (00:00 UTC, January 1, 1970).
query-total The number of queries received.
server-start-time The time the server was started, expressed as seconds since the epoch
(00:00 UTC, January 1, 1970).
slave-zone-count The number of slave zones in View.
success The number of successful queries made to the server or zone. A suc-
cessful query is defined as a query that returns a NOERROR response
other than a referral response.
system-time The amount of system CPU time consumed by the ANS process.
unknown-opcode The number of messages that contained an unknown opcode.
update-failure The number of failed DDNS updates.
update-forwarding-fail- The number of forwarded updates that failed.
ure
update-forward- The number of forwarded updates that were refused.
ing-refused
update-forwarding-suc- The number of forwarded updates that succeeded.
cess
update-notauth The number of DDNS updates that were not authoritative.
update-refused The number of DDNS updates that were refused.
update-success The number of successful DDNS updates.
update-total The number of updates received.
user-time The amount of user CPU time consumed by the ANS process.
view-load-time The time of last view load, expressed as seconds since the epoch (00:00
UTC, January 1, 1970).
Nominum
177
Name Description
zone-count The total number of zones being served.
zone-modifications The number of zone data changes by methods other than DDNS and
command-channel.
In addition, individual statistics are available for the query type (qtype) for all types less than 50, as well
as type ANY. All other qtypes are combined into one qtype statistic called other.
Nominum
178 Appendix A: Statistics
Nominum
B
ANS Events
This chapter describes the ANS events that can be requested by Command Channel clients. These events
are useful for organizations wishing to integrate ANS with other programs, or with an existing SNMP
(Simple Network Management Protocol) monitoring system.
When various interesting events occur, ANS will send a Nominum Command Channel event message to
all Command Channel clients which have requested that event. See the Nominum Command Channel API
manual for more information about the structure of event messages.
Each ANS Command Channel connection has an event subscription list. When the connection is estab-
lished, its initial subscription list will be empty. To request that events be sent, the client sends a
request-events command. This command can either be used to explicitly specify the desired events, or to
incrementally change the list. The show-events command displays the currently requested events. The
list-events command returns the list of all the events which ANS can generate.
Clients may dedicate a connection to receiving events, or they can use a single connection for both ordi-
nary traffic and events.
Below are some examples of how to use these commands using nom_tell in interactive mode. Since
events are sent over an existing connection, nom_tell in non-interactive mode would have no effect, as
the connection would be immediately closed when nom_tell exited.
Enter interactive mode with nom_tell so you see the ans> prompt.
# nom_tell ans
ans>
Nominum 179
180 Appendix B: ANS Events
List the currently registered events (the response will contain an events tag, as shown):
ans> show-events
{
type => 'show-events'
events => ('server/stop' 'server/reload' 'xfr-out/denied')
listening-for => ('server/stop' 'server/reload' 'xfr-out/denied')
}
The events item specifies the current recipe for choosing events, and the listening-for item tells
you the exact set of events the recipe specifies. In this case, they’re the same, but more complex recipes
are possible.
The special event names all and none represent all events and no events, respectively. Event names can
be preceded with a! character to indicate that they are explicitly not desired. For example, to request “all
events except update/refused” you would say:
Events typically contain additional context about what happened. For example, here are two sample
event messages about slave zone status, one for a zone which has just been validated as still up-to-date,
and another for a zone which is having trouble talking to its master:
{
type => 'zone-maintenance/up-to-date'
view => 'default'
zone => 'good.example'
Nominum
181
{
type => 'zone-maintenance/failure'
view => 'default'
zone => 'bad.example'
status => 'never-transferred'
master => '127.0.0.2#53'
detail => 'too many SOA query retransmits'
}
Detailed information about the fields in events, including type information, is available in the ANS SNMP
MIB. The MIB nominum.txt is part of the package containing the nom_snmpagent program; the ans.txt
MIB is included as part of the ANS package. See Chapter 9, SNMP in ANS for more information about this
program.
Event Description
update/failure Sends events for all failed dynamic updates.
Nominum
182 Appendix B: ANS Events
Event Description
update/success Sends events for all successful dynamic updates.
Nominum
183
Event Description
zone/modified Sends events whenever a zone is modified.
Nominum
184 Appendix B: ANS Events
The following events are not view-specific, but rather are global options for the server. They are config-
ured in the default view for convenience.
Event Description
server/modified Sends events when the server’s configuration is modified.
server/reload Sends events when the server reloads.
server/restart Sends events when the server restarts.
server/stop Sends events when the server stops.
view/added Sends events when a view is added to the server.
Nominum
C
Logging Switches
ANS allows fine-grained, per-view control over what is logged. In addition, the view logging policy can be
overridden on a per-zone basis if needed.
Option Description
gsstsig/info Log additional information about GSS-TSIG failures.
notify-in/received Log DNS Notify messages received by the server, and for which
the server is authoritative. The default value of this switch is “no”.
notify-in/refused Log DNS Notify messages refused by the server because it is not
authoritative for the zone. The default value of this switch is
“no”.
Nominum 185
186 Appendix C: Logging Switches
Option Description
notify-out/acknowledged Log acknowledgements to DNS Notify messages sent by the
server when they are received. The default value of this switch is
“no”.
notify-out/sent Log DNS Notify messages when they are sent. The default value
of this switch is “no”.
query/answered Log DNS queries answered by the server. The default value of this
switch is “no”.
query/error Log DNS queries for which the server responded with an error
result other than “refused”. The default value of this switch is
“no”.
query/refused Log DNS queries refused by the server because it is not authorita-
tive for the question. The default value of this switch is “no”.
update/details Log detailed information about the content of an update, includ-
ing the names and types of updated data, and/or the reason an
update was refused. The default value of this switch is “yes”.
update/failure Log failed dynamic updates. The default value of this switch is
“yes”.
update/not-auth Log update attempts for zones for which the server is not author-
itative. The default value of this switch is “yes”.
update/refused Log refused dynamic updates. Refused updates are those updates
denied by the update authorization policy. The default value of
this switch is “yes”.
update/success Log successful dynamic updates. The default value of this switch
is “yes”.
update-forwarding/failure Log failed dynamic update forwarding.
Nominum
187
Option Description
xfr-out/granted Log outbound zone transfer requests which are granted. The
default value of this switch is “yes”.
zone/added NOTE: Not usable with the zone option log-flags.
Nominum
188 Appendix C: Logging Switches
The following log switches are not view-specific, but rather are global options for the server. They are
configured in the default view for convenience.
Option Description
command/executed Log details about valid Command Channel commands executed
by the server. The default value of this switch is “no”.
command/unknown Log details about unknown Command Channel commands
received by the server. The default value of this switch is “no”.
Logging may also be set via a Command Channel command to update the view. See ”update-view” on
page 96 for more information and an example of setting logging switches over the Command Channel.
Nominum
D
Examples of Server and
View Operations
This chapter presents examples of common operational tasks that an ANS administrator may encounter.
These scenarios provide examples of various methods of communicating with ANS. This chapter high-
lights operations that pertain to the server itself and to views. It also describes how to run the server in a
“chroot() jail”, and some miscellaneous operations. See Chapter 8, Examples of Zone Operations, for
examples of operations that pertain to zone management.
Server Operations
Backing Up and Restoring ANS
Nominum recommends that you back up and archive your entire ANS data set and configuration on a
regular basis to minimize data loss in the event of a system or hardware failure. A comprehensive backup
involves the following files:
NOTE There is no need to shut down ANS in order to back up data. However, Nominum
strongly recommends that you not back up or restore files while ANS is performing a
checkpoint. See ”Best Practices” on page 191 for details.
Nominum 189
190 Chapter D: Examples of Server and View Operations
To back up ANS:
NOTE A configuration file is optional for server operation. If there is no /etc/ans.conf file, just
back up /etc/channel.conf.
Restoring
# /etc/init.d/ans stop
# cd /
3. Extract the files contained in the backup from which you wish to restore:
# tar xf ans-backup.tar
# /etc/init.d/ans start
NOTE When restoring your data, you will see additional log messages related to that restore;
this is normal when recovering from a backup.
Nominum
Server Operations 191
Best Practices
Nominum strongly recommends that you not back up or restore ANS files while a checkpoint is in pro-
cess. While you cannot have complete control over when ANS runs a checkpoint process, you can signifi-
cantly reduce the odds of the backup and the checkpoint colliding by running a manual checkpoint
before backing up. See ”checkpoint” on page 76.
• listen-on-port port
• listen-on addrport
listen-on-port 53
listen-on-matching 0.0.0.0/0
If one or more listen-on statements are present, then show-server will include
where listen-on-list is a list of strings, and each string is either a port number or an IP address (v4 or
v6). The port number is the port to use for subsequent IP addresses in the list. The default port is 53, so if
the list starts with an IP address, it means that address, port 53.
Some examples:
Nominum
192 Chapter D: Examples of Server and View Operations
listen-on 127.0.0.1
listen-on-port 5354
listen-on ::1
listen-on 10.1.0.1
listen-on-port 5355
listen-on 10.2.0.1
listen-on 127.0.0.1#53
listen-on ::1#5354
listen-on 10.1.0.1#5354
listen-on 10.2.0.1#5355
If one or more listen-on-matching statements are present, then show-server will include
port
none
[!](network-prefix-pattern | interface-pattern | special)
and special is
The port number is used in the same way as listen-on above. It cannot be negated.
localhost means “any of this host’s interface addresses”. localnets means “any address on any net-
work this host is directly connected to”. none is the same as !any and cannot itself be negated.
If prefix-length is not specified, it defaults to 32 for IPv4 and 128 for IPv6. If the pattern starts with
“!”, it means “anything matching this pattern should not be listened-on”.
An interface name is operating-system specific, but is typically something like eth0. Interface patterns
match both IPv4 and IPv6 addresses on the matching interface.
For example:
Nominum
Server Operations 193
is equivalent to:
listen-on-matching ::1
listen-on-matching eth1
listen-on-port 5354
listen-on-matching !10.0.0.0/8
listen-on-matching any
As another example, suppose the following interfaces are active on the following IP addresses:
eth0: 10.1.1.1
eth1: 10.2.1.1
eth2: 10.3.1.1
eth3: 10.4.1.1
eth4: 10.5.1.1
listen-on-matching 10.0.0.0/8
Note that the OS limits on the number of IP addresses/interfaces that can be listened on in total still apply.
It’s not literally possible to listen on the tens of thousands of addresses in a /8 network. ANS can create up
to 600 listening sockets, however.
Table D-1 contains examples of sets of listening commands, and the effect they have. The descriptions of
the effects of the statements assume that the lines which are grouped together in the table are the only
listening statements in the configuration file.
Configuration Effect
No listen-on statement (Default) Listen on port 53 on all interfaces.
listen-on-port 5354 Listen on port 5354 on all interfaces.
listen-on-port 5354 Listen on port 5354 on interfaces whose addresses
match 10.0.0.0/8.
listen-on-matching 10.0.0.0/8
listen-on-port 5354 Listen on port 5354 on interfaces whose addresses
match 10.0.0.0/24 or 127.0.0.0/8.
listen-on-matching 10.0.0.0/24
listen-on-matching 127.0.0.0/8
listen-on-matching lo0 Listen on port 53 with the addresses of the inter-
face named lo0.
Nominum
194 Chapter D: Examples of Server and View Operations
Configuration Effect
listen-on-matching 10.0.0.0/8 Listen on port 53 on interfaces whose addresses
match 10.0.0.0/8.
listen-on-port 1234 Listen on port 1234 with the addresses of the inter-
face named eth0.
listen-on-matching eth0
listen-on 127.0.0.1#5354 Listen on 127.0.0.1#5354.
listen-on-port 5354 Listen on 127.0.0.1#5354.
listen-on 127.0.0.1
It is not recommended that ANS be configured with listen-on 0.0.0.0 because if the ANS server has
several interfaces, it’s possible that queries sent to one of those aliased IP addresses will be returned from
a different address and thus likely ignored by the client. The statement listen-on-matching
0.0.0.0/0, however, is fine.
There are times, however, when you want to update a slave immediately instead of waiting for a Notify or
the periodic poll. Perhaps a network failure caused ANS to miss Notify messages, or the administrator of
the master did not arrange for your server to get notification. The force-maintenance command sched-
ules a slave zone for maintenance as soon as possible. Here’s an example:
We can also deny transfers to specific addresses. For example, to allow transfers from 10.0.0.0/8
except for from 10.1.0.0/24, you could say:
Nominum
Server Operations 195
NOTE If you’re using csh as your shell, you’ll need to escape ‘!’ with a ‘\’.
You’ve added -d vdb to tell ans_dump that you want to use the VDB driver instead of the default driver,
which is the pseudo-driver cc. (The cc driver uses the Nominum Command Channel to provide a remote
procedure call interface to databases loaded in an ANS server.) When using the vdb driver, you must also
Nominum
196 Chapter D: Examples of Server and View Operations
provide a dbfile=filename parameter if you want to access a database other than the default data-
base master.db. Let’s load zone example into the big database.
# cd /etc/init.d/ans
# ans_load -d vdb example example.master dbfile=big.db
When used with the vdb driver the database files are read or written from the current working directory,
so you had to connect to /var/nom/ans—that’s where your databases are.
;; QUESTION SECTION:
;id.server. CH TXT
;; ANSWER SECTION:
id.server. 0 CH TXT "15024c22-c97b-4cc8-95cd-6f7779f431f0"
Solaris
To create a chroot() jail for ANS on Solaris:
Nominum
Running Nominum ANS in a chroot() Jail 197
2. Create the base directory of the jail if it does not already exist. For this example, it’s assumed to
be /chroot/ans:
# mkdir -p /chroot/ans
# groupadd ans
# useradd -g ans -d /chroot/ans -s /bin/true ans
# passwd -l ans
# cd /chroot/ans
# mkdir dev
# mkdir etc
# mkdir -p usr/local/
# mkdir -p usr/share/lib/zoneinfo
# mkdir -p var/nom/
# mkdir -p /chroot/ans/proc
# cp /etc/channel.conf etc
8. Copy the ans.conf file. If one does not exist, it must be created. A simple file consists of the sin-
gle statement directory /var/nom/ans:
# cp /etc/ans.conf etc
# cp -r /usr/local/nom usr/local/
10. Copy the time-zone files, or syslog will contain timestamps for GMT. This example is for the
United States—modify the command for the timezone as needed.
# cp -r /usr/share/lib/zoneinfo/US usr/share/lib/zoneinfo
11. Create devices null, random, poll and zero in the jail. Use the ls -lL command to determine
the major and minor device numbers for the system as suggested by the following example:
Nominum
198 Chapter D: Examples of Server and View Operations
12. As noted above, ownership/permissions issues were deferred. Set privileges now.
# chown -R ans .
# chgrp -R ans .
# chmod o etc/channel.conf
14. For completeness, this startup command must be put into the service script
/etc/init.d/ans so that the nameserver is properly started (as user ans) when the host
reboots.
When running as a non-root user, ANS does not restart itself when the following Com-
mand-Channel-based configuration changes are made:
• update-server
• restart
In these cases, the administrator must restart ANS manually or the changes will not take
effect, and ANS logs an error message.
2. Create the base directory of the jail if it does not already exist. For this example, it’s assumed to
be /chroot/ans:
# mkdir -p /chroot/ans
Nominum
Running Nominum ANS in a chroot() Jail 199
# groupadd ans
# useradd -g ans -d /chroot/ans -s /bin/true ans
# passwd -l ans
# cd /chroot/ans
# mkdir dev
# mkdir etc
# mkdir -p usr/local/
# mkdir -p var/nom/
# cp /etc/channel.conf etc
8. Copy the ans.conf file. If one does not exist, one must be created. A simple file consists of the
single statement directory /var/nom/ans):
# cp /etc/ans.conf etc
9. ANSans# ansMake sure that the file uuid exists in the jail after the copy:
# ls -l var/nom/ans
# cp -r /var/nom/ans/uuid var/nom/ans
# cp -r /usr/local/nom usr/local/
11. Copy the time-zone files, or syslog will contain timestamps for GMT.
# cp /etc/localtime etc
12. Create devices null, random and zero in the jail. Use the ls -lL command to determine the
major and minor device numbers for the system as suggested by the following example:
Nominum
200 Chapter D: Examples of Server and View Operations
13. Modify syslogd so that logging happens within the jail, as ANS won't have access to logging
outside the jail. Edit /etc/sysconfig/syslog to replace the line
SYSLOGD_OPTIONS="-m 0"
with
SYSLOGD_OPTIONS="-m 0 -a /chroot/ans/dev/log"
# /etc/rc.d/init.d/syslog stop
# /etc/rc.d/init.d/syslog start
This will create the file /chroot/ans/dev/log to which ANS will log.
14. As noted above, ownership/permissions issues were deferred. Take care of that now:
# chown -R ans .
# chgrp -R ans .
# chmod o= etc/channel.conf
16. For completeness, this startup command must be put into the service script /etc/init.d/ans so
that the nameserver is properly started (as user ans) when the host reboots.
View Operations
Creating A View
ANS supports the concept of multiple views of the DNS that was introduced in BIND 9. Many organiza-
tions would like to keep the details of their namespace private, except to their internal systems. There are
thus two views of the company’s namespace: an internal full view, and an external view of a typically very
restricted namespace, often just a few servers providing essential services such as WWW, mail, and DNS
to the Internet.
Nominum
View Operations 201
Up until this point, you’ve only been using a single view, named default, which ANS provides when no
views have been configured by the administrator.
Let’s assume your organization uses network 10 addresses on its internal network, and that you want to
give your internal clients a different view of the organization’s DNS than that given to the Internet.
In addition to creating a view configuration object, this command also adds an import-view statement
to the server’s global configuration file and restarts the server.
The order of import-view statements in the server configuration file is important. When a client
request arrives, ANS tries to find a view from which to answer, examining views in the order in which they
were imported until one matches. If no view matches, the request is refused. The default view, how-
ever, is always tried last.
NOTE import-view statements must appear before any per-view statements in the configu-
ration file. If a per-view statement executes without any prior import-view, the
per-view statement will fail.
Clients can be matched by one, or both, of their source IP address and their target IP address (“IP” means
both IPv4 and IPv6 here). The match item in the command above matches any client whose source is on
the /8 network 10.0.0.0.
You could also have specified the same set of addresses using a range like this:
Note that when you want to refer to a view other than the default, you must add a view=viewname
clause to the command. More complicated rules are possible, including “negative matches” which
exclude clients from the view explicitly.
For example, let’s say you wanted to put all of network 10 except for 10.1.0.0/24 into the internal
view:
The other kind of matching is based on the destination address of the client’s request. Maybe you have a
nameserver with two interfaces, one to the internal network and one to the external network. In that
case, you might want to match requests to the internal interface to the internal view like this:
Nominum
202 Chapter D: Examples of Server and View Operations
Negative matching works for match-to as well. If you configure both match-to and match rules for the
same view, then clients will only be served from that view if both rules are positive matches.
Be careful with IP address matching. In particular, you need to make sure that your firewalls have appro-
priate rules to block packets with internal addresses from external networks, because ANS cannot tell
where a packet came from, just what address it has.
Once you’ve created views and set up the matching rules, all you need to do is add zones to the views like
you did to the default view earlier. The only differences are that for nom_tell commands you should
add a view=<viewname> clause, and for database commands such as ans_load you should add
--view <viewname>. You can use -v instead of --view if you prefer. For example:
Deleting a View
You can delete the internal view created above by running:
options {
directory "/var/named";
listen-on { 10.0.0.0/8; };
};
zone "example" {
type master;
file "example.master";
notify no;
};
zone "example.org" {
type slave;
file "example.org";
masters { 192.168.1.1; };
};
1. If ANS is currently running, shut it down. ans_import can only be issued when the server is not
running.
Nominum
View Operations 203
2. Connect to the directory which has ans and import the named.conf file.
# cd /etc/init.d/ans
# ans_import /etc/named.conf
The import process issues an ans_load command for every master zone in the BIND configuration, and
loads the data into the master database. You may have noticed that the ans_load command used by the
importer looks a bit different from what you’ve seen so far—this is an example of offline loading. See
”Offline Loading, Dumping, and Deletion” on page 195 for more information.
NOTE By default, importing replaces any existing configuration with the imported configura-
tion, so if you have added some additional zones as part of experimenting with
ans_load, ans_dump or nom_tell, you will see some zone deletions before the Loading
master zones message.
The importer creates or modifies a number of files in the current directory, as well as creating
/var/nom/ans.conf. In general, ANS server configurations imported from BIND will include the following
lines:
directory /var/nom/ans
listen-on-matching 10.0.0.0/8
For an explanation of listen-on-matching, see ”Listening and Not Listening” on page 191.
ans_load, as executed by ans_import, tries to be intelligent when re-importing, comparing the new con-
figuration to the existing configuration, and making only those changes required to turn the existing con-
figuration into the new configuration. In particular, it will not reload DNS master files which have not
Nominum
204 Chapter D: Examples of Server and View Operations
been updated, and it does not discard slave zones which have at least one master in common with the
new configuration.
There is no additional syntax for re-importing; just run ans_import again from the same directory and
with the same arguments.
WARNING! Make sure the server is not running when you issue this command.
Nominum
E
ANS Files
Introduction
ANS works with a number of different file types, all of which are described briefly in this chapter.
Nominum 205
206 Appendix E: ANS Files
Nominum
ANS Files Quick Reference 207
Nominum
208 Appendix E: ANS Files
The server configuration file is optional. If a configuration file was not specified on the command line,
and /etc/ans.conf does not exist, ans uses a default configuration, which:
The server configuration file may be edited while the server is running. Changes do not take effect until
the server is restarted.
directory /dns
listen-on-matching eth0
db mydb vdb dbfile=mydb.db
import-view internal
import-view external
syslog-facility local0
View Files
Several files have the form viewname.suffix. For example, internal.vc is the view configuration file for
view internal, and external.zmaint is the zone maintenance state file for view external. Only the
“.vc” file is human-readable and editable. View files should only be modified or removed in accordance
with the rules for the file type, as described below.
Nominum
View Files 209
WARNING! Do not edit .vc files while the server is running. Use the Nominum Command Chan-
nel to make the desired changes.
When the server receives a Nominum Command Channel message changing a view’s configuration, it
updates that view’s configuration file automatically. It is thus important not to make changes by hand
since they will be overwritten if the server writes the view configuration. For more information on view
configuration file syntax, see “Views” on page 12.
import master
import slave
cache-filename default.cache
server-id c17a775a-0ff6-46b3-a110-823cffd7c0c1
slave-db slave
transfers-in 10
transfer-source 0.0.0.0#0
transfer-source-v6 ::#0
notify-source 0.0.0.0#0
notify-source-v6 ::#0
zone-purge-interval 86400
zone-purge-age 604800
log notify-out/sent yes
While the server is running, there will also be files with names of the form viewname.zc.suffix, for
example default.zc.membak, default.zc.memjnl, and default.zc.memlock. These files are used to make
zone configuration changes transactional. Deleting these files is safe only if you are deleting the entire
view.
Nominum recommends that changes to zone configuration be made using the Command Channel.
Nominum
210 Appendix E: ANS Files
server starts, it reloads the cache. If the new query load is similar to the old query load, the server will be
starting with a “hot” cache and be at its best immediately.
It is always safe to delete this file, but the server’s query-per-second rate may be lower while it acquires a
new cache.
It is not necessary to delete this file if you make changes to an ANS database while the server is offline,
for example by running ans_load or ans_import. The server examines all cached data when it loads the
cache, and any data which is no longer current will be discarded.
To force zone maintenance to occur for a given zone, issue a force-maintenance or force-transfer com-
mand.
In the table below, base denotes the base name of the VDB, such as master or slave.
Filename Description
base.vdb database data
base.vdi database indexes
Nominum
ANS and the Nominum Command Channel 211
Filename Description
base.vdl lock file
base.vdj<id> journal file.
The <id> value is the journal file id number, for
example 0000000001. There may be many journal
files—they accumulate until the database is closed
or checkpointed.
ANS creates a file called .cc_dups in its working directory when it exits. This file contains information
about recently received Command Channel messages, and is used to guard against replay attacks.
Nominum
212 Appendix E: ANS Files
Nominum
Index
A B
absolute version flag 103 backend driver name 104
aclpat 36 BIND 43, 196
addrpat 35 block-checkpoint 76
addrport 35 builtin-acl 36
add-view 73
options
log185 C
add-zone 73, 75 cache-filename option 41
allow-notify option 47 cache-size option 41
allow-transfer option 47 cc 27
allow-update option 47 cc pseudo-driver 27
allow-update-forwarding option 47 changing configuration information using
also-notify option 48 update-zone 130
ans channel.conf
command-line options 9 alternate service definitions in 102
-c 9 defining an ANS instance other than ans in 102
chroot() and 10 channel.conf file 68—69, 71
-F 9
example entries 68
-f 9
-h 9
nom_tell behavior in the absence of entries 69
-r 10 security considerations with 71
-u 10 checkpoint 73, 76
--usage 10 checkpoint-interval global option 36
-V 10 child argument 172
-v 10 chroot() 11, 196
ans command 9 command-line options and 10
ANS logging switches on Solaris 196
gsstsig/info 185 RHEL and 198
ans_import 96 clear statistics counters 93
ans_load client match 43
command options command 188
--check 105 command argument 172
options command channel 67
-c 105
Command Channel commands
--check 105
add-view 73
ans_signer options 166
add-zone 73, 75
ans_signer program 165
checkpoint 73, 76
authoritative DNS cache 41
delete-view 73, 76
auto-deregister argument 172
delete-zone 73, 77
Nominum ANS
Index 215
E gss-credentials option 41
gsstsig/info 185
empty-nonterminals option 48
entering one-line mode in nom_tell 71
/etc/channel.conf H
See configuration file
help
events 150, 179
nom_nanny 169
expired maintenance status 82
hmac-md5 42
external file
hmac-sha1 42
logging queries to 44
F I
import database 41—42
file database driver 27, 30
flags import option 42
database revision 103 import-view global option 38
flush 73, 77 inbound zone transfer count 45
force-maintenance 73, 78 $INCLUDE 109
force-notify 73, 78 increasing verbosity using nom_tell 72
interactive mode
force-transfer 73, 78
determining using nom_tell 72
fully qualified domain name of zone 104
invisible-cnames option 49
G K
$GENERATE 109—110
key option 42
global configuration 208
keystore-filename
global options
DNSSEC and 42
checkpoint-interval 36
keystore-filename option 42
command-channel 36
commands-not-logged 37
db 37 L
directory 37
dns-port 37 list-drivers 74, 89
driver 38 listen-on global option 38
import-view 38 listen-on-matching global option 38
listen-on-port
listen-on 38
dns-port and 39
listen-on-matching 38
listen-on-port global option 39
listen-on-port 39
list-events 73, 78
lock-filename 39
load a configuration file
max-tcp-clients 39
nom_nanny 169
max-udp-clients 39
load-driver 150
setup-errors-fatal 39
lock-filename global option 39
syslog-facility 39
log 147
udp-buffer-size 39
log option 42, 185
umask 39
log switch syntax 98
versioncheck-interval 40
log-flags option 50
without-rmi 40
logging switches 185
Nominum ANS
216 Index
Nominum ANS
Index 217
Nominum ANS
218 Index
Nominum ANS
Index 219
Nominum ANS
220 Index
V
validating nom_nanny configuration 169 W
VDB 28 wait time
vdb 27 specifying using nom_tell 72
vdb database driver 27 without-rmi global option 40
verbosity
increasing with nom_tell 72
version 74, 100, 152 X
nom_nanny 169 xfr-out/denied 182, 186
versioncheck-interval global option 40 xfr-out/granted 182, 187
view 12
expanded definition of 12
view argument 104 Z
view name 104 zone argument 104
view options zone maintenance status
addrport and 43 expired 82
cache-filename 41 needs-maintenance 82
cache-size 41 needs-transfer 82
gss-credentials 41 never-transferred 82
import 42 up-to-date 82
key 42 zone maintenance tasks
keystore-filename 42 destruction-wait 83
log 42 schedule-wait 83
match 43 sleeping 83
match-to 43 soa-receive-wait 83
minimize responses 43 soa-send-wait 83
notify-rate 43 transferring 83
Nominum ANS
Index 221
transfer-start-wait 83
zone name 104
zone options
allow-notify 47
allow-transfer 47
allow-update 47
allow-update-forwarding 47
also-notify 48
conf-template 48
empty-nonterminals 48
invisible-cnames 49
log-flags 50
masters 50
notify 50
notify-hold option 51
notify-source option 51
notify-source-v6 51
purge-age 51
purge-interval 51
purge-max-versions 52
rrset-order 52
slave-db 52
source-view 52
statistics 52
transfer-source 53
transfer-source-v6 53
update-policy 53
zone transfers 45
zone/added 182, 187
zone-count-hint option 45
zone/deleted 182, 187
zone/loaded 187
zone-maintenance/failure 183, 187
zone-maintenance/success 183, 187
zone-maintenance/up-to-date 183, 187
zone-maintenance/xfr-details 187
zone/modified 187
zone-purge-age option 45
zone-purge-interval option 46
zone-purge-max-versions option 46
Nominum ANS
222 Index
Nominum ANS