dnsdist.service: dnsdist.service.in
$(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@
+dnsdist@.service: dnsdist.service
+ $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@
+
systemdsystemunitdir = $(SYSTEMD_DIR)
systemdsystemunit_DATA = \
- dnsdist.service
+ dnsdist.service \
+ dnsdist@.service
endif
if !HAVE_LUA_HPP
--- /dev/null
+Running multiple instances
+==========================
+
+Sometimes, it can be advantageous to run multiple instances of :prog:`dnsdist`.
+Usecases can be:
+
+ * Multiple inbound IP addresses with different rulesets
+ * Taking advantage of more processes, using SO_REUSEPORT
+
+:prog:`dnsdist` supports loading a different configuration file with the ``--config`` command line switch.
+
+By default, ``SYSCONFDIR/dnsdist.conf`` is loaded. ``SYSCONFDIR`` is usually ``/etc`` or ``/etc/dnsdist``.
+
+Using systemd
+-------------
+.. versionadded:: 1.3.0
+
+On systems with systemd, instance services can be used.
+To create a dnsdist service named ``foo``, create a ``dnsdist-foo.conf`` in ``SYSCONFDIR``, then run ``systemctl enable dnsdist@foo.service`` and ``systemctl start dnsdist@foo.service``.