CNAME or A record?

feralert feralert at gmail.com
Tue Oct 4 08:54:02 UTC 2011


Thank you so much people. you rock!.

I have finally gone for two A records, but thanks to all of you I now
understand the pros and cons.

I apologise if I mislead you with the 'redirect' word, I really meant
to say that I wanted both de the domain and the www host to point to
the same ip.


Cheers!
Fred.



On Fri, Sep 30, 2011 at 3:50 PM, Joseph S D Yao <jsdy at tux.org> wrote:
> On Wed, Sep 28, 2011 at 04:19:41PM +0200, feralert wrote:
> ...
>> The thing is that i want users redirected to 'www.domain.com' even
>> when they just type the domain name 'domain.com'.
>> In order to do so I am not sure if its best to have one A RR for each
>> or have an A RR for the domain and a CNAME RR pointing to 'domain.com'
>> for 'www.domain.com'.
>>
>>
>> domain.com           A            1.1.1.1
>> www.domain.com   A            1.1.1.1
>>
>> OR
>>
>> domain.com           A            1.1.1.1
>> www.domain.com   CNAME  domain.com
> ...
>
>
> It's clear you need an entry for both.  Which is a matter of future
> maintenance.  If you only want to change it in one place, and you'll
> never need any other records for "www" different from those for the
> domain itself, go ahead and use the CNAME.  (Multiply this by 1000 times
> in 1000 different domains, or maybe all within the one domain, and it
> may matter.  OTOH, if you are using one file for 1000 different domains,
> you CAN't use the CNAME.  I don't think.)
>
> The only downside, besides not being able to have other records for the
> "www" name, is that the resolver now has to make TWO queries.  If your
> name server is a PDP-11/05 running Unix V6 and BIND 4.1.2, this might
> make a difference.  [And if so - may I see it?  ;~)]  However, most name
> servers these days are made of sterner stuff.  And if you're truly doing
> a "redirect" instead of just serving the same Web site at both names,
> it'll have to make two queries anyway.
>
> As someone tried to say but didn't [too many pronouns, not enough clear
> antecedents], a "redirect" would be done by your Web server, not by DNS.
> The Web server at "domain.com" would say, go away, nothing to see here,
> it's all going down at "www.domain.com".  And the Web server at
> "www.domain.com" would have all the goodies.  But if you're serving the
> same Web content at both names, that's NOT a "redirect".  Whichever you
> do, as I started out saying, you need both DNS entries.  Whatever they
> may be.
>
>
> --
> /*********************************************************************\
> **
> ** Joe Yao                              jsdy at tux.org - Joseph S. D. Yao
> **
> \*********************************************************************/
>



More information about the bind-users mailing list