vhost

Chip Old fold at bcpl.net
Sun Mar 18 18:54:02 UTC 2001


On Sun, 18 Mar 2001, mjs wrote to BIND:

> Im running bind 8.2.3 on RH 6.2,..my question is...i just setup a virtual
> host for apache (named base method) for another domain
> www.anotherdomain.com, now how do i add this to my zone file,..what line do
> i need added??...or do i setup another zone for this domain
>
> www.newdomain.com.     IN    A     24.114.25.224
>
> Would this be correct to add to my existing zone file???

Create a separate zone file for newdomain.com, and add master and slave
entries for it to named.conf on your nameservers.  In a typical name-based
hosting scenario the IP address to be shared by your virtual hosts has A
and PTR records in the zone files for your main domain. The zone file for
each hosted domain has a CNAME record pointing to the real name associated
with that IP address.  For example:

In zone file for main domain:

   virthost.realdomain.com.   IN   A   111.222.333.444

In in-addr.arpa zone file:

   111.222.333.444.in-addr.arpa.   IN   PTR   virthost.realdomain.com.

In zone file for hosted domain:

   www.newdomain.com.   IN   CNAME   virthost.realdomain.com.

Or something to that effect.  Your zone file for the hosted domain doesn't
need to contain much:

o SOA record showing your primary NS as the SOA.
o NS records showing what nameservers are authoritative for the
  hosted domain.
o MX record(s) showing what mail server(s) will handle mail for the
  hosted domain.
o CNAME record for www.hosted-domain.tld pointing to the real FQDN
  corresponding to the IP address used for name-based virtual hosts,
  as in example above.
o (Optional) CNAMES for other services to be available using the hosted
  domain name (for example ftp.hosted-domain.tld pointing to the real
  FQDN used for FTP).

You'll also need to configure Apache and Sendmail to recognize each hosted
domain, but that's outside the scope of this list/ng.

-- 
Chip Old (Francis E. Old)               E-Mail:  fold at bcpl.net
Manager, BCPL Network Services          Voice:   410-887-6180
Manager, BCPL.NET Internet Services     FAX:     410-887-2091
320 York Road
Towson, Maryland 21204 U.S.A.



More information about the bind-users mailing list