Bill Jonas on Fri, 22 Feb 2002 07:00:13 +0100


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

Re: [PLUG] DNS question


On Wed, Feb 20, 2002 at 02:25:09PM -0500, Doug Crompton wrote:
> Everything I read talks about using CNAMES when doing virtual hosting. I
> cannot seem to get this to work and I do not fully understand it. 

Keep in mind that DNS and Apache are distinct (although obviously
interrelated) subjects.

The six most common types of DNS records one deals with are SOA, NS, MX,
A, PTR, and CNAME.  (These are all in the IN, or internet, class.  There
are other classes, but they're rather uncommon, and if you needed them
you'd probably know anyway.)  SOA is the "start of authority" -- this
record contains the name of the primary nameserver, email address of the
person responsible for the domain, the serial number, how often to cache
and refresh, and the like.  NS records list the nameservers.  MX records
tell which machines handle mail for the domain.  (From "Mail
eXchanger".)  A records are the regular hostname-to-IP-address mappings.
PTR (PoinTeR) records are the reverse IP-address-to-hostname mappings.
Finally, the CNAME (Canonical NAME) is sort of like a symlink for DNS.
It basically says, "This record is defined, but the canonical name is
this other hostname; look up its A record and use that instead."  Try
doing lookups on www.yahoo.com and www.microsoft.com.  They both use
Akamai and the www.<domain>.com is a CNAME record which points to
www.<domain>.akadns.net, which has multiple A records defined.  (Having
multiple A records is also known as round-robin DNS.)

> So my question is.. is this an alright way to do it? Why do I need CNAMES?
> Once I do the above and load it I can (locally) access the new domain
> name, send mail, attach to port 80 etc. I have not yet registered the name
> but once I do I expect that externally I will be able to do the same.

If I'm properly understanding what you're saying, this is a perfectly
valid way of doing it.  If you look up www.laserhen.net (my wife's
domain), you'll notice that its CNAME is laserhen.net, which has the
same A record as billjonas.com.  As long as you use an HTTP1.1-compliant
web browser (I'm not aware of any that *aren't*), you'll be able to view
different content at both sites, even though it's being served from the
same IP address.

I'm not sure if this answered your question, but I hope it helps.

-- 
Bill Jonas    *    bill@billjonas.com    *    http://www.billjonas.com/

Developer/SysAdmin for hire!   See http://www.billjonas.com/resume.html

Attachment: pgpIBmN4xPN44.pgp
Description: PGP signature