[Pdns-users] Split Horizon Scripts
twiztar at gmail.com
Tue Nov 15 07:24:55 UTC 2011
On Tue, Nov 15, 2011 at 7:42 AM, Daniel L. Miller <dmiller at amfes.com> wrote:
> On 11/14/2011 1:28 PM, Erik Weber wrote:
>> In Lua you have to escape the dash in string.find with a %-sign.
>> if string.find(domain,"lv%-mircom.us.") ......
> I figured it would be something like that - thanks!!!
> Is there a "better" way to do this (read: more efficient or scalable)? I
> assume the processing overhead is negligible due to the caching? - when
> watching the logs, looks like the script only gets run once for a given
I have no idea, I haven't done something like that myself, but I
recently started learning Lua and thought I should comment on the dash
That said, I would've tried to solve your problem differently.
Do you already run two copies of the same zones somehow (one with
external and one with internal ips)? If not, here's my suggested
1) let your official dns be as it is
2) set up a separate pdns authorative server with a copy of the zones
you need to access internally, this can run on the same server on a
3) set up a recursor that forwards your internal zones to the
server/service mentioned in 2) this is done with the forward-zones
option in pdns-recursor.
4) set your internal clients to use the server in 3) as dns-server
If that's not doable I would probably look at implementing an
acl-based split in lua, serving from two different databases depending
on acl match. I'm not sure how pdns would solve caching in that case.
More information about the Pdns-users