2

I am a little stuck here I currently have a domain:

www.exammple.org & m.example.org

I want to point m.mainsite.example to m.example.org

I already have an A record created for m.mainsite.example, I need to know what I have to do to the server where example.org is on.

I have this site on an Unix Apache server.

1 Answer 1

5

What you probably want is called a CNAME Record. This is like a softlink to a domain.

You would add it wherever your DNS provider has the A record you mention, and it would look something like

m.mainsite.example. CNAME m.example.org.

This tells the DNS resolver that whenever it sees m.mainsite.example, it should go try and resolve m.example.org

Note the trailing dots -- some DNS providers require them, some do not. When in doubt, use them.

Note that this doubles the initial lookup time for someone visiting your site; they have to do two lookups now.

A faster way that requires more maintenance is to just add an A record for m.mainsite.example that points to the IP address at example.org. If you do that, you will need to update both in case of a new IP address, or a failover scenario.

2
  • Thanks Peter... we having a small problem with having this properly redirect when using a mobile browser. I have added user agent conditionals to the .htaccess file but still nothing. Would or could you recommend a solution. We are using jQuery mobile on a linux box.
    – TikaL13
    Aug 16, 2011 at 14:17
  • I would definitely recommend the DNS CNAME route. I can't comment on your htaccess file without seeing it, unfortunately!
    – Peter V
    Aug 16, 2011 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.