[dnsdist] Using server names for a custom serverPolicy

Thib D thibmac0241 at gmail.com
Mon Mar 27 10:37:20 UTC 2017


Hello,

I am currently working on a custom serverPolicy function.

Here is a sample of the serverPolicy I made :

        if not (servers[1]:isUp() and servers[2]:isUp()) then
                servers[4].order = 1
        else if not (servers[4].order == 2) then
                servers[4].order = 2
        end
        end

This is working as expected, but I want to use a server name instead of
using the table servers[].
The sample also works using the getServer(n) method instead of servers[n].
Obviously, It is better to call servers by their name (because it is not
going to change) instead of a number that can change if we add more servers.


Basically,I would like something like this

        if not (dns1:isUp() and dns2:isUp()) then
                dns4.order = 1
        else if not dns4.order == 2) then
                dns4.order = 2
        end
        end

Thank you for your help,

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20170327/f293fe58/attachment.html>


More information about the dnsdist mailing list