Welcome to WebmasterWorld Guest from

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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 14, 2003
votes: 1

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
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?



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

Preferred Member

10+ Year Member

joined:Sept 28, 2002
votes: 0

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,

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 14, 2003
votes: 1

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.