<html><body><div><div><span>I am using dnsdist to help route internal DNS traffic at a client site.</span></div><div><span>Each site has one local Windows DNS server that serves an internal domain (i.e. 'somecustomer.local') and a VPN link to all the other sites (each with their own Windows DNS server).</span></div><br><div><span>Every router has an anycast IP (10.100.100.100) that runs dnsdist and everything throughout the network is pointed to it.</span></div><br><div><span>The goal was to make sure we can serve 'somecustomer.local' (the blasted Windows domain) should the local Windows Server go down and also continue to serve external domains without accidentally sending them queries for somecustomer.local.</span></div><br><div><span>Our config is pretty straight forward (slight redaction and notes):</span></div><br><div><span>—</span></div><div><span>setLocal('<a href="http://10.100.100.100:53">10.100.100.100:53</a>')</span></div><div><span>webserver('<a href="http://0.0.0.0:8053">0.0.0.0:8053</a>')</span></div><div><span>setWebserverConfig({password='—redacted—', apiKey='—redacted—', acl='<a href="http://10.0.0.0/8">10.0.0.0/8</a>, <a href="http://127.0.0.1/32'">127.0.0.1/32'</a>})</span></div><div><span>setACL({'<a href="http://10.0.0.0/8">10.0.0.0/8</a>', '<a href="http://127.0.0.0/8''">127.0.0.0/8''</a>})</span></div><div><span>newServer ({address='1.0.0.1', name='cloudflare1', pool='external', qps=50, weight=1})</span></div><div><span>newServer ({address='1.1.1.1', name='cloudflare2', pool='external', qps=50, weight=1})</span></div><br><div><span># The local DC has the highest priority in the somecustomer pool because the VPN is slow.</span></div><div><span>newServer ({address='ip.of.local.windows.dns', name='local-windows-dns', pool='somecustomer', qps=500, weight=2147483647})</span></div><br><div><span>#The following line gets repeated multiple times (once for each remote site):</span></div><div><span>newServer ({address='ip.of.remote.windows.dns', name='chicago-dns', pool='somecustomer', qps=500, weight=1}) # A remote DC has the lowest priority in the somecustomer pool because the VPN is slow.</span></div><div><span>newServer ({address='ip.of.remote.windows.dns', name='portland-dns', pool='somecustomer', qps=500, weight=1}) # A remote DC has the lowest priority in the somecustomer pool because the VPN is slow.</span></div><div><span>...etc...</span></div><br><div><span>setServerPolicy(wrandom)</span></div><br><div><span>addAction({'somecustomer.local'}, PoolAction('somecustomer')) # If anyone queries us for the internal domain, send them to the 'somecustomer' pool.</span></div><div><span>addAction ({</span><a target="_blank" rel="noopener noreferrer" href="http://ip.of.local.windows">ip.of.local.windows</a><span>.dns}, PoolAction('external')) # If the local Windows DNS server queries us, use the 'external' pool</span></div><div><span>addAction({'<a href="http://10.0.0.0/8'">10.0.0.0/8'</a>}, PoolAction('external'))  # if the other rules didn't match and it's coming from our internal IP block, send it to the external DNS servers.</span></div><div><span>—</span></div><br><div><span>This appeared to do exactly what we wanted.  Queries for somecustomer.local we routed to the local DNS server, and everything else was sent on to CloudFlare.</span></div><br><div><span>During testing we took down the local DNS server.  All queries for the internal domain started timing out.</span></div><div><span>The dnsdist web interface showed the local Windows DNS server as being "down", but it was still routing queries to it.</span></div><br><div><span>Does wrandom ignore a server being down and just pay attention to weight?</span></div><br><div><span>As a test, we tried switching to roundrobin.</span></div><br><div><span>When the local Windows DNS server was turned off, queries were still completed by 'remote' Windows DNS servers...but when the local Windows DNS server was working (and showed 'up' in the web interface), it continued to roundrobin queries to non-local Windows DNS servers because roundrobin appears to up/down status, but not weight.</span></div><br><div><span>Do I need to write my own policy in Lua in order to pay attention to </span><i><span>both</span></i><span> the up/down status </span><i><span>and</span></i><span> the weight, or am I missing something?</span></div><br><div><span>Thanks,</span></div><br><div><span>-A</span></div></div></body></html>