Host root domain on CloudControl - dns

I want to host a root domain like "example.com". The Alias addon allows you to host sub domains like "www.example.com".
But how to host the root domain "example.com" on cloudcontrol? Because I want to create a redirect from example.com to www.example.com.
I have already setup an alias from www.example.com to my cloudControl app successfully. But I was not able to setup an alias from example.com to my cloudControl app.
I'm not sure, whether I have understood everything with the Alias addon.
Best regards,
Christian

Since you can't add a CNAME to a root romain you can't link it directly to cloudControl.
The ugly way would be to manually create A-records to the (currently 3) cloudControl-loadbalancer-IPs, but cloudControl changes these (adds/removes loadbalancers) sometimes so you shouldn't do this.
For my apps I usually use the "URL"-record-type many DNS-Providers provide. In the background they use A-records to a seperate webserver that returns a redirect to the www-version.

You can also use a service like DNS Made Easy. They provide a custom type called ANAME, that's basically a CNAME without the CNAME limitations. They take care of updating the IP addresses in the background when necessary.
http://www.dnsmadeeasy.com/technology/aname-records/

Related

Heroku Naked SSL Custom Domain

I'm trying to find a current, up to date answer for setting up naked domain with Godaddy and Heroku SSL. My goal is for all pages to land on a secure page at https://www.example.com
https://www.example.com does go to a secure page.
example.com goes to an insecure page.
https://example.com does not work.
My current set up is as follows:
In heroku settings:
Domain Name | DNS Target
example.com | example.com.herokudns.com
www.example.com | www.my-domain.herokudns.com
Go Daddy Settings:
CNAME | www | www.example.com.herokudns.com
Forwarding settings:
Forward to: https:// | www.example.com
Yeah, it's a pretty stupid issue that some of the big DNS manager providers out there still have. The way to solve it is to have a server with an SSL certificate installed, and then point your naked domain to that static IP. The server then will redirect to the "www" version of your domain, which is now served under SSL by Heroku. Tedious.
If you don't want to do all that, just use https://www.nakedssl.com, which does exactly that – but automated (and for free for one domain).
Disclaimer: I'm part of the team that created NakedSSL, but I hope you take this as help and not as self-promotion. As explained above, the problem is as easy as tedious to solve, and I think NakedSSL is a pretty straight forward workaround.
Root domains on Heroku require the use of ALIAS ANAME or FLATTENING records.
Unfortunately, a number of popular DNS hosts such as GoDaddy, Bluehost, Google Domains, OVH, Hostinger and others do not support these types of records. Many of these Providers will tell you there is no such thing as ALIAS, ANAME or FLATTENING Records and many of these providers will tell you to set an A Record instead, however;
A Records do not work with Heroku for routing
A Records require static IP Addresses and static IP Addresses do not work with Heroku for routing, because Heroku (and many other cloud platforms) use dynamic IP's.
Instead, you can either:
Not use a naked domain and just use your www sub domain
Redirect/ Forward your HTTP root domain to your www sub domain. This won't work for your HTTPS root domain though
Use an Alternate DNS Provider. Heroku recommends the following: https://help.heroku.com/NH44MODG/my-root-domain-isn-t-working-what-s-wrong
Solved it.
Best way to get SSL set up is to use this package which automatically makes every page on your app SSL. Fantastic package. https://www.npmjs.com/package/force-ssl-heroku
Getting the naked domain set up with Godaddy easily: Set forwarding to your domain: https://www.my-domain.com. This will redirect non www to the correct place. :)
I believe naked subdomain or wildcards are not supported by heroku automated certs because of the let's encryption restrictions. So you need to set up a subdomain everytime you want to use Heroku's automatic certs.
ALSO VERY IMPORTANT! Don't forget to remove or edit any unsercured links to external assets. Otherwise browsers will jugde the page with those links unsecured as described in the Modzilla support page about mixed content.

"ERR_NAME_NOT_RESOLVED": Cloudflare + Openshift + NameCheap

My configuration is as follows:
NameCheap has Cloudflare nameservers only.
Openshift has domain alias changed from app-account.rhcloud.com to domain.com.
CloudFlare DNS settings has no A records, but two CNAME records: domain.com is an alias of app-account.rhcloud.com and www is an alias of domain.com.
CloudFlare Page Rules forward http://www.domain.com/* to http://domain.com/$1
These were all configured based on the solutions found online that have worked for others. My domain.com is accessible without issue, but www.domain.com provides this error:
I'm obviously missing something. Help would be greatly appreciated.
just FYI: you can have more than one alias even on free plan with OpenShift. Just go to alias list of you app and you can add another alias - url is: https://openshift.redhat.com/app/console/application/xxxxx-yourapp/aliases
Update: I stand corrected. See the chosen answer for the use of aliases which is a much better solution.
It seems the fix for this was rather simple. The problem was that the www.domain.com needs exist in OpenShift. Because my account is the free tier, OpenShift did not provide me an option to add another domain.
To mimic that, in OpenShift I added another application: PHP 5.4 with the domain alias www.domain.com replacing app-route-account.rhcloud.com.
Then in CloudFlare, I changed www is an alias of domain.com to www is an alias of app-route-account.rhcloud.com.
And, all is well. :)
If I was using a premium OpenShift account, I could have just added another domain to the first application, as www.domain.com. I hope this can help someone.

