d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
71cef386fae61275b03e203825680b39fedaa8c6Tinderbox User - Copyright (C) 2000-2018 Internet Systems Consortium, Inc. ("ISC")
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - This Source Code Form is subject to the terms of the Mozilla Public
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - License, v. 2.0. If a copy of the MPL was not distributed with this
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - file, You can obtain one at http://mozilla.org/MPL/2.0/.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<title>Appendix�D.�BIND 9 DNS Library Support</title>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<link rel="prev" href="Bv9ARM.ch11.html" title="Appendix�C.�General DNS Reference Information">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<link rel="next" href="Bv9ARM.ch13.html" title="Manual pages">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<table width="100%" summary="Navigation header">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<tr><th colspan="3" align="center">Appendix�D.�BIND 9 DNS Library Support</th></tr>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<a accesskey="p" href="Bv9ARM.ch11.html">Prev</a>�</td>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch13.html">Next</a>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="titlepage"><div><div><h1 class="title">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<a name="Bv9ARM.ch12"></a>BIND 9 DNS Library Support</h1></div></div></div>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<dt><span class="section"><a href="Bv9ARM.ch12.html#bind9.library">BIND 9 DNS Library Support</a></span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch12.html#id-1.13.2.5">Installation</a></span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch12.html#id-1.13.2.6">Known Defects/Restrictions</a></span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch12.html#id-1.13.2.7">The dns.conf File</a></span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch12.html#id-1.13.2.8">Sample Applications</a></span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="section"><a href="Bv9ARM.ch12.html#id-1.13.2.9">Library References</a></span></dt>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h2 class="title" style="clear: both">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<a name="bind9.library"></a>BIND 9 DNS Library Support</h2></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User This version of BIND 9 "exports" its internal libraries so
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User that they can be used by third-party applications more easily (we
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User call them "export" libraries in this document). Certain library
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User functions are altered from specific BIND-only behavior to more generic
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User behavior when used by other applications; to enable this generic behavior,
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the calling program initializes the libraries by calling
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>isc_lib_register()</strong></span>.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User In addition to DNS-related APIs that are used within BIND 9, the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User libraries provide the following features:
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User The "DNS client" module. This is a higher level API that
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User provides an interface to name resolution, single DNS transaction
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User with a particular server, and dynamic update. Regarding name
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User resolution, it supports advanced features such as DNSSEC validation
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User and caching. This module supports both synchronous and asynchronous
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User The "IRS" (Information Retrieval System) library. It provides an
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User interface to parse the traditional <code class="filename">resolv.conf</code>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User file and more advanced, DNS-specific configuration file for the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User rest of this package (see the description for the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <code class="filename">dns.conf</code> file below).
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User As part of the IRS library, the standard address-name
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User mapping functions, <span class="command"><strong>getaddrinfo()</strong></span> and
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>getnameinfo()</strong></span>, are provided. They use the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User DNSSEC-aware validating resolver backend, and could use other
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User advanced features of the BIND 9 libraries such as caching. The
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>getaddrinfo()</strong></span> function resolves both A
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User and AAAA RRs concurrently when the address family is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User An experimental framework to support other event
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User libraries than BIND 9's internal event task system.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h3 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.5"></a>Installation</h3></div></div></div>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>make install</code></strong>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Normal installation of BIND will also install library object
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User and header files. Root privilege is normally required.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User To see how to build your own application after the installation, see
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <code class="filename">lib/samples/Makefile-postinstall.in</code>.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h3 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.6"></a>Known Defects/Restrictions</h3></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User The "fixed" RRset order is not (currently) supported in the export
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User library. If you want to use "fixed" RRset order for, e.g.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>named</strong></span> while still building the export library
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User even without the fixed order support, build them separately:
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>/configure --enable-fixed-rrset <em class="replaceable"><code>[other flags, but not --enable-exportlib]</code></em></code></strong>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>make</code></strong>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>/configure --enable-exportlib <em class="replaceable"><code>[other flags, but not --enable-fixed-rrset]</code></em></code></strong>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>cd lib/export</code></strong>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>make</code></strong>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User RFC 5011 is not supported in the validating stub resolver of the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User export library. In fact, it is not clear whether it should: trust
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User anchors would be a system-wide configuration which would be managed
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User by an administrator, while the stub resolver will be used by
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User ordinary applications run by a normal user.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Not all common <code class="filename">/etc/resolv.conf</code> options are
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User supported in the IRS library. The only available options in this
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User version are <span class="command"><strong>debug</strong></span> and <span class="command"><strong>ndots</strong></span>.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h3 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.7"></a>The dns.conf File</h3></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User The IRS library supports an "advanced" configuration file related to
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the DNS library for configuration parameters that would be beyond the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User capability of the <code class="filename">resolv.conf</code> file.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Specifically, it is intended to provide DNSSEC related configuration
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User parameters. By default the path to this configuration file is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <code class="filename">/etc/dns.conf</code>. This module is very experimental
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User and the configuration syntax or library interfaces may change in
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User future versions. Currently, only the <span class="command"><strong>trusted-keys</strong></span>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User statement is supported, whose syntax is the same as the same
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User statement in <code class="filename">named.conf</code>. (See
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <a class="xref" href="Bv9ARM.ch06.html#trusted-keys" title="trusted-keys Statement Grammar">the section called “<span class="command"><strong>trusted-keys</strong></span> Statement Grammar”</a> for details.)
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h3 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8"></a>Sample Applications</h3></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Some sample application programs using this API are provided for
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User reference. The following is a brief description of these
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User applications.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.3"></a>sample: a simple stub resolver utility</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Sends a query of a given name (of a given optional RR type) to a
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specified recursive server and prints the result as a list of RRs.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User It can also act as a validating stub resolver if a trust anchor is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User given via a set of command line options.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: sample [options] server_address hostname
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Options and Arguments:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="variablelist"><dl class="variablelist">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify the RR type of the query. The default is the A RR.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">[-a algorithm] [-e] -k keyname -K keystring</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify a command-line DNS key to validate the answer. For
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User example, to specify the following DNSKEY of example.com:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User ��������������example.com.�3600�IN�DNSKEY�257�3�5�xxx<br>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify the options as follows:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<strong class="userinput"><code>-e -k example.com -K "xxx"</code></strong>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User -e means that this key is a zone's "key signing key" (also known
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User as "secure entry point").
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User When -a is omitted rsasha1 will be used by default.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-s domain:alt_server_address</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify a separate recursive server address for the specific
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User "domain". Example: -s example.com:2001:db8::1234
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<dt><span class="term">server_address</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User an IP(v4/v6) address of the recursive server to which queries
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the domain name for the query
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.4"></a>sample-async: a simple stub resolver, working asynchronously</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Similar to "sample", but accepts a list
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User of (query) domain names as a separate file and resolves the names
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User asynchronously.</p>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: sample-async [-s server_address] [-t RR_type] input_file</p>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Options and Arguments:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="variablelist"><dl class="variablelist">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-s server_address</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User an IPv4 address of the recursive server to which queries are sent.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User (IPv6 addresses are not supported in this implementation)
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify the RR type of the queries. The default is the A
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User a list of domain names to be resolved. each line consists of a
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User single domain name. Example:
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.5"></a>sample-request: a simple DNS transaction client</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Sends a query to a specified server, and prints the response with
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User minimal processing. It doesn't act as a "stub resolver": it stops
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the processing once it gets any response from the server, whether
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User it's a referral or an alias (CNAME or DNAME) that would require
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User further queries to get the ultimate answer. In other words, this
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User utility acts as a very simplified <span class="command"><strong>dig</strong></span>.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: sample-request [-t RRtype] server_address hostname
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Options and Arguments:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="variablelist"><dl class="variablelist">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specify the RR type of the queries. The default is the A RR.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">server_address</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User an IP(v4/v6) address of the recursive server to which
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the query is sent.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the domain name for the query
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.6"></a>sample-gai: getaddrinfo() and getnameinfo() test code</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User This is a test program to check <span class="command"><strong>getaddrinfo()</strong></span> and
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>getnameinfo()</strong></span> behavior. It takes a host name as an
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User argument, calls <span class="command"><strong>getaddrinfo()</strong></span> with the given host
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User name, and calls <span class="command"><strong>getnameinfo()</strong></span> with the resulting
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User IP addresses returned by <span class="command"><strong>getaddrinfo()</strong></span>. If the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User dns.conf file exists and defines a trust anchor, the underlying
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User resolver will act as a validating resolver, and
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>getaddrinfo()</strong></span>/<span class="command"><strong>getnameinfo()</strong></span>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User will fail with an EAI_INSECUREDATA error when DNSSEC validation
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: sample-gai hostname
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.7"></a>sample-update: a simple dynamic update client program</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Accepts a single update command as a command-line argument, sends
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User an update request message to the authoritative server, and shows
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User the response from the server. In other words, this is a simplified
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <span class="command"><strong>nsupdate</strong></span>.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: sample-update [options] (add|delete) "update data"
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Options and Arguments:
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="variablelist"><dl class="variablelist">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-a auth_server</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User An IP address of the authoritative server that has authority
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User for the zone containing the update name. This should
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User normally be the primary authoritative server that accepts
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User dynamic updates. It can also be a secondary server that is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User configured to forward update requests to the primary server.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User A TSIG key file to secure the update transaction. The
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User keyfile format is the same as that for the nsupdate utility.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-p prerequisite</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User A prerequisite for the update (only one prerequisite can be
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specified). The prerequisite format is the same as that is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User accepted by the nsupdate utility.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-r recursive_server</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User An IP address of a recursive server that this utility will
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User use. A recursive server may be necessary to identify the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User authoritative server address to which the update request is
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-z zonename</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User The domain name of the zone that contains
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">(add|delete)</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Specify the type of update operation. Either "add" or
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User "delete" must be specified.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">"update data"</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Specify the data to be updated. A typical example of the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User data would look like "name TTL RRtype RDATA".
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User In practice, either -a or -r must be specified. Others can be
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User optional; the underlying library routine tries to identify the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User appropriate server and the zone name for the update.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Examples: assuming the primary authoritative server of the
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User dynamic.example.com zone has an IPv6 address 2001:db8::1234,
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>sample-update -a sample-update -k Kxxx.+nnn+mmmm.key add "foo.dynamic.example.com 30 IN A 192.168.2.1"</code></strong></pre>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User adds an A RR for foo.dynamic.example.com using the given key.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>sample-update -a sample-update -k Kxxx.+nnn+mmmm.key delete "foo.dynamic.example.com 30 IN A"</code></strong></pre>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User removes all A RRs for foo.dynamic.example.com using the given key.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User$ <strong class="userinput"><code>sample-update -a sample-update -k Kxxx.+nnn+mmmm.key delete "foo.dynamic.example.com"</code></strong></pre>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User removes all RRs for foo.dynamic.example.com using the given key.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h4 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.8.8"></a>nsprobe: domain/name server checker in terms of RFC 4074</h4></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Checks a set of domains to see the name servers of the domains
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User behave correctly in terms of RFC 4074. This is included in the set
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User of sample programs to show how the export library can be used in a
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User DNS-related application.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Usage: nsprobe [-d] [-v [-v...]] [-c cache_address] [input_file]
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User <div class="variablelist"><dl class="variablelist">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Run in "debug" mode. With this option nsprobe will dump
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User every RRs it receives.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Increase verbosity of other normal log messages. This can be
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specified multiple times.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<dt><span class="term">-c cache_address</span></dt>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User Specify an IP address of a recursive (caching) name server.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User nsprobe uses this server to get the NS RRset of each domain
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User and the A and/or AAAA RRsets for the name servers. The
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User default value is 127.0.0.1.
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User A file name containing a list of domain (zone) names to be
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User probed. when omitted the standard input will be used. Each
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User line of the input file specifies a single domain name such as
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User "example.com". In general this domain name must be the apex
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User name of some DNS zone (unlike normal "host names" such as
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User "www.example.com"). nsprobe first identifies the NS RRsets
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User for the given domain name, and sends A and AAAA queries to
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User these servers for some "widely used" names under the zone;
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User specifically, adding "www" and "ftp" to the zone name.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<div class="titlepage"><div><div><h3 class="title">
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User<a name="id-1.13.2.9"></a>Library References</h3></div></div></div>
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User As of this writing, there is no formal "manual" for the libraries,
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User except this document, header files (some of which provide pretty
811ccf37deef5ad425a6bfb3a71f6730d4d3ebc4Tinderbox User detailed explanations), and sample application programs.
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<table width="100%" summary="Navigation footer">
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<a accesskey="p" href="Bv9ARM.ch11.html">Prev</a>�</td>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<td width="40%" align="right">�<a accesskey="n" href="Bv9ARM.ch13.html">Next</a>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<td width="40%" align="left" valign="top">Appendix�C.�General <acronym class="acronym">DNS</acronym> Reference Information�</td>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
fae13836a33b474a6aa2c147df8334f5b1ffae45Tinderbox User<td width="40%" align="right" valign="top">�Manual pages</td>
c313914d0e66b20969215e519bbf2ab4ecf39512Tinderbox User<p xmlns:db="http://docbook.org/ns/docbook" style="text-align: center;">BIND 9.11.3 (Extended Support Version)</p>