Previous Section
 < Day Day Up > 
Next Section


IP Virtual Domains

IP-based virtual hosting allows more than one IP address to be used for a single machine. If a machine has two registered IP addresses, either one can be used to address the machine. If you want to treat the extra IP address as another host in your domain, you need only create an address record for it in your domain's zone file. The domain name for the host would be the same as your domain name. If you want to use a different domain name for the extra IP, however, you have to set up a virtual domain for it. This entails creating a new zone statement for it with its own zone file. For example, if the extra IP address is 192.168.0.42 and you want to give it the domain name sail.com, you must create a new zone statement for it in your named.conf file with a new zone file. The zone statement would look something like the following. The zone file is called sail.com.

zone "sail.com" in {
           type master;
           file "sail.com";
           };

In the sail.com file, the name server name is turtle.mytrek.com and the e-mail address is hostmaster@turtle.mytrek.com. In the name server (NS) record, the name server is turtle.mytrek.com. This is the same machine using the original address that the name server is running as. turtle.mytrek.com is also the host that handles mail addressed to sail.com (MX). An address record then associates the extra IP address 192.168.0.42 with the sail.com domain name. A virtual host on this domain is then defined as jib.sail.com. Also, www and ftp aliases are generated for that host, creating www.sail.com and ftp.sail.com virtual hosts.

; Authoritative data for sail.com
;
@ IN SOA turtle.mytrek.com. hostmaster.turtle.mytrek.com. (
                               93071200 ; Serial (yymmddxx)
                                  10800 ; Refresh 3 hours
                                   3600 ; Retry 1 hour
                                3600000 ; Expire 1000 hours
                                86400 ) ; Minimum 24 hours
   
        IN      NS         turtle.mytrek.com.
        IN      MX   10    turtle.mytrek.com.
        IN      A          192.168.0.42 ;address of the sail.com domain
   
jib     IN      A         192.168.0.42
www     IN      A         jib.sail.com.
ftp     IN      CNAME     jib.sail.com.

In your reverse mapping file (/var/named/1.168.192), add PTR records for any virtual domains.

42.1.168.192      IN     PTR     sail.com.
42.1.168.192      IN     PTR     jib.sail.com.

You also have to configure your network connection to listen for both IP addresses on your machine (see Chapter 5).



Previous Section
 < Day Day Up > 
Next Section
This HTML Help has been published using the chm2web software.