[dnsdist] modify response ip address

Александр nairashvili at selectel.ru
Tue Aug 1 21:19:35 UTC 2017

Hello everyone.
I've read documentation, but, not being very familiar with lua, didn't 
get some parts of it. And didn't find examples in documentation about 
modifying response packets based on their contents.

My question is, is it possible with current state of dnsdist to spoof A 
and AAAA addresses in response packets based solely on A and AAAA fields?

For example:
Dns query for some random domain (domain is really random, so I can't 
regexp domain name) returns A x.y.z.[1-12] and AAAA xxxx:yyyy:zzzz::[1-12]
(radom ip from 12 possible for each type)

If response matches those addresses I want them to be replaced with some 
other addresses q.p.y.[1-12]
and AAAA qqqq:pppp:yyyy::[1-12] (also randomly from 12 possible for each 

If it's possible would someone mind to give at least a basic snippet of 
code, that may realize this functionality, thanks in advance.

More information about the dnsdist mailing list