Skip to content

IP address renumbering Lua script for PowerDNS Recursor.

License

Notifications You must be signed in to change notification settings

yds/PowerDNS-renumber.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IP address renumbering Lua script for PowerDNS Recursor.

Prior Art

Unbound-Views and the Knot-Resolver renumber module.

Quoting from the OpenBSD pf FAQ:

Often, redirection rules are used to forward incoming connections from the Internet to a local server with a private address in the internal network or LAN, as in:

server = 192.168.1.40

pass in on $ext_if proto tcp from any to $ext_if port 80
rdr-to $server port 80

But when the redirection rule is tested from a client on the LAN, it doesn't work.

Quoting again from the OpenBSD pf FAQ:

It's possible to configure DNS servers to answer queries from local hosts differently than external queries so that local clients will receive the internal server's address during name resolution. They will then connect directly to the local server, and the firewall isn't involved at all. This reduces local traffic since packets don't have to be sent through the firewall.

PowerDNS-renumber implements the Split-Horizon DNS solution with a Lua script for the excellent PowerDNS Recursor.

PowerDNS-renumber Split-Horizon is configured inside the renumber.lua script itself:

local nets = {}
nets['10.16.169'] = newNetmask('172.16.169.0/25')
nets['10.168.42'] = newNetmask('192.168.42.128/25')

With the above example config, if a lookup resolves to 172.16.169.69 then 10.16.169.69 will be returned. Or if a lookup resolves to 192.168.42.222 then 10.168.42.222 will be returned.

Renumbering multiple subnets as in the above example can be used to force LAN to LAN traffic via a VPN tunnel connecting those LANs.

Getting Started

License

See the UNLICENSE.

About

IP address renumbering Lua script for PowerDNS Recursor.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages