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
Solved

non-www www CNAME redirection

Posted on 2010-08-30
6
1,024 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
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 77

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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 70

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 77

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

792 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