[dns-operations] Custom DNS server as backend for authoritative DNS server

bert hubert bert.hubert at powerdns.com
Fri Mar 15 08:55:02 UTC 2019


On Thu, Mar 14, 2019 at 07:41:52PM -0600, Casey Deccio wrote:

> Thanks for the ideas.  Earlier today I glanced through the dnsdist docs
> and saw some rules for balancing based on IP addresses.  It wasn't
> immediately clear how I might determine backend IP (and port?) based on
> query name, but someone else suggested off-list that it was possible.  I
> suppose I might need to spend some time looking through the docs and
> finding some solid examples.

Hi Casey,

dnsdist will do what you want, but it appears we have made our documentation
very hard to use. All through best intentions I hasten to add. Or I can't
find the right page, but if I can't find it it is still a problem.

What you would do in this case is create two servers,

newServer({address="127.0.0.1:5301", name="special1", pool="special"})
newServer({address="127.0.0.1:53", name="bind"})


By default all traffic goes to "bind", as it is in the default pool.

You then do:

addAction("yourspecialdomain.com", PoolAction("special"))

This will in fact match everything within yourspecialdomain.com. It will not
match 123yourspecialdomain.com. If you have to match thousands or millions
of domain names we have dedicated ways to do that.

> I also looked at using LUA records, but I'm generating TXT records based
> on the query name, and I also wasn't sure if that was possible with the
> PowerDNS/LUA, at least it wasn't clear from the examples.


This is an example:
whoami.lua     IN LUA TXT  "who:toString()" 

To use actual Lua, start the record with ";" and then Lua away based on the
'who'. 

https://blog.powerdns.com/2017/12/15/powerdns-authoritative-lua-records/
https://doc.powerdns.com/authoritative/lua-records/index.html

Good luck!

	Bert



More information about the dns-operations mailing list