From 5d31a326617f6d262455a318a64d57f120a64696 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 24 Jul 2017 17:19:29 +0200 Subject: [PATCH] dnsdist: Add missing `newServer` options, pool management functions to the docs --- pdns/dnsdist-console.cc | 2 ++ pdns/dnsdistdist/docs/advanced/axfr.rst | 4 +-- pdns/dnsdistdist/docs/reference/config.rst | 36 ++++++++++++++++------ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index 2034989b2..6a28b5437 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -315,6 +315,7 @@ const std::vector g_consoleKeywords{ { "generateDNSCryptCertificate", true, "\"/path/to/providerPrivate.key\", \"/path/to/resolver.cert\", \"/path/to/resolver.key\", serial, validFrom, validUntil", "generate a new resolver private key and related certificate, valid from the `validFrom` timestamp until the `validUntil` one, signed with the provider private key" }, { "generateDNSCryptProviderKeys", true, "\"/path/to/providerPublic.key\", \"/path/to/providerPrivate.key\"", "generate a new provider keypair" }, { "getDNSCryptBind", true, "n", "return the `DNSCryptContext` object corresponding to the bind `n`" }, + { "getPool", true, "name", "return the pool named `name`, or \"\" for the default pool" }, { "getPoolServers", true, "pool", "return servers part of this pool" }, { "getQueryCounters", true, "[max=10]", "show current buffer of query counters, limited by 'max' if provided" }, { "getResponseRing", true, "", "return the current content of the response ring" }, @@ -391,6 +392,7 @@ const std::vector g_consoleKeywords{ { "showCacheHitResponseRules", true, "", "show all defined cache hit response rules" }, { "showDNSCryptBinds", true, "", "display the currently configured DNSCrypt binds" }, { "showDynBlocks", true, "", "show dynamic blocks in force" }, + { "showPools", true, "", "show the available pools" }, { "showPoolServerPolicy", true, "pool", "show server selection policy for this pool" }, { "showResponseLatency", true, "", "show a plot of the response time latency distribution" }, { "showResponseRules", true, "", "show all defined response rules" }, diff --git a/pdns/dnsdistdist/docs/advanced/axfr.rst b/pdns/dnsdistdist/docs/advanced/axfr.rst index 574714a12..dcc787ea4 100644 --- a/pdns/dnsdistdist/docs/advanced/axfr.rst +++ b/pdns/dnsdistdist/docs/advanced/axfr.rst @@ -16,7 +16,7 @@ The first issue can be solved by routing SOA, AXFR and IXFR requests explicitly addAction(OrRule({QTypeRule(dnsdist.SOA), QTypeRule(dnsdist.AXFR), QTypeRule(dnsdist.IXFR)}), PoolAction("master")) The second one might require allowing AXFR/IXFR from the :program:`dnsdist` source address -and moving the source address check on :program:`dnsdist`'s side:: +and moving the source address check to :program:`dnsdist`'s side:: addAction(AndRule({OrRule({QTypeRule(dnsdist.AXFR), QTypeRule(dnsdist.IXFR)}), NotRule(makeRule("192.168.1.0/24"))}), RCodeAction(dnsdist.REFUSED)) @@ -24,7 +24,7 @@ When :program:`dnsdist` is deployed in front of slaves, however, an issue might queries, because the slave will receive a notification coming from the :program:`dnsdist` address, and not the master's one. One way to fix this issue is to allow NOTIFY from the :program:`dnsdist` address on the slave side (for example with PowerDNS's `trusted-notification-proxy`) and move the address -check on :program:`dnsdist`'s side:: +check to :program:`dnsdist`'s side:: addAction(AndRule({OpcodeRule(DNSOpcode.Notify), NotRule(makeRule("192.168.1.0/24"))}), RCodeAction(dnsdist.REFUSED)) diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 339691419..108a70f2f 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -77,8 +77,9 @@ Listen Sockets 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: Set to a number higher than 0 to enable TCP Fast Open - when available. Default is 0. + :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:: setLocal(address[, options]) @@ -102,8 +103,9 @@ Listen Sockets 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: Set to a number higher than 0 to enable TCP Fast Open - when available. Default is 0. + :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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -207,11 +209,13 @@ Servers qps=NUM, -- Limit the number of queries per second to NUM order=NUM, -- The order of this server weight=NUM, -- The weight of this server - pool=STRING, -- The pool this server belongs to (unset or empty string means default pool) - retries=NUM, -- - tcpConnectTimeout=NUM, -- - tcpSendTimeout=NUM, -- - tcpRecvTimeout=NUM, -- + pool=STRING|{STRING}, -- The pools this server belongs to (unset or empty string means default pool) as a string or table of strings + retries=NUM, -- The number of TCP connection attempts to the backend, for a given query + tcpConnectTimeout=NUM, -- The timeout (in seconds) of a TCP connection attempt + tcpSendTimeout=NUM, -- The timeout (in seconds) of a TCP write attempt + tcpRecvTimeout=NUM, -- The timeout (in seconds) of a TCP read attempt + tcpFastOpen=BOOL, -- Whether to enable TCP Fast Open + name=STRING, -- The name associated to this backend, for display purpose checkName=STRING, -- Use STRING as QNAME in the health-check query, default: "a.root-servers.net." checkType=STRING, -- Use STRING as QTYPE in the health-check query, default: "A" setCD=BOOL, -- Set the CD (Checking Disabled) flag in the health-check query, default: false @@ -335,7 +339,13 @@ Pools ----- :class:`Server`\ s can be part of any number of pools. -Pools are automatically created when a server is added to a pool (with :func:`newServer`). +Pools are automatically created when a server is added to a pool (with :func:`newServer`), or can be manually created with :func:`addPool`. + +.. function:: addPool(name) -> ServerPool + + Returns a :class:`ServerPool`. + + :param string name: The name of the pool to create .. function:: getPool(name) -> ServerPool @@ -343,6 +353,12 @@ Pools are automatically created when a server is added to a pool (with :func:`ne :param string name: The name of the pool +.. function:: rmPool(name) + + Remove the pool named `name`. + + :param string name: The name of the pool to remove + .. function:: getPoolServers(name) -> [ Server ] Returns a list of :class:`Server`\ s or nil. -- 2.40.0