Compiling :program:`PowerDNS Recursor` ====================================== As :program:`PowerDNS Recursor` is distributed with a configure script, compiling it is a matter of:: tar xf pdns-recursor-$VERSION.tar.bz2 cd pdns-recursor-$VERSION ./configure make make install Getting the sources ------------------- .. warning:: Do not use the tarballs auto-generated by GitHub from the tags, as these are not proper release tarballs. There are 3 ways of getting the source. If you want the bleeding edge, you can clone the `repository at GitHub `__ and run ``autoreconf -vi`` in the ``pdns/recursordist`` directory of the clone. You can also download `snapshot tarballs `__. You can also download releases on the `website `__. These releases are PGP-signed with one of these key-ids: .. include:: ../common/tarball-pgp-keys.rst Dependencies ------------ To build :program:`PowerDNS Recursor`, a C++ compiler with support for C++ 2017 is required. This means ``gcc 5`` and newer and ``clang 5`` and newer. Furthermore, the Makefiles require GNU ``make``, not BSD ``make``. Starting with version 5, a Rust compiler is needed. By default, the :program:`Recursor` requires the following libraries and headers: * `Boost `_ 1.35 or newer * `Lua `_ 5.1+ or `LuaJit `_ * `OpenSSL `_ * For :program:`Recursor` version 5 and higher, `cargo `_ version 1.64 or newer. .. note:: On Debian and Ubuntu, the following will get you the dependencies:: apt-get install libboost-dev libboost-filesystem-dev libboost-serialization-dev \ libboost-system-dev libboost-thread-dev libboost-context-dev \ libboost-test-dev libssl-dev libboost-test-dev g++ make pkg-config \ libluajit-5.1-dev cargo Compiling from a git checkout ----------------------------- Source code is available on GitHub:: git clone https://github.com/PowerDNS/pdns.git This repository contains the sources for the PowerDNS Recursor, the PowerDNS Authoritative Server, and dnsdist (a powerful DNS loadbalancer). The sources for the recursor are located in the `pdns/recursordist` subdirectory of the repository. To compile from a git checkout, install the dependencies above plus ragel, automake, autoconf, libtool, virtualenv and curl. Then run:: cd pdns/pdns/recursordist/ autoreconf -vi ./configure make macOS Notes ----------- If you want to compile yourself, the dependencies can be installed using Homebrew. You need to tell configure where to find OpenSSL, too:: brew install boost lua pkg-config ragel openssl ./configure PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig make -j4 Lua scripting ^^^^^^^^^^^^^ To benefit from Lua scripting, as described on https://doc.powerdns.com/md/recursor/scripting/ Install Lua and development headers. PowerDNS supports Lua 5.1, 5.2, 5.3 and LuaJIT. On Debian/Ubuntu, install e.g. `liblua5.2-dev` to use Lua 5.2. The configure script will automatically detect the Lua version. If more than one version of Lua is installed, the `--with-lua` configure flag can be set to the desired version. e.g.:: ./configure --with-lua=lua51 (On older versions of Debian/Ubuntu, you'll need to pass `--with-lua=lua5.1` instead.) Optional dependencies --------------------- Several options that can be passed to ``./configure`` can enable and disable different features. These will require additional dependencies ed25519 support with libsodium ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The :program:`Recursor` can link with `libsodium `_ to support ed25519 (DNSSEC algorithm 15). To detect libsodium, use the ``--with-libsodium`` configure option. .. versionchanged:: 4.2.0 This option was previously ``--enable-libsodium`` ed25519 and ed448 support with libdecaf ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `libdecaf `_ is a library that allows :program:`Recursor` to support ed25519 and Ed448 (DNSSEC algorithms 15 and 16). To detect libdecaf, use the ``--with-libdecaf`` configure option. .. versionchanged:: 4.2.0 This option was previously ``--enable-libdecaf`` Protobuf to emit DNS logs ^^^^^^^^^^^^^^^^^^^^^^^^^ The :program:`Recursor` can log DNS query information over :doc:`Protocol Buffers <../lua-config/protobuf>`. This functionality from 4.5.0 and upwards, without needing any external library. Before 4.5.0, installing the `protobuf `_ library and compiler is required to enable this functionality. The configure script will automatically detect this and bump the Boost version dependency to 1.42. To disable building this functionality before 4.5.0, use ``--without-protobuf``. ``systemd`` notify support ^^^^^^^^^^^^^^^^^^^^^^^^^^ During configure, ``configure`` will attempt to detect the availability of `systemd or systemd-daemon `_ headers. To force the use of ``systemd`` (and failing configure if the headers do not exist), use ``--enable-systemd``. To set the directory where the unit files should be installed, use ``--with-systemd=/path/to/unit/dir``. .. note:: If you want systemd support, you will need to install the corresponding development package. On Debian and Ubuntu, this means `apt install libsystemd-dev`. Documentation ------------- After compiling, run `pdns\_recursor --config` to view the configuration options and a short description. The full documentation is online at https://doc.powerdns.com/recursor/