The Varnish dns/named director continued
C M4 Shell Makefile
Latest commit dd5d13c Jan 3, 2017 @Dridi Dridi Missing join
Spotted by Felipe W Damasio.

Refs #13
Failed to load latest commit information.
m4 Define PKG_CHECK_VAR for older platforms May 16, 2016
.gitignore Clean up gitignore Oct 6, 2016
.travis.yml Update travis-ci to work with Varnish 4.0. Oct 9, 2014
LICENSE Bump debian package version to 0.2 too Feb 19, 2016
README.rst Merge latest install instructions of vmod-example Oct 5, 2016
vmod-dynamic.spec rename the foundling Sep 16, 2016




The purpose of this module is to provide a dynamic director similar to the DNS director from Varnish 3. It also was previously known as vmod-named. This is not a drop-in replacement for the DNS director, because in Varnish 3 the director had two modes of execution that aren't compatible with changes in the backend and director subsystems introduced by Varnish 4.0.

Instead a dynamic director relies on dynamic backends, supports white-listing and even probes. However, just like the DNS director from Varnish 3 it has limited capabilities because it relies on the system's resolver. It builds against Varnish 4.1.2 and later versions.

Further documentation is available in the manual page vmod_dynamic(3).


The source tree is based on autotools to configure the building, and does also have the necessary bits in place to do functional unit tests using the varnishtest tool.

Building requires the Varnish header files and uses pkg-config to find the necessary paths.



If you have installed Varnish to a non-standard directory, call and configure with PKG_CONFIG_PATH pointing to the appropriate path. For instance, when varnishd configure was called with --prefix=$PREFIX, use

export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export ACLOCAL_PATH=${PREFIX}/share/aclocal

The module will inherit its prefix from Varnish, unless you specify a different --prefix when running the configure script for this module.

Make targets:

  • make - builds the vmod.
  • make install - installs your vmod.
  • make check - runs the unit tests in src/tests/*.vtc.
  • make distcheck - run check and prepare a tarball of the vmod.

If you build a dist tarball, you don't need any of the autotools, only pkg-config and Varnish. You can build the module simply by running:


For the test suite to work, please add this line to your /etc/hosts: www.localhost img.localhost

then run:

make check

Alternatively, the make check can also be skipped.

You can then proceed with the installation:

sudo make install

Installation directories

By default, the vmod configure script installs the built vmod in the directory relevant to the prefix. The vmod installation directory can be overridden by passing the vmoddir variable to make install.


Instead of directly installing the package you can build an RPM:

make dist
rpmbuild -tb *.tar.gz

If you need to build an RPM for a different platform you may use mock(1):

make dist
mock --buildsrpm --resultdir . --sources . --spec vmod-querystring.spec
mock --rebuild   --resultdir . *.src.rpm

See also

If you want to learn more about DNS, you can start with RFC 1034 and other RFCs that updated it over time. You may also have DNS already in place, or may be interested in setting up a name server in your infrastructure. Below is a non-exhaustive list of tools and services, but for free software name servers you can have a look at debianadmin.

DNS in the cloud (in alphabetic order):

DNS and containers (in alphabetic order):