File: //proc/self/root/usr/share/doc/bind9-doc/arm/chapter10.html
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>10. Building BIND 9 — BIND 9 9.18.39-0ubuntu0.24.04.2-Ubuntu documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=86f27845" />
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=9ab34431" />
<script src="_static/jquery.js?v=8dae8fb0"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=9d4ae9d2"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Release Notes" href="notes.html" />
<link rel="prev" title="9. Troubleshooting" href="chapter9.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
BIND 9
</a>
<div class="version">
9.18.39-0ubuntu0.24.04.2-Ubuntu
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="chapter1.html">1. Introduction to DNS and BIND 9</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter2.html">2. Resource Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter3.html">3. Configurations and Zone Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter4.html">4. Name Server Operations</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter5.html">5. DNSSEC</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter6.html">6. Advanced Configurations</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter7.html">7. Security Configurations</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">8. Configuration Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter9.html">9. Troubleshooting</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">10. Building BIND 9</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#required-libraries">10.1. Required Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="#optional-features">10.2. Optional Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="#macos">10.3. macOS</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Appendices</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="dnssec-guide.html">DNSSEC Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="history.html">A Brief History of the DNS and BIND</a></li>
<li class="toctree-l1"><a class="reference internal" href="general.html">General DNS Reference Information</a></li>
<li class="toctree-l1"><a class="reference internal" href="manpages.html">Manual Pages</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">BIND 9</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active"><span class="section-number">10. </span>Building BIND 9</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/chapter10.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="building-bind-9">
<span id="build-bind"></span><h1><span class="section-number">10. </span>Building BIND 9<a class="headerlink" href="#building-bind-9" title="Link to this heading"></a></h1>
<p>To build on a Unix or Linux system, use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ autoreconf -fi ### (only if building from the git repository)
$ ./configure
$ make
</pre></div>
</div>
<p>Several environment variables affect compilation, and they can be set
before running <code class="docutils literal notranslate"><span class="pre">configure</span></code>. The most significant ones are:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Variable</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CC</span></code></p></td>
<td><p>The C compiler to use. <code class="docutils literal notranslate"><span class="pre">configure</span></code> tries to
figure out the right one for supported systems.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CFLAGS</span></code></p></td>
<td><p>The C compiler flags. Defaults to include -g
and/or -O2 as supported by the compiler. Please
include <code class="docutils literal notranslate"><span class="pre">-g</span></code> if <code class="docutils literal notranslate"><span class="pre">CFLAGS</span></code> needs to be set.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">LDFLAGS</span></code></p></td>
<td><p>The linker flags. Defaults to an empty string.</p></td>
</tr>
</tbody>
</table>
<p>Additional environment variables affecting the build are listed at the
end of the <code class="docutils literal notranslate"><span class="pre">configure</span></code> help text, which can be obtained by running the
command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ ./configure --help
</pre></div>
</div>
<p>If using Emacs, the <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">tags</span></code> command may be helpful.</p>
<section id="required-libraries">
<span id="build-dependencies"></span><h2><span class="section-number">10.1. </span>Required Libraries<a class="headerlink" href="#required-libraries" title="Link to this heading"></a></h2>
<p>To build BIND 9, the following packages must be installed:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">libcrypto</span></code>, <code class="docutils literal notranslate"><span class="pre">libssl</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">libuv</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">perl</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pkg-config</span></code> / <code class="docutils literal notranslate"><span class="pre">pkgconfig</span></code> / <code class="docutils literal notranslate"><span class="pre">pkgconf</span></code></p></li>
</ul>
<p>BIND 9.18 requires <code class="docutils literal notranslate"><span class="pre">libuv</span></code> 1.0.0 or higher; using <code class="docutils literal notranslate"><span class="pre">libuv</span></code> >= 1.40.0
is recommended. Compiling or running with <code class="docutils literal notranslate"><span class="pre">libuv</span></code> 1.35.0 or 1.36.0 is
not supported, as this could lead to an assertion failure in the UDP
receive code. On older systems an updated <code class="docutils literal notranslate"><span class="pre">libuv</span></code> package needs to be
installed from sources, such as EPEL, PPA, or other native sources. The
other option is to build and install <code class="docutils literal notranslate"><span class="pre">libuv</span></code> from source.</p>
<p>OpenSSL 1.0.2e or newer is required. If the OpenSSL library is installed
in a nonstandard location, specify the prefix using
<code class="docutils literal notranslate"><span class="pre">--with-openssl=<PREFIX></span></code> on the <code class="docutils literal notranslate"><span class="pre">configure</span></code> command line. To use a
PKCS#11 hardware service module for cryptographic operations,
<code class="docutils literal notranslate"><span class="pre">engine_pkcs11</span></code> from the OpenSC project must be compiled and used.</p>
<p>To build BIND from the git repository, the following tools must also be
installed:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">autoconf</span></code> (includes <code class="docutils literal notranslate"><span class="pre">autoreconf</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">automake</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">libtool</span></code></p></li>
</ul>
</section>
<section id="optional-features">
<h2><span class="section-number">10.2. </span>Optional Features<a class="headerlink" href="#optional-features" title="Link to this heading"></a></h2>
<p>To see a full list of configuration options, run <code class="docutils literal notranslate"><span class="pre">configure</span> <span class="pre">--help</span></code>.</p>
<p>To improve performance, use of the <code class="docutils literal notranslate"><span class="pre">jemalloc</span></code> library
(<a class="reference external" href="http://jemalloc.net/">http://jemalloc.net/</a>) is strongly recommended.</p>
<p>To support <span class="target" id="index-0"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc8484.html"><strong>DNS over HTTPS (DoH)</strong></a>, the server must be linked
with <code class="docutils literal notranslate"><span class="pre">libnghttp2</span></code> (<a class="reference external" href="https://nghttp2.org/">https://nghttp2.org/</a>). If the library is
unavailable, <code class="docutils literal notranslate"><span class="pre">--disable-doh</span></code> can be used to disable DoH support.</p>
<p>To support the HTTP statistics channel, the server must be linked with
at least one of the following libraries: <code class="docutils literal notranslate"><span class="pre">libxml2</span></code>
(<a class="reference external" href="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home">https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home</a>) or <code class="docutils literal notranslate"><span class="pre">json-c</span></code>
(<a class="reference external" href="https://github.com/json-c/json-c">https://github.com/json-c/json-c</a>). If these are installed at a
nonstandard location, then:</p>
<ul class="simple">
<li><p>for <code class="docutils literal notranslate"><span class="pre">libxml2</span></code>, specify the prefix using <code class="docutils literal notranslate"><span class="pre">--with-libxml2=/prefix</span></code>,</p></li>
<li><p>for <code class="docutils literal notranslate"><span class="pre">json-c</span></code>, adjust <code class="docutils literal notranslate"><span class="pre">PKG_CONFIG_PATH</span></code>.</p></li>
</ul>
<p>To support compression on the HTTP statistics channel, the server must
be linked against <code class="docutils literal notranslate"><span class="pre">zlib</span></code> (<a class="reference external" href="https://zlib.net/">https://zlib.net/</a>). If this is installed in
a nonstandard location, specify the prefix using
<code class="docutils literal notranslate"><span class="pre">--with-zlib=/prefix</span></code>.</p>
<p>To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with <code class="docutils literal notranslate"><span class="pre">liblmdb</span></code>
(<a class="reference external" href="https://github.com/LMDB/lmdb">https://github.com/LMDB/lmdb</a>). If this is installed in a nonstandard
location, specify the prefix using <code class="docutils literal notranslate"><span class="pre">--with-lmdb=/prefix</span></code>.</p>
<p>To support MaxMind GeoIP2 location-based ACLs, the server must be linked
with <code class="docutils literal notranslate"><span class="pre">libmaxminddb</span></code> (<a class="reference external" href="https://maxmind.github.io/libmaxminddb/">https://maxmind.github.io/libmaxminddb/</a>). This is
turned on by default if the library is found; if the library is
installed in a nonstandard location, specify the prefix using
<code class="docutils literal notranslate"><span class="pre">--with-maxminddb=/prefix</span></code>. GeoIP2 support can be switched off with
<code class="docutils literal notranslate"><span class="pre">--disable-geoip</span></code>.</p>
<p>For DNSTAP packet logging, <code class="docutils literal notranslate"><span class="pre">libfstrm</span></code>
(<a class="reference external" href="https://github.com/farsightsec/fstrm">https://github.com/farsightsec/fstrm</a>) and <code class="docutils literal notranslate"><span class="pre">libprotobuf-c</span></code>
(<a class="reference external" href="https://protobuf.dev">https://protobuf.dev</a>) must be installed, and
BIND must be configured with <code class="docutils literal notranslate"><span class="pre">--enable-dnstap</span></code>.</p>
<p>To support internationalized domain names in <a class="reference internal" href="manpages.html#std-iscman-dig"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">dig</span></code></a>, <code class="docutils literal notranslate"><span class="pre">libidn2</span></code>
(<a class="reference external" href="https://www.gnu.org/software/libidn/#libidn2">https://www.gnu.org/software/libidn/#libidn2</a>) must be installed. If the
library is installed in a nonstandard location, specify the prefix using
<code class="docutils literal notranslate"><span class="pre">--with-libidn2=/prefix</span></code> or adjust <code class="docutils literal notranslate"><span class="pre">PKG_CONFIG_PATH</span></code>.</p>
<p>For line editing in <a class="reference internal" href="manpages.html#std-iscman-nsupdate"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">nsupdate</span></code></a> and <a class="reference internal" href="manpages.html#std-iscman-nslookup"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">nslookup</span></code></a>, either the
<code class="docutils literal notranslate"><span class="pre">readline</span></code> (<a class="reference external" href="https://tiswww.case.edu/php/chet/readline/rltop.html">https://tiswww.case.edu/php/chet/readline/rltop.html</a>) or
the <code class="docutils literal notranslate"><span class="pre">libedit</span></code> library (<a class="reference external" href="https://www.thrysoee.dk/editline/">https://www.thrysoee.dk/editline/</a>) must be
installed. If these are installed at a nonstandard location, adjust
<code class="docutils literal notranslate"><span class="pre">PKG_CONFIG_PATH</span></code>. <code class="docutils literal notranslate"><span class="pre">readline</span></code> is used by default, and <code class="docutils literal notranslate"><span class="pre">libedit</span></code>
can be explicitly requested using <code class="docutils literal notranslate"><span class="pre">--with-readline=libedit</span></code>.</p>
<p>Certain compiled-in constants and default settings can be decreased to
values better suited to small machines, e.g. OpenWRT boxes, by
specifying <code class="docutils literal notranslate"><span class="pre">--with-tuning=small</span></code> on the <code class="docutils literal notranslate"><span class="pre">configure</span></code> command line.
This decreases memory usage by using smaller structures, but degrades
performance.</p>
<p>On Linux, process capabilities are managed in user space using the
<code class="docutils literal notranslate"><span class="pre">libcap</span></code> library
(<a class="reference external" href="https://git.kernel.org/pub/scm/libs/libcap/libcap.git/">https://git.kernel.org/pub/scm/libs/libcap/libcap.git/</a>), which can be
installed on most Linux systems via the <code class="docutils literal notranslate"><span class="pre">libcap-dev</span></code> or
<code class="docutils literal notranslate"><span class="pre">libcap-devel</span></code> package. Process capability support can also be
disabled by configuring with <code class="docutils literal notranslate"><span class="pre">--disable-linux-caps</span></code>.</p>
<p>On some platforms it is necessary to explicitly request large file
support to handle files bigger than 2GB. This can be done by using
<code class="docutils literal notranslate"><span class="pre">--enable-largefile</span></code> on the <code class="docutils literal notranslate"><span class="pre">configure</span></code> command line.</p>
<p>Support for the “fixed” RRset-order option can be enabled or disabled by
specifying <code class="docutils literal notranslate"><span class="pre">--enable-fixed-rrset</span></code> or <code class="docutils literal notranslate"><span class="pre">--disable-fixed-rrset</span></code> on the
<code class="docutils literal notranslate"><span class="pre">configure</span></code> command line. By default, fixed RRset-order is disabled to
reduce memory footprint.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">--enable-querytrace</span></code> option causes <a class="reference internal" href="manpages.html#std-iscman-named"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">named</span></code></a> to log every step
while processing every query. The <code class="docutils literal notranslate"><span class="pre">--enable-singletrace</span></code> option turns
on the same verbose tracing, but allows an individual query to be
separately traced by setting its query ID to 0. These options should
only be enabled when debugging, because they have a significant negative
impact on query performance.</p>
<p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code> installs <a class="reference internal" href="manpages.html#std-iscman-named"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">named</span></code></a> and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with
the <code class="docutils literal notranslate"><span class="pre">--prefix</span></code> option when running <code class="docutils literal notranslate"><span class="pre">configure</span></code>.</p>
<p>The option <code class="docutils literal notranslate"><span class="pre">--sysconfdir</span></code> can be specified to set the directory where
configuration files such as <a class="reference internal" href="manpages.html#std-iscman-named.conf"><code class="xref std std-iscman docutils literal notranslate"><span class="pre">named.conf</span></code></a> go by default;
<code class="docutils literal notranslate"><span class="pre">--localstatedir</span></code> can be used to set the default parent directory of
<code class="docutils literal notranslate"><span class="pre">run/named.pid</span></code>. <code class="docutils literal notranslate"><span class="pre">--sysconfdir</span></code> defaults to <code class="docutils literal notranslate"><span class="pre">$prefix/etc</span></code> and
<code class="docutils literal notranslate"><span class="pre">--localstatedir</span></code> defaults to <code class="docutils literal notranslate"><span class="pre">$prefix/var</span></code>.</p>
</section>
<section id="macos">
<h2><span class="section-number">10.3. </span>macOS<a class="headerlink" href="#macos" title="Link to this heading"></a></h2>
<p>Building on macOS assumes that the “Command Tools for Xcode” are
installed. These can be downloaded from
<a class="reference external" href="https://developer.apple.com/xcode/resources/">https://developer.apple.com/xcode/resources/</a> or, if Xcode is already
installed, simply run <code class="docutils literal notranslate"><span class="pre">xcode-select</span> <span class="pre">--install</span></code>. (Note that an Apple ID
may be required to access the download page.)</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="chapter9.html" class="btn btn-neutral float-left" title="9. Troubleshooting" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="notes.html" class="btn btn-neutral float-right" title="Release Notes" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2025, Internet Systems Consortium.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>