setLocal('172.22.23.4')
addLocal('[::1]:5300')
setACL({
'127.0.0.1',
'10.0.0.0/8',
'172.16.0.0/12',
'192.168.0.0/16'
})
newServer({address="1.1.1.1", pool="dnsServers2"})
newServer({address="8.8.8.8", pool="dnsServers1"})
newServer({address="9.9.9.9", tcpOnly=true})
newServer({address="8.8.4.4"})
newServer({address="8.8.4.4" useClientSubnet=true})
setServerPolicy()
leastOutstanding
- Send query to the server with the lowest number of active query processesfirstAvailable
- Send query to first server that hasn't exceeded its QPS limitwrandom
- Question are distributed randomly. Weight can be applied with parameter in newServer()
whashed
- Questions with identical hashes are sent to the same serverchashed
- Identical questions with identical hashes sent to the same serverroundrobin
- Send questions to the next server in line.defaultCache = newPacketCache(10000, {maxTTL=86400, minTTL=0, temporaryFailureTTL=60, staleTTL=60, dontAge=false})
getPool(""):setCache(defaultCache)
defaultCache
→ Variable defining a new cachenewPacketCache
→ Create a new cache with the following parameters
10000
→ The maximum entries the cache will store. Only required value.maxTTL
→ Max lifetime of an entry in the cacheminTTL
→ The minimum TTL a record should have to be considered for cachingtemporaryFailureTTL
→ TTL used for Server Failure or Refused responsesstaleTTL
→ TTL used when a stale entry is returneddontAge
→ If True, cached record's TTL will no be reduced (Sticky records)getPool("")
→ Selects the default server pool (empty string)setCache
→ Selects the predefined cache to use with the latter defined server poolEDNS Client Subnet
This will pass the source address of the query to the backend server.
setECSSourcePrefixV4(32) <-- Default is 24
setECSSourcePrefixV6(128) <-- Default is 56
When creating a new server
newServer({address="1.1.1.1", useClientSubnet=true})
To override an existing ECS tag on an incoming query
setECSOverride(true)
Use double hyphen to add a comment in dnsdist config
--