map subdomain to another subdomain via cname

Posted by Stephen on Server Fault See other posts from Server Fault or by Stephen
Published on 2012-11-27T21:22:52Z Indexed on 2012/11/27 23:10 UTC
Read the original article Hit count: 1117

Filed under:
|
|

Question: I need to get DNS configured to point a subdomain from one domain (which I will generally not be controlling) to another subdomain on a different domain name. Testing this process using a simple CNAME entry keeps pointing to the primary domain and not the subdomain where it should be going.

This is the scenario; (newdomain.com is in my control)

  • cdn.xyz.com should display content from this subdomain subdomain.newdomain.com
  • It is instead displaying content from newdomain.com (not the subdomain sub domain)
  • cdn.xyz.com/page.htm displays content from newdomain.com/page.htm although what I need is it to display content from subdomain.newdomain.com/page.htm

Other Background:

  • setup is between two different servers with different IP ranges although DNS cluster is on between all servers
  • the newdomain.com is set up with its own unique IP (which is on the A records for the subdomains, the subdomains work as expected/normal)
  • the DNS entry is correct (cdn CNAME subdomain.newdomain.com.) ie the end period is included
  • a DNS lookup on the CNAME externally reports back as subdomain.newdomain.com. as the record

Does anyone know what DNS entries I am missing to get this working correctly ?

Note: I do not want to just put a redirect between domains as I need the content of subdomain.newdomain.com/content.html to be visible via the URL of cdn.xyz.com/content.html also I can just use some redirects on newdomain.com to achieve what I am after but would prefer to just get the DNS correct.

EDIT

Current DNS

cdn CNAME subdomain.newdomain.com. || CNAME entry for domain1

subdomain A XXX.XXX.XXX.XXX || A record entry for working subdomain pointing to unique IP

What should happen is that cdn.domain1.com -> subdomain.newdomain.com

What is happening is cdn.domain1.com -> newdomain.com (ie. the root not the subdomain)

EDIT 2

Actually if its easier I am trying to emulate a simple cloud setup like Rackspace Containers (which I assume is similar to Buckets on AWS). although it is not for cloud storage

Where a container has a url reference of hd62321678d323.rackspace.com (in truth they are much longer) so I can use a CNAME record of: cdn CNAME hd62321678d323.rackspace.com.

so that http://cdn.mydomain.com/myfile.jpg displays content from http://hd62321678d323.rackspace.com/myfile.jpg

© Server Fault or respective owner

Related posts about dns

Related posts about subdomain