Solved

www.mydomain -> CNAME -> mydomain, Redirect to WWW.

Posted on 2014-10-12
11
236 Views
Last Modified: 2014-10-13
My zone file records (setup by my host) contains amongst other records. I'm not doubting my host, rather I'm trying to understand practicals of DNS. I don't want to use support for learning technicals!

mydomain.org.uk.	14400	IN	A	XXX.XX.XXX.XXX
mail.mydomain.org.uk.	14400	IN	CNAME	mydomain.org.uk
www.mydomain.org.uk.	1400	IN	CNAME	mydomain.org.uk	

Open in new window


Currently setting up the website. I can access my website using   http ://,   foo.bar,   http :// www.

I aim to make http[s]://www, the default - not by using a .htaccess permanent redirect, but by specifying this in the WordPress SiteURL. However.

Question 1:

Does the www -> CNAME > mydomain have any bearing on my intention to set http[s]://www,?

Question 2:

If CNAME is used for essentially redirecting requests from www.domain.org.uk -> www.domain2.org.uk, might it be better to set www.mydomain.org.uk -> IN -> A -> XXX.XX.XXX.XXX?


Previously, the zone contained:

www.mydomain.org.uk.        1400    IN  CNAME   www.mydomain.org.uk.cdn.cloudflare.net

Open in new window


cloudflare-resolve-to.mydomain.org.uk.  1400    IN  CNAME   mydomain.org.uk

Open in new window


Question 3:

If it might be better to set www. to A IP, would it still be possible to Add CNAME as above example, anytime post website-live?

Question 4:

To confirm, a zone file has no bearing or implication on setting http[s]://www. in WordPress? Ref: http://codex.wordpress.org/Function_Reference/redirect_canonical

Note: I understand that www. CNAME resolves to A IP.
0
Comment
Question by:Dylan Thomas
  • 7
  • 4
11 Comments
 
LVL 28

Expert Comment

by:becraig
ID: 40376098
Quick answer to all your questions in one:

The cname record above actually references cloud flare which means internet queries for your site dns resolves to them and they in turn point traffic to your site based on your defined preferences.  A cname does not resolve to an ip but rather another a record that already resolves to an ip.  If you plan to use the same model (cloud flare for traffic management) then a similar setup is needed.   You can set an A record for your www site if you do not intend to use cloud flare.
0
 

Author Comment

by:Dylan Thomas
ID: 40376115
Thanks.

True, the CF entries have been removed and aren't currently present, this is what the record contained before I unsubscribed from CF for sake of ease of setup. Those CF records won't be present when live.

Sure, the chain therefore is www. CNAME -> apex domain -> IP.

Question:

You can set an A record for your www site if you do not intend to use cloud flare

I see, so there can be only one www. CNAME record?

Can I please and kindly ask for your advice on Q1 & Q4?
0
 
LVL 28

Expert Comment

by:becraig
ID: 40376131
No need for a cname


A cname is an alias example getting something that asks for Jane.com to go to Harry.com.  Harry.com would have an a record pointing to an IP address but Jane.com would only point to Harry.  


So all you need here is an A record for your www site ponting to the IP address the site will be on.  Not sure how your setup is going to be, but this can usually be handled by your hosting provider. If you are doing your own hosting youd create an A record ponting to the ip and that's it.
0
 

Author Comment

by:Dylan Thomas
ID: 40376822
To conclude: SET www to A. Resulting is:

mydomain.org.uk.      14400      IN      A      XXX.XX.XXX.XXX
mail.mydomain.org.uk.      14400      IN      CNAME      mydomain.org.uk
www.mydomain.org.uk.      1400  IN        A      XXX.XX.XXX.XXX

Possible futures, adding:

www.mydomain.org.uk.        1400    IN  CNAME   www.mydomain.org.uk.cdn.cloudflare.net
cloudflare-resolve-to.mydomain.org.uk.  1400    IN  CNAME   mydomain.org.uk

Therefore, Is it possible to have multiple www. records?
0
 

Author Comment

