DNS Question

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Oct 23 12:49:38 UTC 2009


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091023/09f19b5d/signature.pgp


More information about the freebsd-questions mailing list