%{_mandir}/man1/pdns-zone2ldap.1.gz
%{_mandir}/man1/pdnsutil.1.gz
%{_unitdir}/pdns.service
+%{_unitdir}/pdns@.service
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/librandombackend.so
%dir %{_sysconfdir}/%{name}/
%{_mandir}/man1/pdns-zone2ldap.1.gz
%{_mandir}/man1/pdnsutil.1.gz
%{_unitdir}/pdns.service
+%{_unitdir}/pdns@.service
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/librandombackend.so
%dir %{_sysconfdir}/%{name}/
single host, for example to make sure that different customers cannot affect
each others zones. PowerDNS fully supports running multiple instances on one host.
-To generate additional PowerDNS instances, copy the init.d script `pdns` to
-`pdns-name`, where `name` is the name of your virtual configuration. Must not
-contain a - as this will confuse the script.
+To generate additional PowerDNS instances, create a `pdns-NAME.conf` in your
+configuration directory (usually `/etc/powerdns`), where `NAME` is the name of
+your virtual configuration.
-When you launch PowerDNS via this renamed script, it will seek configuration
-instructions not in `pdns.conf` but in `pdns-name.conf`, allowing for separate
-specification of parameters.
+Following one of the following instructions, PowerDNS will read its configuration
+from the `pdns-NAME.conf` instead of `pdns.conf`.
+
+## Starting virtual instances with Sysv init-scripts
+Symlink the init.d script `pdns` to `pdns-NAME`, where `NAME` is the name of your
+virtual configuration. **Note**: `NAME` must not contain a '-' as this will
+confuse the script.
Internally, the init script calls the binary with the
[`config-name`](settings.md#config-name) option set to `name`, setting in motion
**Warning**: Be aware however that the init.d `force-stop` will kill all
PowerDNS instances!
-**Warning**: For systems running systemd, virtual hosting is not yet supported.
+## Starting virtual instances with systemd
+With systemd it is as simple as calling the correct service instance. Assuming your
+instance is called `myinstance` and `pdns-myinstance.conf` exists in the configuration
+directory, the following command will start the service:
+```
+systemctl start pdns@myinstance.service
+```
+
+Similarly you can enable it at boot:
+```
+systemctl enable pdns@myinstance.service
+```
# Internals
## How PowerDNS translates DNS queries into backend queries
pdns.service: pdns.service.in
$(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@
+pdns@.service: pdns.service
+ $(AM_V_GEN)sed -e 's!/pdns_server!& --config-name=%i!' \
+ -e 's!Authoritative Server!& %i!' \
+ < $< > $@
+
systemdsystemunitdir = $(SYSTEMD_DIR)
systemdsystemunit_DATA = \
- pdns.service
+ pdns.service \
+ pdns@.service
endif