Bind Virtual Hosting

Kevin Darcy kcd at
Wed Mar 23 00:00:33 UTC 2005

Walter Balzer wrote:

>i have a Webserver within multiplie Virtual-Host-Sections in the
>I am planning to run multiplie Subdomains as different Virtual Hosts:
>The Configurationpart of the Webserver seems not to be the problem but
>what is the best Bindconfig for that solution?:
>a) with ORIGIN
>demo         IN CNAME www
>walter       IN CNAME www
>xyz          IN CNAME www
>b) without ORIGIN
>         IN CNAME www
>       IN CNAME www
>          IN CNAME www
>c) with IN A
>demo         IN
>walter       IN
>xyz          IN
>d) with IN A an $ORIGIN
>         IN
>       IN
>          IN
>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