0
votes

I just registered a .io domain name with namecheap.com and have a RoR app hosted on openshift. When I create a CNAME record for www to point to my openshift app at myawesomeapp.rhcloud.com, namecheap adds a "." after the openshift url. This causes wrong translation as the request is redirected to myawesomeapp.rhcloud.com. and openshift sees it as different from myawesomeapp.rhcloud.com

2

2 Answers

0
votes

DNS deals with names of hosts and zones/domains. DNS doesn't know about URLs. Web servers know about URLs. The main task of a name server is to look up a name, and return its associated ip address. They don't redirect. Even if you use a CNAME record, at the end there will be an ip address. The intermediate name the CNAME record resolved to, is not carried over from web client to web server in its request. Therefore, your web server won't see the trailing dot as result of the nameserver producing it. Your problem is caused by something else.

0
votes

The "." after a url is the correct CNAME convention. However, it depends on how the http server is configured to correctly translate a given url. In my case, openshift sees app.domain.com and app.domain.com. as different URLs and tries to forward request for the latter to a different web server. For obvious reasons, it can't find one and throws a 404.

If you've domain registered with namecheap and you come across a similar problem, use the URL-frame (url cloaking) record instead of a CNAME record. URL-frame works same as url redirect except it doesn't change the url in your browser.