Vhost IP Address

Chip Old fold at bcpl.net
Sat Apr 7 18:12:48 UTC 2001


On Fri, 6 Apr 2001, Y2KNET wrote:

> How we can define an IP address to be used for more than one Virtual
> Hosts.  Can we do like this:
>
>         www.abc.com   IN A    192.221.171.5
>         www.xyz.com   IN A    192.221.171.5

Yes, that's one way, but:  (1) www.abc.com should be in the zone file for
abc.com and www.xyz.com should be in the zone file for xyz.com.  (2) It's
best not to have multiple PTR records for the same IP address.

Another way is to use CNAME records.  Let's assume the domain where the
hosting is being done is "hostdomain.com", and the hosted domains are
"abc.com" and "xyz.com".

In the zone file for hostdomain.com:

  virthost.hostdomain.com.   IN   A       192.221.171.5

In the zone file for abc.com:

  www.abc.com.               IN   CNAME   virthost.hostdomain.com.

In the zone file for xyz.com:

  www.xyz.com.               IN   CNAME   virthost.hostdomain.com.

In the zone file for 171.221.192.in-addr.arpa:

  192.221.171.5.in-addr.arpa IN   PTR     virthost.hostdomain.com.

-- 
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