Sub Domains

Johnno johnno at nospam.casebook.org
Sun May 21 03:39:20 UTC 2000


"IcEMaN" <iceman__01 at hotmail.com> wrote:

> I was wondering if anyone knows how to set up a subdomain
> to point to a subdirectory of a server.  If say I have a domain
> xyz.com who's server is 111.111.111.111 and want
> sub.xyz.com to point to 111.111.111.111/sub/, how would I
> do that?  Is it even possible?

DNS does not enable you to point hostnames to subdirectories of machines.

www.something.com cannot point to www.somethingelse.com/subdir.

Barry briefly pointed out that you can use virtual hosting in your Web server
(are you using Apache?).

If you had www.something.com pointing to 111.111.111.111 (which runs a Web
server), and you wanted www.sub.something.com to point to a subdirectory of
the Web site on 111.111.111.111, you would need to set up name-based hosting
on your Web server so that when the server receives HTTP requests for
www.sub.something.com, it delivers the content in the subdirectory rather
than the content in the main document root.

At a DNS level, you might use a CNAME, but I'm not sure off the top of my
head if name-based virtual hosts can handle CNAMEs.  It's safer to simply
give www.sub.something.com an A record and point it to the same IP address as
the main server (www.something.com).

Someone here might be able to point out whether or not name-based hosting
will correctly work if the DNS entry is a CNAME.

When in doubt, use A records.  :-)

--
Johnno (johnno at nospam.casebook.org)
http://members.optusnet.com.au/~japp


.



More information about the bind-users mailing list