ok this is going to be lengthy :) but i've done virtual IP/www/email on linux AND solaris so your in luck.
named.boot (on your primary DNS)
primary clientdomain.com named-dbs/db.clientdomain.com
where clientdomain.com is the name of the new domain you are hosting (you have to be the primary in the interNIC records). I put all my db files in /etc/named-dbs because of the massive quantity I host
rev.xxx.xx.xxx (your arpa file)
254 IN PTR www.clientdomain.com.
I just reverse to the www address since thats all they really use anyways.
now for the format of the db.clientdomain.com (db.clientdomain.com) you should have an idea of how this is set up, but heres a sample of what i use:
$INCLUDE named.soa clientdomain.com. A 188.8.131.52 MX 100 ns1.yourdomain.net. www A 184.108.40.206
I use BIND (not the stock SUN in.named) so I can use the $INCLUDE directive. If you use the stock SUN in.named you must replicate all the SOA information in each db file.
Increment your SOA serial number and HUP named. DNS is done, test it out with nslookup from machines/name servers on AND OFF your LAN.
easy, example follows:
/usr/sbin/ifconfig le0:1 220.127.116.11 /usr/sbin/arp -s 18.104.22.168 8:0:20:76:a1:da /usr/sbin/route add host 22.214.171.124 126.96.36.199 1 /usr/sbin/ifconfig le0:1 up /usr/sbin/ifconfig le0:2 188.8.131.52 /usr/sbin/arp -s 184.108.40.206 8:0:20:76:a1:da /usr/sbin/route add host 220.127.116.11 18.104.22.168 1 /usr/sbin/ifconfig le0:2 up
And heres how you can do it on a Linux box that has the upgraded ifconfig (comes included with slackware 3.0.0).
#ifconfig eth0:1 domain #arp -s domain 00:A0:35:29:43:7E #route add -host domain dev lo /sbin/ifconfig eth0:1 www.clientdomain.com /sbin/arp -s www.clientdomain.com 00:A0:35:29:43:7E /sbin/route add -host www.clientdomain.com dev lo
Once DNS is set up the IP and domain name are interchangable to arp and ifconfig. If you have an older install of Linux and want to use dummy devices for virtual you need dummy.o module support in your kernel.
these commands should be self explanatory, if not man 'em :) change the IP's to the one you set up in your DNS, and in the ifconfig lines each new IP should be the next le0:?, i have up to le0:60 so far.
Since i learned *NIX on linux, i have a terrible BSD-ish bend, that being said, you understand when i say i put this ifconfig/arp/route stuff in a file called /etc/rc.virtual-domains and link it from /etc/rc3.d/S99rc.local or on a Linux box, in rc.local
now you should be able to traceroute/ping the IP and address correctly.
this is the tricky part, i use apache now, after trying the included Netscape communication server and finding it unsatisfactory for virtual services. My reason is as follows: all good web servers nowadays start multiple child servers to handle requests as they arrive. they do this in advance so that there is no latency in starting new child servers. Netscapes server do this. catch is, you gotta run a new server set for EACH DOMAIN. Netscape defaults to min 16 server, max 32 servers. you CAN change this, but for me running 50+ V-www, i cant handle the memory requirements. soooooo
I use apache
setup of apache is quite straightforward. adding new domains is VERY easy.
i edit my /usr/local/etc/httpd/conf/httpd.conf and add this:
<VirtualHost www.clientdomain.com> ServerAdmin firstname.lastname@example.org DocumentRoot /home/p/clientdomain/public_html ServerName www.clientdomain.com ErrorLog logs/error_log.www.clientdomain.com TransferLog logs/access_log.www.clientdomain.com </VirtualHost>
after saving the file i restart my www server (cant HUP it)
newworld:/etc/procmailrcs# /usr/ucb/ps -aux|grep htt nobody 3589 0.6 2.2 1760 1332 ? S 12:06:59 0:00 /usr/local/etc/htt nobody 3551 0.4 2.0 1744 1196 ? S 12:06:13 0:00 /usr/local/etc/htt nobody 3388 0.3 2.0 1760 1240 ? S 12:02:02 0:00 /usr/local/etc/htt nobody 3287 0.2 2.0 1760 1236 ? S 12:00:46 0:00 /usr/local/etc/htt nobody 3403 0.2 2.0 1760 1232 ? S 12:02:08 0:00 /usr/local/etc/htt nobody 3298 0.2 2.0 1760 1228 ? S 12:00:50 0:00 /usr/local/etc/htt nobody 3558 0.2 2.2 1760 1344 ? S 12:06:19 0:00 /usr/local/etc/htt nobody 3291 0.2 2.0 1760 1228 ? S 12:00:47 0:00 /usr/local/etc/htt nobody 3570 0.2 1.9 1736 1172 ? S 12:06:37 0:00 /usr/local/etc/htt nobody 3293 0.2 2.0 1760 1228 ? S 12:00:48 0:00 /usr/local/etc/htt nobody 3465 0.2 2.0 1760 1232 ? S 12:03:50 0:00 /usr/local/etc/htt nobody 3557 0.2 2.1 1760 1312 ? S 12:06:18 0:00 /usr/local/etc/htt root 3599 0.1 0.9 740 540 pts/48 S 12:07:02 0:00 grep htt nobody 3272 0.1 2.0 1760 1228 ? S 12:00:31 0:00 /usr/local/etc/htt nobody 3592 0.1 0.8 1720 464 ? S 12:07:01 0:00 /usr/local/etc/htt nobody 3591 0.0 0.8 1720 464 ? S 12:07:00 0:00 /usr/local/etc/htt root 11290 0.0 1.5 1720 924 ? S Mar 05 0:04 /usr/local/etc/htt newworld:/etc/procmailrcs# kill 11290 newworld:/etc/procmailrcs# /usr/local/etc/httpd/httpd
gotta kill the httpd process owned by root, and the others will die also. Then restart httpd
E-Mail Personally i use procmail to handle virtual email. Greg Rumple First suggested it and helped me set it up. Basicly, install procmail (I opted for the SUID installation) and build a sendmail.cf that has procmail as the local delivery agent (your users will love you) Create a directory called /etc/procmailrcs to put your per domain configuration in. thats that...
BTW: if you use a different C-Class for V-www you need a hard route on your cisco pointing that C-class the the IP of your SUN (le0 IP address)
Any Questions? Send email to Chip Chiapusio.