Free dns with wildcard subdomains?

Are there any free dns services i can use to access my local host over external ip that support wildcard domains? This way i can set up virtual hosts to serve the subdomain content based on subdomain name.
For example, suppose the free fqdn with dns service is:
example.com
Example.com - my server root, default vhost
Site1.example.com - loads site1 vhost
Site2.example.com - loads site2 vhost
*.example.com - i can create a vhost for whatever the wildcard value is and it'll work like the two above
I don't mind if the free fqdn is a top level domain. Example.aa.bb.cc is fine as long as i can set up *.example.aa.bb.cc
A free fqdn/dns without support for wildcard subdomains but has lots of free subdomains i could set up would be OK, but not preferred.
Also, dynamic dns is not a requirement. My external ip very rarely changes so i wouldn't mind updating it if it ever changes.
I know I'm asking for a lot for free. I don't mind buying a domain name but I'm trying to get away with free if i can.
You should consider to build your own domain server to handle the subdomain information, for example using Bind software. After that you need to submit your NS record to your domain register
Found a good one. dtdns.com is free and allows for wildcard subdomains for free.

CNAME to a wildcard subdomain

Just trying to create an web application, clients can create their own instance of the app, so I created a wildcard subdomain in CPanel, checked VirtualHosts and the A record in the DNS, all fine.
Now when I go to "client1app.domain.tld" it works, takes me to the clients app, but when that client creates a cname "app.clientdomain.tld" to "client1app.domain.tld", I get redirected to cPanels "Default Web Site Page".
I double-checked everything.
App DNS:
*.domain.tld. 3600 IN A x.x.x.x
Customer DNS
app.clientdomain.tld. 3600 IN CNAME client1app.domain.tld
App VirtualHost:
ServerName _wildcard_.domain.tld
ServerAlias *.domain.tld
Any help is greatly appreciated.
Note: I do have root, this is a VPS.
Simple things first, have you added *.domain.tld as a subdomain in cPanel using the user interface and not the command line?
I have tried to replicate this problem using one of my WHM servers and could not.
I recommend first updating cPanel/WHM to the latest version as some support articles covering wildcard subdomains point to some old versions of cPanel have bugs with wildcard subs which are now fixed.
I would also rebuild the httpd.conf if you have at any point manually edited it. Also make sure that the subdomain is not the same as the hostname as this causes some internal binding errors.
I set my environment up using only the cPanel sudomain button and not using the DNS editors in WHM or cPanel

How will a CNAME DNS affect Google Engine

I'm hosting a clients site at client.mysite.com, but my client want to have its own domain, like www.clientsite.com.
With a CNAME configuration, I'll be able to hook my client domain to the content, but... considering I'm still hosting my clients content, which domain will be finally listed on Google with contents of client.mysite.com contents?
a) mysite.com
b) clientsite.com
Thanks for helping.
In the DNS hierarchy, the CNAME resource record will be attached to the clientside.com. A CNAME is simply a reference to the location of that site's A record. With that in mind, I believe mysite.com will be listed as hosting the data.
Does your client want it to appear under his name?
If so, then this should not be solved using DNS (well, not only using DNS).
If your client wants to get the content listed under his domain name, the best way to do this, is to add their name to your server.
Then point client domain name to your server.
The best way to do the pointing (when also considering SEO)
is to make an webforward (301 permanent) from the root, to the www
and make the www subdomain point to the ressource.
(Or vice verca)
IF you are using the example above (webforward on root) you can use a cname instead of an A record to point the domain name. However do not add a cname to the root of a domain (effectively shutting down your domain name).
So-
Short Answer:
client.mysite.com will have the content (also according to google).
Any attempt to obfuscate this is black hat or grey hat ;)
a better way of doing it is to simply setup the clients domain name on your server.
Then point only one hostname to the server. Server host/headers will take care of the rest.
Setup in DNS
# webforward 301 www
www a or Cname to server
Quick rules:
NEVER put Cname on the root of a domain
Only allow 1 hostname to show content (can be done both as explained above via DNS/webforward or via server configurations)

Resources