[dnsdist] leastOutstanding - With priority

Chris lists at shthead.net
Thu Jan 5 08:46:15 UTC 2017


Hello,

I am using dnsdist now with great success, except for one thing that I 
am trying to figure out if its possible to do within dnsdist.

My pools have 3 backend servers configured. I am using the server policy 
"leastOutstanding". Before I moved to dnsdist my DNS servers were setup 
like this:

dns1 - Active
dns2 - Active
dns-slave - Standby

The standby server has lagged MySQL replication, so that if there is a 
failure with the DB records (eg. someone runs a badly formed query that 
updates all records/deletes all records) it gives us time to stop 
replication, failover everything (I was using BGP to manage this, the 
routes were withdrawn if certain things went missing from the active DNS 
servers and the dns-slave route with the higher metric would take over) 
to the slave server which doesn't have the changes yet and give us a bit 
of time to recover everything without causing a large outage. I found 
this was the easiest way for us to scale out our PowerDNS instances and 
recover from potential issues like this quickly (~3M authoratative zones).

What I was hoping to achieve is to be able to keep this same setup with 
dnsdist. It would be nice if there was a way to use the order parameter 
like this:

newServer({address="192.168.90.1:5356", name="dns1.au-internal", 
pool="recursor", checkType="A", checkName="a.root-servers.net.", 
mustResolve=true, tcpRecvTimeout=10, tcpSendTimeout=10, retries=5, 
useClientSubnet=true, order=1})
newServer({address="192.168.90.2:5356", name="dns2.au-internal", 
pool="recursor", checkType="A", checkName="a.root-servers.net.", 
mustResolve=true, tcpRecvTimeout=10, tcpSendTimeout=10, retries=5, 
useClientSubnet=true, order=1})
newServer({address="192.168.90.3:5356", name="dns-slave.au-internal", 
pool="recursor", checkType="A", checkName="b.root-servers.net.", 
mustResolve=true, tcpRecvTimeout=10, tcpSendTimeout=10, retries=5, 
useClientSubnet=true, order=10})

And make all queries only use the servers dns1.au-internal and 
dns2.au-internal UNLESS they are both not working, then use the higher 
ordered server.

I can do this other ways (outside of dnsdist) but it would be nice if 
its all handled in dnsdist, so I was hoping one of these would be possible:

- Is it possible to direct all queries to a different pool if there are 
no available servers in another pool? Keep in mind I cannot use a 
default pool as I direct queries to the appropriate pool based on the 
destination address (so that I only have to run a single instance of 
dnsdist for my various recursor/authoratative servers).
- Is it possible to tweak the load balancing policy to take the order 
into account to do this instead?

I had a play with the lua scripting but couldn't find a way to keep both 
the leastOutstanding policy + failover working.

Thanks


More information about the dnsdist mailing list