[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] CNAME problems



T_Rex wrote:

> Can somebody tell me how to make CNAME entries to work under a RAQ3 server
> useing the cobalt interface?

They work fine here.

The alias is what you want DNS to resolve, the target is what you want
it to resolve to.

Since CNAME records result in longer lookup times (two lookups must be
made) there are only three good reasons I can think of to use them:

1) if you have no control over the target.  For example, if you offer
usenet news to your users, and you buy the connections from someone
else.  So if your news connection provider says to have your clients
point to news.them.com and you want your customers to set their
newsreaders to news.you.com, presuming you hosted DNS for you.com, you'd
set the Alias Host Name to news, the Alias Domain Name to you.com, the
Target Host Name to news, and dthe Target Domain Name to them.com.

2) if you've got an IP# that changes often, and you want to be able to
change it only once.  For example, if you're hosting ten domains on the
end of a cable modem connection, where the IP# changes once a month or
so (not recommended of course, but for the sake of the example only
<smile>)... Your RaQ's main domain is maindomain.com, and in DNS you
create an A record pointing maindomain.com to your IP#, and pointing
domain2.com, domain3.com, domain4.com, all to maindomain.com, using
CNAME records.  Then when the IP# changes you have to change only the
first A record; the rest you can leave alone.  (However, in this
particular example, you'd have to change the IP# for each domain in the
main site interface.)

3) if you've got one service that's always tied to another.  For
example, we set up domain.com, www.domain.com, and ftp.domain.com.  For
both domain.com, and www.domain.com, we always use separate A records;
since websites get hit more than ftp or email it's important that either
way the website is referred to there's only one DNS lookup required. 
However, we always use CNAME records for ftp, with ftp being the Alias
Host Name, www being the Target Host Name, and domain.com being both
Alias and Target Domain Name.  Why?  Because the only reason to use ftp
is to put files into the web directory, which is always at
www.domain.com.

> I have tried but always have the same problem: the site supossed to be the
> "target" never shows up, instead of that Im alwasy directed to the home page
> of the server (the one located in /home/sites/home/web)

Apache figures out which domain website to host based on the http
version 1.1 headers.  If there's no ServerAlias line for the CNAME
target in /etc/httpd/conf/httpd.conf, then apache will serve the first
website under the IP#.

Check to make sure that under Site Settings for the site in question
you've got the target of the CNAME record (host.domain.com) in "Web
Server Aliases".

Jeff
-- 
Jeff Lasman <jblists@xxxxxxxxxxxxx>
Linux and Cobalt/Sun/RaQ Consulting
nobaloney.net
P. O. Box 52672, Riverside, CA  92517
voice: (909) 778-9980  *  fax: (702) 548-9484