On Tue, Nov 15, 2011 at 7:42 AM, Daniel L. Miller <[email protected]> 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 > query.
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 escaping :-) 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 workaround; 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 different port 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. -- Erik _______________________________________________ Pdns-users mailing list [email protected] http://mailman.powerdns.com/mailman/listinfo/pdns-users
