bradykey / softball-reference-ui

Vue.js Front-end to the Softball Reference Web Application
0 stars 0 forks source link

Move DNS host to CloudFlare in order to have a "naked" root work #6

Open bradykey opened 2 years ago

bradykey commented 2 years ago

I noticed that the "naked" domain, or root, which is softball-reference.com wasn't correctly hitting my site. This is because you can't use CNAME records with a root domain, and more specifically, all naked domains must point to a direct IP address. Well Heroku (and other hosting services) use dynamic IP addresses, so we have to use a CNAME that points to a dynamic endpoint on Heroku. Therefore, my CNAME on google domains is setup with a host name of www.softball-reference.com and you must enter it that way. Well, you can set up some domain forwarding to say, "when you hit the naked domain @ softball-reference.com, go to http://www.softball-reference.com". This works for now, but supposedly will only work for non-ssl sites? The other option is to use a domain hosting that does aliasing or CNAME flattening that work with heroku (Cloudflare looks like the best). NOTE: you can have DNS be done by a different company than who is your domain registrar... I could do all the domain ownership with GoogleDomains but NOT use their free DNS tools and instead use Cloudflare for the DNS tooling (https://support.cloudflare.com/hc/en-us/articles/205195708-Changing-your-domain-nameservers-to-Cloudflare)

https://social.dnsmadeeasy.com/blog/registrar-or-dns-hosting-the-difference-explained/

https://help.heroku.com/NH44MODG/my-root-domain-isn-t-working-what-s-wrong