Configuration
=============

This section describes how the software that delivers the data to :program:`dstore` should be configured.

For each of the :program:`dstore`-capable sources you want to have events recorded in :program:`dstore`, each source is configured individually.
By default :program:`dstore`\ ’s ``dstore-dist`` expects messages on TCP port 2000.

PowerDNS Recursor
-----------------

The PowerDNS Recursor can be configured to forward queries to :program:`dstore`, with the following setting in ``recursor.conf``::

   lua-config-file=/etc/powerdns/recursor.lua

The Lua configuration file ``recursor.lua`` should then contain a function call to route events from the Recursor to :program:`dstore` on, say, address 192.0.2.10 as follows:

.. code:: lua

   protobufServer("192.0.2.10:2000") -- emit events to dstore

See the PowerDNS Recursor `documentation on Lua configuration <https://doc.powerdns.com/recursor/lua-config/protobuf.html>`__ for more information.

dnsdist
-------

:program:`dnsdist` can also forward queries to :program:`dstore`.
To forward all queries and answers, add the following to ``dnsdist.conf``:

.. code:: lua

  logger = newRemoteLogger('192.0.2.10:2000')
  AddResponseAction(AllRule(), RemoteLogResponseAction(logger))

More information can be found in the `dnsdist documentation <https://dnsdist.org/reference/protobuf.html>`__.
