Skip to content
Nick Saika edited this page Oct 13, 2017 · 7 revisions

Getting the source code

$ git clone https://github.com/GlobalCyberAlliance/pdns
$ cd pdns
$ git checkout -b dnsdist-named-caches origin/dnsdist-named-caches

Building dnsdist with the named caches feature

Build dependencies

OS X/macOS

The following items can be installed using Homebrew:

  • ragel
  • boost
  • openssl
  • libtool
  • tinycdb
  • automake
  • libsodium
  • re2 (if compiling with --enable-re2)
  • luajit (if compiling with --with-luajit, which you should be)
Linux
Arch Linux

The package names for the build dependencies on Arch Linux are identical to those for OS X.

CentOS 7.3

First, you will need to enable the EPEL repositories, and then re-build your yum(8) cache:

$ sudo yum install -y epel-release
$ sudo yum makecache

Next, install the following packages:

  • "@Development Tools" — this is a package group, and it contains stuff like Git, m4, automake, etc.
  • boost-devel
  • libedit-devel
  • libsodium-devel
  • luajit-devel
  • openssl-devel
  • protobuf-devel
  • ragel-devel
  • re2-devel
  • tinycdb-devel

The following packages are also required, but should be already installed:

  • libtool

Optional:

  • python-virtualenv (for building documentation)

Build commands

The following commands will result in an unstripped dnsdist binary:

$ cd pdns/dnsdistdist
$ autoreconf -i
$ ./configure --with-luajit --enable-dnscrypt --enable-libsodium --enable-re2  --with-libboost --enable-namedcache
$ make

NOTE: OSX users must run export CPPFLAGS="-D_DARWIN_C_SOURCE" before running above because of an XCode 9 bug.

NOTE: The --with-luajit flag is recommended, as that is what we are using in production.

NOTE: The flags provided to ./configure are the same flags that are currently being used when built for production.

Running dnsdist

After you have built dnsdist, run

$ ./dnsdist --local 127.0.0.1:50053

This will start dnsdist listening on 127.0.0.1:50053, and will drop you into a Lua command shell.