dnsdist: Add an option to return ServFail when no server is available #4726

Merged
merged 1 commit into from Dec 8, 2016

Projects

None yet

2 participants

@rgacogne
Member
rgacogne commented Dec 2, 2016

Short description

By default dnsdist drops the query if there is no server available to forward it to. This PR adds the setServFailWhenNoServer(bool) directive to reply with a ServFail instead.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added regression tests
@Habbie
Habbie approved these changes Dec 5, 2016 View changes
pdns/README-dnsdist.md
@@ -1385,6 +1385,7 @@ instantiate a server with additional parameters
* `setServerPolicyLua(name, function)`: set server selection policy to one named 'name' and provided by 'function'
* `showServerPolicy()`: show name of currently operational server selection policy
* `newServerPolicy(name, function)`: create a policy object from a Lua function
+ * `setServFailWhenNoServer(bool)`: if set, returns a ServFail when no server are available instead of dropping the query (the default)
@Habbie
Habbie Dec 5, 2016 Member

'if set, return a ServFail when no servers are available, instead of the default behaviour of dropping the query'

pdns/dnsdist-console.cc
@@ -339,6 +339,7 @@ const std::vector<ConsoleKeyword> g_consoleKeywords{
{ "setRules", true, "list of rules", "replace the current rules with the supplied list of pairs of DNS Rules and DNS Actions (see `newRuleAction()`)" },
{ "setServerPolicy", true, "policy", "set server selection policy to that policy" },
{ "setServerPolicyLua", true, "name, function", "set server selection policy to one named 'name' and provided by 'function'" },
+ { "setServFailWhenNoServer", true, "bool", "if set, returns a ServFail when no server are available instead of dropping the query (the default)" },
@Habbie
Habbie Dec 5, 2016 Member

and update same text here. We still need to figure something out against this duplication :)

@rgacogne rgacogne merged commit eb038ad into PowerDNS:master Dec 8, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rgacogne rgacogne deleted the rgacogne:dnsdist-servfail-no-server branch Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment