Scripting The RecursorΒΆ

In the PowerDNS recursor, it is possible to modify resolving behaviour using simple scripts written in the Lua programming language.

Note: This describes the Lua scripts as supported by 4.x. They are very different than the ones from 3.x, but tend to be faster and more correct.

These scripts can be used to quickly override dangerous domains, fix things that are wrong, for load balancing or for legal or commercial purposes. The scripts can also protect you or your users from malicious traffic.

Lua is extremely fast and lightweight, easily supporting hundreds of thousands of queries per second. The Lua language is explained very well in the excellent book Programming in Lua. If you already have programming experience, Learn Lua in 15 Minutes is a great primer.

For extra performance, a Just In Time compiled version of Lua called LuaJIT is supported.