by:Dylan Thomas
ID: 40378354
Actually, this question makes no sense. It's either CNAME or Not, can't be both.

Having www.mydomain.org.uk.      1400      IN      CNAME      mydomain.org.uk       is apparently preferred because it's easier to maintain should the IP for hostname need to change.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Dylan Thomas
ID: 40378423
I've requested that this question be closed as follows:

Accepted answer: 0 points for Dylan Thomas's comment #a40378354

for the following reason:

Because it highlights a flaw in my reasoning based on an answer gathered elsewhere online.
0
 
LVL 28

Expert Comment

by:becraig
ID: 40378424
This was clearly answered in comment:
http://www.experts-exchange.com/Web_Development/Blogs/WordPress/Q_28536148.html#a40376098

The cname record above actually references cloud flare which means internet queries for your site dns resolves to them and they in turn point traffic to your site based on your defined preferences.  

A cname does not resolve to an ip but rather another a record that already resolves to an ip.

If you plan to use the same model (cloud flare for traffic management) then a similar setup is needed.  

You can set an A record for your www site if you do not intend to use cloud flare.
0
 

Author Comment

by:Dylan Thomas
ID: 40378542
It wasn't clearly answered, not by you anyway, in all honesty. I understand, following your enlightening Jane and Harry analogy, that CNAMES resolve, in my case to a hostname, which in turn, the hostname resolves to an IP. Which I clearly illustrated here:
http://www.experts-exchange.com/Web_Development/Blogs/WordPress/Q_28536148.html

You keep on repeating how CNAMES function like Ed Milliband, I understand... Now. It's irrelevant in terms of performance if, for example - www. is a CNAME or a IP. So you're recommendation (www -> IP) would have meant a less manageable zone file.

In fact, I had to go to a free service to find the answer! Thank Expert Exchange for your trial. Perhaps your future depends on useful exchanges.

So my conclusions are: There is little point in making www. point to an IP. Why?

1 - Because if the IP needs to change, only the hostname needs to be updated.

2 - If I decide to use CloudFlare again, www. will be CNAME for CloudFlare, which I clearly explained - and realized, myself. You avoided or didn't see my question: Therefore, Is it possible to have multiple www. records?

The answer is: No, because for CloudFlare atleast, and through one of their Partners, www. is used as a CNAME, which I clearly illustrated above. It's false to say that www. can be both an A -> IP, and a CNAME at once.

Additionally, I'm not going to accept your answer, because you failed to answer my question in relation to Canonical Name and DNS, which, as it turns out, the DNS (in general) has no bearing on what the Canonical Name is, htts://www., or http.. The answer is: CNAME is the only records that relates to this point, I refer you to Jane and Harry.

Do me a favour becraig, either provide more constructive answers & engagement, or don't answer at all. Your passive-aggressive bold shouting is child-like.
0
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
ID: 40378607
Dylan let me apologize for as you indicate nor being clear enough for you.


You response indicates to me you still do not understand the concept so I have really failed here:
So you're recommendation (www -> IP) would have meant a less manageable zone file.

A or Address records are the ONLY way to point a host to a destination.

So my conclusions are: There is little point in making www. point to an IP. Why?

1 - Because if the IP needs to change, only the hostname needs to be updated.
This is an INCORRECT assumption, if the ip ever changes the A record would have to be updated to point to the new ip which will populate at the top level providers once the TTL has expired on the old record.
Host to IP for the purpose you seek is done by A records ONLY.


2 - If I decide to use CloudFlare again, www. will be CNAME for CloudFlare, which I clearly explained - and realized, myself. You avoided or didn't see my question: Therefore, Is it possible to have multiple www. records?
If you plan to use cloudflare as I indicated above you would not need to have any A  records, why ?
This is simple, you would create a CNAME to an A record cloudflare would create:
e.g.
www.mydomain.org.uk.        1400    IN  CNAME   www.mydomain.org.uk.cdn.cloudflare.net

