This will bind to both UDP and TCP on port 5300 with SO_REUSEPORT enabled.
-.. function:: addLocal(address[[[,do_tcp], so_reuseport], tcp_fast_open_qsize])
-
- .. deprecated:: 1.2.0
-
- Add to the list of addresses listened on.
-
- :param str address: The IP Address with an optional port to listen on.
- The default port is 53.
- :param bool do_tcp: Also bind a TCP port on ``address``, defaults to true.
- :param bool so_reuseport: Use ``SO_REUSEPORT`` if it is available, defaults to false
- :param int tcp_fast_open_qsize: The size of the TCP Fast Open queue. Set to a number
- higher than 0 to enable TCP Fast Open when available.
- Default is 0.
-
.. function:: addDOHLocal(address, [certFile(s) [, keyFile(s) [, urls [, options]]]])
.. versionadded:: 1.4.0
The options that can be set are the same as :func:`addLocal`.
-.. function:: setLocal(address[[[,do_tcp], so_reuseport], tcp_fast_open_qsize])
-
- .. deprecated:: 1.2.0
-
- Remove the list of listen addresses and add a new one.
-
- :param str address: The IP Address with an optional port to listen on.
- The default port is 53.
- :param bool do_tcp: Also bind a TCP port on ``address``, defaults to true.
- :param bool so_reuseport: Use ``SO_REUSEPORT`` if it is available, defaults to false
- :param int tcp_fast_open_qsize: The size of the TCP Fast Open queue. Set to a number
- higher than 0 to enable TCP Fast Open when available.
- Default is 0.
-
Control Socket, Console and Webserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:program:`dnsdist` contains several functions that make it easier to add actions and rules.
-.. function:: addAnyTCRule()
-
- .. deprecated:: 1.2.0
-
- Set the TC-bit (truncate) on ANY queries received over UDP, forcing a retry over TCP.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0. This is equivalent to doing::
-
- addAction(AndRule({QTypeRule(DNSQType.ANY), TCPRule(false)}), TCAction())
-
- .. versionchanged:: 1.4.0
- Before 1.4.0, the QTypes were in the ``dnsdist`` namespace. Use ``dnsdist.ANY`` in these versions.
-
-.. function:: addDelay(DNSrule, delay)
-
- .. deprecated:: 1.2.0
-
- Delay the query for ``delay`` milliseconds before sending to a backend.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, please use instead:
-
- addAction(DNSRule, DelayAction(delay))
-
- :param DNSRule: The DNSRule to match traffic
- :param int delay: The delay time in milliseconds.
-
-.. function:: addDisableValidationRule(DNSrule)
-
- .. deprecated:: 1.2.0
-
- Set the CD (Checking Disabled) flag to 1 for all queries matching the DNSRule.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0. Please use the :func:`SetDisableValidationAction` action instead.
-
-.. function:: addDomainBlock(domain)
-
- .. deprecated:: 1.2.0
-
- Drop all queries for ``domain`` and all names below it.
- Deprecated as of 1.2.0 and will be removed in 1.3.0, please use instead:
-
- addAction(domain, DropAction())
-
- :param string domain: The domain name to block
-
-.. function:: addDomainSpoof(domain, IPv4[, IPv6])
- addDomainSpoof(domain, {IP[,...]})
-
- .. deprecated:: 1.2.0
-
- Generate answers for A/AAAA/ANY queries.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, please use:
-
- addAction(domain, SpoofAction({IP[,...]}))
-
- or:
-
- addAction(domain, SpoofAction(IPv4[, IPv6]))
-
- :param string domain: Domain name to spoof for
- :param string IPv4: IPv4 address to spoof in the reply
- :param string IPv6: IPv6 address to spoof in the reply
- :param string IP: IP address to spoof in the reply
-
-.. function:: addDomainCNAMESpoof(domain, cname)
-
- .. deprecated:: 1.2.0
-
- Generate CNAME answers for queries. This function has been deprecated as of 1.2.0 and removed in 1.3.0, in favor of using:
-
- addAction(domain, SpoofCNAMEAction(cname))
-
- :param string domain: Domain name to spoof for
- :param string cname: Domain name to add CNAME to
-
.. function:: addLuaAction(DNSrule, function [, options])
.. deprecated:: 1.4.0
* ``uuid``: string - UUID to assign to the new rule. By default a random UUID is generated for each rule.
-.. function:: addNoRecurseRule(DNSrule)
-
- .. deprecated:: 1.2.0
-
- Clear the RD flag for all queries matching the rule.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, please use:
-
- addAction(DNSRule, SetNoRecurseAction())
-
- :param DNSRule: match queries based on this rule
-
-.. function:: addPoolRule(DNSRule, pool)
-
- .. deprecated:: 1.2.0
-
- Send queries matching the first argument to the pool ``pool``.
- e.g.::
-
- addPoolRule("example.com", "myPool")
-
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, this is equivalent to::
-
- addAction("example.com", PoolAction("myPool"))
-
- :param DNSRule: match queries based on this rule
- :param string pool: The name of the pool to send the queries to
-
-.. function:: addQPSLimit(DNSrule, limit)
-
- .. deprecated:: 1.2.0
-
- Limit queries matching the DNSRule to ``limit`` queries per second.
- All queries over the limit are dropped.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, please use:
-
- addAction(DNSRule, QPSAction(limit))
-
- :param DNSRule: match queries based on this rule
- :param int limit: QPS limit for this rule
-
-.. function:: addQPSPoolRule(DNSRule, limit, pool)
-
- .. deprecated:: 1.2.0
-
- Send at most ``limit`` queries/s for this pool, letting the subsequent rules apply otherwise.
- This function has been deprecated as of 1.2.0 and removed in 1.3.0, as it is only a convenience function for the following syntax::
-
- addAction("192.0.2.0/24", QPSPoolAction(15, "myPool")
-
- :param DNSRule: match queries based on this rule
- :param int limit: QPS limit for this rule
- :param string pool: The name of the pool to send the queries to
-
-
Managing Rules
--------------