Welcome to WebmasterWorld Guest from 54.166.152.121

Forum Moderators: buckworks & webwork

Message Too Old, No Replies

CNAME Domain Redirect

DNS newbie wondering if ...

     
9:55 am on May 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CNAME can be used to redirect a domain to another on the same server.

A client owns the .com and the .co.uk variation of a domain. The .co.uk is set up on our server. We told them to set up domain forwarding from .com to .co.uk but they changed the A record instead to point to the server.

I was wondering if, without physically setting the .com on our server we could add something like:

domain.co.uk IN A 1.2.3.4
domain.com IN CNAME domain.co.uk

on our server and if that would solve the issue. Or is that not the way CNAME are used for?

Thanks

le_gber

4:02 pm on May 20, 2008 (gmt 0)

10+ Year Member



Hi le_gber,

there is no such thing in DNS as a 'redirect'.
A CNAME record is defining an ALIAS name to some other name. And somewhere that aliasing has to end at a real A record.
So having a direct A record in the first place instead of a CNAME is not bad per se, as it would probably save additional lookup overhead.

All records of a domain must be defined in that domain's authoritative zone, so for the two domains involved there are two different zones files, and just defining a foreign 'domain.com.' record within another domain's (domain.co.uk) zone, as you suggest, would have no effect as this would not be seen anywhere.

So what your customer did on his 'domain.com' end looks good to me.

Now that user requests for domain.com end at your HTTP-server, it is up to your HTTP server to handle these, perhaps by setting a HTTP 301 re-direct to avoid duplicate web content problems.

Another way so solve this could be to let the domain.com A record point to a HTTP-server at your customer's end and your customer sends HTTP 301 redirects to your HTTP server.

So to summarize:
- the .com domain has its own DNS records in an own zone file
- the .com name can either point to your server or the customer's
- he who gets that pointer has to set up a HTTP redirect to the other domain then

Hope that helps.
Kind regards,
R.

8:37 pm on Jun 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Romeo,

thank you for your answer, and sorry I didn't reply earlier I was so busy working on clients' sites that I forgot I asked the question :)

thanks again.

le_gber

 

Featured Threads

Hot Threads This Week

Hot Threads This Month