DNS Aliases

When it comes to DNS aliasing my experience has always been to limit the number of aliases in use and have a single A record per host then setup aliases using CNAMEs for secondary references.  I started researching as I have seen this method as well as setting up multiple A records pointing to a single host IP address.  I was surprised to find that there is indeed a strong argument for both sides debating management/performance/lookup functionality.

If you have experience with DNS and aliases I would be interested to know the EE community input on this topic.

PROS vs CONS:
Multiple A Records to Single IP Address Aliasing
      A Record Definition - Domain Name to IP Address Resolution
      Management - If server IP address needs to be changed all A Records need to be updated as well to the new IP address
      Performance - DNS server resolves single name to get IP address
      Reverse Lookup - If using multiple A Records to point to a single IP address there will only be 1 reverse lookup pointer

Multiple CNAMES to Single A Record Aliasing
      CNAME Record Definition - Domain Name Alias to Primary Domain Name A Record IP Address Resolution.  Canonical name records were designed to alias A records
      Management - Easier to manage server IP address changes at single A Record for a multiple CNAME references
      Performance - DNS server resolves 2 names before getting IP address putting more load on the resolver
      Reverse Lookup - Clear understanding that this is an alias and what host it is pointed to

CNAME Chaining
      Defined - Domain Name Alias -> Domain Name Alias -> Primary Domain Name A Record IP Address
      Management – Multiple records to reference.  Changes along the chain could break name resolution
      Performance - DNS server resolves many names before getting IP address

Thanks
M DAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlanConsultantCommented:
Hi,

My opinion is that this has to be a 'depends'.

All of the above points are correct, but not all of them will be important in all scenarios.

I generally prefer to have a single A Record, and then use CName aliases, since it reduces the likelihood of a change being made incorrectly (only one A Record to change, and the CNames just 'follow along').

The fact that two (or more) lookups may be required is not often an actual issue.  For example, for MX records, would any user ever notice the negligible delay?

Also, since many lookups are cached, it is frequently irrelevant - the client gets the IP address (or already has it) before going to the authoritative nameserver(s).

Even the third scenario, which is often rejected out of hand, can have a place if there is some kind of distributed management, and different people / teams are managing DNS for different hostnames - it might make a lot of sense for this to be the case:

london.example.com -> england.example.com -> uk.example.com

All (currently) pointing to the same IP, but if the administration of england.example.com need to point to a different server than uk.example.com, but london.example.com needs to follow england.example.com, then the chaining can make sense.

Having said all that, If speed of lookup is a critical issue, then the use of a CName at all might be a bad idea, and you accept the implications in terms of the time to manage it all.


HTH,

Alan.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
M DAuthor Commented:
Thanks Alan.  I agree and am curious when it would make sense to have multiple A records pointing to the same ip rather than using CNAMES.

--MD
AlanConsultantCommented:
Hi MD,

It would, in theory, under certain circumstances, deliver faster name resolution.

If you use a CName, and assuming that the record is not cached somewhere from your machine, through all upstream DNS servers, then the CName is resolved to the A record, and then a second query is initiated to resolve the A record to an IP address, making two queries rather than one.

I cannot imagine that is a practical issue in many cases, unless you have a very slow DNS response to start with perhaps.

I have no personal experience of having any issues with CNames, even with two 'layers' of recursion.

Alan.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DNS

From novice to tech pro — start learning today.