On Tue, Mar 19, 2002 at 07:31:08AM +1100, Kirk Fletcher wrote:
>
> Hey all,
Hey Kirk.
> We provide URL forwarding with domain rego, and have (by
> default) been using bind as our nameserver. Needless to
> say, this is handling LOTS of domains now - and we should
> probably have moved to a db-based nameserver long ago (at
> the moment, the flat-file zones used by bind are being
> generated by a script).
We long ago dropped the idea of trying to have a different flat file
for each domain. When a thousand domains essentially share the same
resource records, you might as well point them all to the same file.
Web hosting and URL forwarding each have a *single* zone file shared
by all the domains, and named.conf does an include of a file that is
generated from database content. So named.conf has stuff like:
include "auto-primary-host.conf";
include "auto-primary-fwd.conf";
and those files contain lines like:
zone "somedomain.com" { type master; file "f/common-host"; };
and
zone "other.com" { type master; file "f/common-fwd"; };
A script checks every hour to see if the database is dirty. If it is,
the appropriate .conf files are regenerated, and named is reloaded. It
isn't quite live, but DNS being what it is, it's good enough. Adding
or removing a few domains per reload is NO problem, if we don't update
an SOA record.
(An important thing to remember is that doing this will mean sharing an
SOA record amongst all the zones sharing a zone file, so you want to
segregate things by function. If it's possible you'll make changes to
forwarding without changing your hosting zone, then give 'em separate
SOAs.)
Forwarding is also database-driven, with a simple PHP script that looks
up the necessary forwarding information from another MySQL table based
on the HTTP_HOST variable. All the "common-fwd" zone file has to do is
point to a numbered virtualhost that includes some RewriteRules to turn
directories and stuff in URLs into variables which the index.php file
can turn back into directories in the target site.
We haven't hit a thousand of either hosted or forwarded URLs alone, but
based on the loads I'm seeing now, I can't imagine there would be any
difficulty growing the current list by a couple of orders of magnitude.
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Development / Abuse / Whatever vox: +1 416 598-0000
it.canada http://www.it.ca/