wildcard subdomains w/name based VHOST

Barry Margolin barmar at bbnplanet.com
Thu Aug 5 21:58:17 UTC 1999


In article <7ocsi9$t7l$1 at nnrp1.deja.com>,
[| the : clap |] <the_clap at my-deja.com> wrote:
>I am having one problem so far with the wildcards:
>I use name based Virtual Host Apache server, with several domain names
>per IP#.
>a line like:
>
>*.example.com.     IN      CNAME   example.com.
>
>in my DNS is directing  *.example.com to the default page for the
>IP# that domain is assigned to.  The only way I got it working properly
>is if I switch the order of the VIRTUALHOST Apache entries in httpd.conf
>so that the domain name is first under the "NameVirtualHost"
>Which is OK, because it works, but since I only have 12 IP#s, that only
>allows me 12 domains to host wildcard subdomains.
>
>To explain it differently, pretend I have 2 sites on (1) IP#
>example.com, and domain.com
>in my httpd.conf file, if example.com is listed first under the IP#,
>wildcards work fine for example.com - but for domain.com (listed
>second)  the URL's with subdomains (like sub.domain.com) all direct to
>example.com's default page.

I don't think this problem has anything to do with wildcards.  DNS clients
can't generally tell when a wildcard is used -- the server acts exactly as
if the record it was looking for were in there explicitly.  The only way to
detect a wildcard is to look specifically for *.example.com rather than
sub.example.com, but there's no reason why Apache would be doing that with
its virtual host entries.  I bet you would have the same problem if you
listed all the sub.example.com names rather than a wildcard.  I think the
problem is just with the way that Apache processes the virtual host
directives in httpd.conf, so you should redirect your query to
comp.infosystems.www.servers.unix.

-- 
Barry Margolin, barmar at bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


More information about the bind-users mailing list