Re: DNS Question
- From: Matthew Seaman <m.seaman@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Oct 2009 13:49:19 +0100
DAve wrote:
Good morning.
I have been asked by my co-workers and sales why I always create a A record for new domains we host instead of a CNAME.
The issue I run into lately with some domains is that a client has a website with a industry host such as frank.relator.com and he wants to have DNS point www.frank.com to frank.relator.com with a CNAME. The client does not want an A record for frank.com.
Somewhere, in a class far far away, I was taught a DNS zone had to have a A record to function properly. I can't seem to locate anything in the RFCs.
Am I wrong?
Yes, you're wrong.
In terms of web service, you can use either an A record or a CNAME record
to provide the address part of a site's URL[*]. As far as the web server is
concerned, it looks for the 'Host=' line in the HTTP packet to decide what
name-based VHOST to dispatch the query to internally, and doesn't necessarily
do any DNS lookups at all. Web clients just do a gethostbyname(3) or getaddrinfo(3) call to resolve the site name into an IP, and anything supported by those (/etc/hosts, NIS, LDAP, DNS) will do the trick.
In terms of the DNS a 'Zone' is a delegated block of the name space under
a single administrative control. Typically with BIND this maps onto a single
'Zone file' containing all of the DNS resource records for the zone. The only records a zone *has* to have are:
* 1 SOA record, with the zone serial number
* Some number of NS records giving the nameservers for the zone.
It's perfectly permissible to have a zone that doesn't contain any A
records (or AAAA records) and in fact, reasonably common: reverse domains
generally contain mostly PTR records.
Cheers,
Matthew
[*] Possibly others, but A and CNAME are the vast majority. Being able to
use SRV for webservers would be cool.
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW
Attachment:
signature.asc
Description: OpenPGP digital signature
- References:
- DNS Question
- From: DAve
- DNS Question
- Prev by Date: DNS Question
- Next by Date: FW: DNS Question
- Previous by thread: DNS Question
- Next by thread: FW: DNS Question
- Index(es):
Relevant Pages
|