On Cloudflare's end they would have a record on their end defined as
www.mydomain.org.uk.cdn.cloudflare.net.     14400      IN      A      XXX.XX.XXX.XXX

This would however be invisible to you, however the service cloud flare is offering would simply let all your site lookups go to their record and then to the IP you provide the which is where your host actually resides.  If for example you EVER changed your webserver IP then you would have to provide this info to cloudflare for their traffic routing.

The answer is: No, because for CloudFlare atleast, and through oen of their Partners, www. is used as a CNAME, which I clearly illustrated above.
Again to this which I felt I answered before:
The cname record above actually references cloud flare which means internet queries for your site dns resolves to them and they in turn point traffic to your site based on your defined preferences.  A cname does not resolve to an ip but rather another a record that already resolves to an ip.

I am not sure what more clarity I could have provided in the above statement to help you to understand you only NEEDED A SINGLE CNAME record to Cloudflare and they will handle everything else on their end based on your defined info.


Do me a favour becraig, either provide more constructive answers, or don't answer at all.
I thought the info provided was constructive, however I apologize if you think it was not explained well enough for you to understand.


I was traveling yesterday and answered you while in transit, which I tend to do from time to time.
I do sincerely hope this does not impact your experience here at EE, I have been in the industry for almost twenty years and I will tell you the wealth of experience here can make your life much easier.
0
 

Author Comment

by:Dylan Thomas
ID: 40378684
Without CF:

1 - mydomain.org.uk.      14400      IN      A      XXX.XX.XXX.XXX
2 - mail.mydomain.org.uk.      14400      IN      CNAME      mydomain.org.uk
3 - www.mydomain.org.uk.        1400    IN  CNAME   mydomain.org.uk

OR

3 - www.mydomain.org.uk.        1400    IN      A      XXX.XX.XXX.XXX

With CF:

1 - mydomain.org.uk.      14400      IN      A      XXX.XX.XXX.XXX
2 - mail.mydomain.org.uk.      14400      IN      CNAME      mydomain.org.uk
3 - www.mydomain.org.uk.        1400    IN  CNAME   www.mydomain.org.uk.cdn.cloudflare.net
4 - cloudflare-resolve-to.mydomain.org.uk.  1400    IN  CNAME   mydomain.org.uk


This:

3 - www.mydomain.org.uk.        1400    IN  CNAME   mydomain.org.uk (without CF)

... is neither worse or better than

3 - www.mydomain.org.uk.        1400    IN      A      XXX.XX.XXX.XXX

But, if hostname #1 - mydomain.org.uk.      14400      IN      A      changes.XX.XXX.XXX,

then this is better, because only one IP needs to change.

3 - www.mydomain.org.uk.        1400    IN  CNAME   mydomain.org.uk (without CF)

If CouldFlare is setup, then everything resolves on CloudFlare, and CF takes over.


Either way, using a naked domain, or a WWW subdomain is irrelevant, because they're both different protocols. A 301 Permanent Redirect seems to be suitable, or SiteURL in WordPress - (I don't have access to httpd.config).

But, CloudFlare (through 3rd party partners), requires domain names to be http[s]://www. In this setup

3 - www.mydomain.org.uk.        1400    IN  CNAME   mydomain.org.uk

OR

3 - www.mydomain.org.uk.        1400    IN      A      XXX.XX.XXX.XXX

is irrelevant because CNAME will be used for www.mydomain.org.uk.

If I don't use CloudFlare

3 - www.mydomain.org.uk.        1400    IN  CNAME   mydomain.org.uk

.... is preferred, apparently. And I understand the reasoning, now.

Well, I know ExEx is the place to be, and I have been learning about various aspects from DNS to CDN to GZIP! So I'm trying to act like a sponge. Deciding NOT to use WordPress Multisite made everything easier for me in terms of the named domain VS. CloudFlare Partners in cPanel, so a little less pressure as we're inhousing, now.
0
 

Author Closing Comment

by:Dylan Thomas
ID: 40378703
In life, some answers are instructional, others help me see the way. This answer helped me see the way.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now