Solved

non-www www CNAME redirection

Posted on 2010-08-30
6
1,028 Views
Last Modified: 2012-05-10
Hi Guys,

I'm not sure whether the below rule is possible in DNS. Can some one confirm this

example.com  CNAME  www.example.com
www.example.com     A    192.0.32.10

and I will be configuring www.example.com as an A record at Load Balancers.
0
Comment
Question by:nlrreddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 167 total points
ID: 33563747
Depending on how you add/change DNS entries the www entry would typically come first and then the CNAME entry.

Assuming BIND9 you would have something like:

www              A 192.0.32.10
example.com. CNAME www.example.com
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 167 total points
ID: 33564569
No, that is not possible.
It is invalid to point the domain name as a CNAME to anything.
gilttjr, the order of record entry is irrelavent since the DNS server loads the data an organizes it as it sees fit without regard to which it saw first.  It is often suggested for ease of troubleshooting/reviewing DNS records/issues, to list them in level order.
domain
subdomains
.
.
hostname
.
.
.

The issue is with the CNAME record. Your zone will likely not load or if it does, it will create a loop where any request to example.com will be redirected because of the CNAME to look for a zone in www.example.com which will not exist.


You should do the reverse: define the domain with an A record pointing to an IP while the www record will be a CNAME to the domain.

example.com. A 192.0.32.10
www CNAME @
or
www CNAME example.com.
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 167 total points
ID: 33565499
arnold, order may not matter for most most DNS server software works.  However I have had some DSN server software spit out error message and not accept CNAME definitions because the occurred before the A record they were pointing to.   I have also used CNAME for domain names.  Both situations could have been bugs in the software I was using at the time.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 71

Assisted Solution

by:Chris Dent
Chris Dent earned 83 total points
ID: 33565558

It shouldn't permit you to, using a CNAME record where the resource is used by another record should make it cry (does not comply with the RFCs on use of CNAME records).

But there we go, I certainly won't argue that all software prohibits it, I only suggest it's bad practice :)

Chris
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 167 total points
ID: 33568183
giltjr,

I understand your point and it often deals with GUI based interface where they have to validate what you are entering against the existing data.  At times, the right side of the data entry was not being validate and at rare times led to the zone failing to load because the user entered the wrong thing for the record type.

I think bind9 if you make such entries and run the named-checkzone example.com where you cname the zone name, you will get an error message.

This is likely with registrars that provide DNS services.
I.e. as far as DNS is concerned, there is nothing inherently wrong with defining a CNAME to a record that does not exist i.e.
www CNAME nosuchthing

Looking up the record for www.example.com will return CNAME record that points to nosuchthing.example.com. The client will then lookup nosuchthing.example.com and will get the no such record and will end it at that.

The web based GUIs will validate local data
i.e. www CNAME nosuchthing will check whether there is a record nosuchthing.
but if you use
www CNAME nosuchthing.someotherdomain.com.
The record will likely be added.
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 83 total points
ID: 33574797
CNAME redirects all subtree to differnt name, so it causes infinite loop in resolver.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Occasionally you run into the website or two that will not resolve properly using your own DNS servers.  Some people simply set up global forwarders for their DNS server.  I don’t recommend doing this because it can cause problems resolving addresse…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question