Bind Virtual Hosting
Kevin Darcy
kcd at daimlerchrysler.com
Wed Mar 23 00:00:33 UTC 2005
Walter Balzer wrote:
>Hello,
>
>i have a Webserver within multiplie Virtual-Host-Sections in the
>httpd.conf.
>
>I am planning to run multiplie Subdomains as different Virtual Hosts:
>
>
>demo.homepage.de
>walter.homepage.de
>xyz.homepage.de
>
>The Configurationpart of the Webserver seems not to be the problem but
>what is the best Bindconfig for that solution?:
>
>
>a) with ORIGIN
>==============
>
>$ORIGIN homepage.de
>...
>
>demo IN CNAME www
>walter IN CNAME www
>xyz IN CNAME www
>
>
>b) without ORIGIN
>=================
>demo.homepage.de IN CNAME www
>walter.homepage.de IN CNAME www
>xyz.homepage.de IN CNAME www
>
>c) with IN A
>============
>demo IN 192.168.10.1
>walter IN 192.168.10.1
>xyz IN 192.168.10.1
>
>d) with IN A an $ORIGIN
>=======================
>demo.homepage.de IN 192.168.10.1
>walter.homepage.de IN 192.168.10.1
>xyz.homepage.de IN 192.168.10.1
>
>What is the best solution for the Subdomain-Virtual-Hosting?
>
Whether you use $ORIGIN or not is really your own decision, based on
whether you think it makes things more, or less readable, how
knowledgeable the admins are who are going to maintaining this zone
file, etc. In our case, we use Dynamic Update for all zone-data
maintenance, so named writes out the zone file itself and $ORIGIN is not
an option for us. Fortunately, we have utilities that can display the
contents of zones in various user-friendly formats, so it's not really
necessary for anyone to actually read the raw zone file.
As for the difference between using multiple A records, or using 1 A
record and CNAMEs, that too is largely a matter of taste. Some people
don't like CNAMEs at all and try to avoid them. But, if you use multiple
A records, then what do you do about reverse records? Do you just pick
one of those names arbitrarily and have the PTR record point to it? That
means you have an asymmetry (A records defined without corresponding PTR
records). And it doesn't really work, and scales badly, to have multiple
PTR records for a given address. For this and other reasons, we prefer
to (with certain, relatively-obscure exceptions) have only 1 A record
pointing to any given address, and all other names which must resolve to
that address be CNAMEs to that name.
- Kevin
More information about the bind-users
mailing list