[clug-talk] Name Based Virtual Hosting

Shane shane at randomwords.ca
Mon Mar 28 12:16:17 PST 2005


On Mon, 28 Mar 2005 12:57:57 -0700, William Astle wrote
> Shane wrote:
> > Thanks for your reply. Sorry about the typo, I was trying to change the 
> > names to protect the innocent...
> > 
> > Part of my confusion is that I only have 1 external IP address. If 
> > randomwords.ca already points to 68.100.xxx.xxx can theserpentstooth.com 
also
> > point to that same address?
> > 
> > $TTL 3D
> > @       IN      SOA     theserpentstooth.com. root.randomwords.ca. (
> >                         20041101
> >                         8H
> >                         2H
> >                         4W
> >                         1D )
> >                 NS      ns.randomwords.ca.
> >                 MX      10 randomwords.ca.
> > theserpentstooth.com.   A   68.100.xxx.xxx
> > www                     CNAME   @
> > 
> > Like so?
> 
> Indeed it can. You can have as many domains/names pointing to the 
> same IP address as you want. It's not uncommon for large vhost 
> providers to have thousands of domains pointing to the same IP 
> address. As long as you configure Apache, etc., correctly, 
> everything should work.
> 
> > 
> > Thanks again.
> > 
> > Shane
> > 
> > On Mon, 28 Mar 2005 12:23:12 -0700, William Astle wrote
> > 
> >>Shane wrote:
> >>
> >>>Hello group.
> >>>
> >>>I was wondering if someone would be willing to discuss virtual hosting 
> > 
> > from 
> > 
> >>>the BIND stand-point. I have setup "name based" virtual hosts on my 
> > 
> > machine, 
> > 
> >>>but the DNS part I'm a little unclear about...
> >>>
> >>>For some reason, my setup doesn't register with anyone on the Telus 
> >>>network...
> >>>
> >>>I have in named.conf:
> >>>
> >>>zone "thevirtualdomain.com" {
> >>>        type master;
> >>>        file "virtual.com";
> >>>};
> >>>
> >>>And in 'virtual.com':
> >>>
> >>>$TTL 3D
> >>>@       IN      SOA     thevirtualdomain.com. root.randomwords.ca. (
> >>>                        20041101
> >>>                        8H
> >>>                        2H
> >>>                        4W
> >>>                        1D )
> >>>                NS      ns.randomwords.ca.
> >>>                MX      10 randomwords.ca.
> >>>                TXT     "randomwords.ca"
> >>>theserpentstooth.com.   CNAME   randomwords.ca.
> >>>www                     CNAME   randomwords.ca.
> >>
> >>That looks rather weird. You have a CNAME from an unrelated domain 
> >>in your zone file. Unless that's just a typo. If you meant 
> >>"thevirtualdomain.com." instead of "theserpentstooth.com.", then you 
> >>have another problem.
> >>
> >>You cannot have a CNAME record and another record at the same point 
> >>in the DNS tree. This means the root of your zone cannot have a 
> >>CNAME record because there's an SOA and NS records.
> >>
> >>Assume that your IP address for the virtual hosting is 10.1.1.1. You 
> >>might construct a zone file as follows (I'm not going to include the 
> >>SOA):
> >>
> >>@	NS	ns.radnomwords.ca.
> >>	MX	10 randomwords.ca.
> >>	A	10.1.1.1
> >>www	CNAME	@
> >>
> >>TXT records are irrelevant for this situation.
> >>
> >>Note that this is not ideal because if you have to change the IP 
> >>address of the server, you have to change every zone but I'm not 
> >>aware of a good way around it.
> >>
> >>Note also that if you don't need "virtualdomain.com" to respond on 
> >>HTTP but just "www.virtualdomain.com", you can leave out the A 
> >>record all together (and the issue from the previous paragraph goes 
> >>away).
> >>
> >>
> >>>
> >>>
> >>>_______________________________________________
> >>>clug-talk mailing list
> >>>clug-talk at clug.ca
> >>>http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> >>>Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> >>>**Please remove these lines when replying
> >>
> >>-- 
> >>William Astle
> >>finger lost at l-w.net for further information
> >>
> >>Geek Code V3.12: GCS/M/S d- s+:+ !a C++ UL++++$ P++ L+++ !E W++ !N w-
> >>-- !D !M PS PE V-- Y+ PGP t+@ 5++ X !R tv+@ b+++@ !DI D? G e++ h+ y?
> 
> -- 
> William Astle
> finger lost at l-w.net for further information
> 
> Geek Code V3.12: GCS/M/S d- s+:+ !a C++ UL++++$ P++ L+++ !E W++ !N w-
> -- !D !M PS PE V-- Y+ PGP t+@ 5++ X !R tv+@ b+++@ !DI D? G e++ h+ y?

Thanks again. I really appresiate the assist as there hasn't been a ton of 
documentation on-line that I could find... I thought I was gonna have to 
cave and buy the big scary DNS and Bind book.

Probably should anyway...

Shane



More information about the clug-talk mailing list