Setting Cloudflare DNS with Netlify
2020 March 29thSince Netlify is gaining popularity and I love how Gatsby works I decided in the last moment to switch my blog to Gatsby hosted on Netlify. A possibility of being able to deploy it from a git repository with pipeline was enough for me. After a quick setup of the platform and the page, I decided I want to leave my domain where it already is, on Cloudflare.
Netlify deploys your repository and binds a subdomain of the netlify.com domain. To use your own domain first step is to point the CNAME record of your domain to the custom provisioned netlify.com subdomain.
Unfortunately, that will not be enough. It surprised me when I got the Not Found index page. The web requests were passing trough but Netlify did not respond to my request. What happens is that Netlify has an internal routing system that returns your index page on the bound domains.
To completely provision your domain you would need to go to settings of your page and add your domain at custom domains section. This step is not adding your domain to Netlify DNS which also is possible. It will add a route to your Netlify site.
One more step is needed and that is turning off the Cloudflare CDN. A click on the orange cloud on the DNS section of Cloudflare. Otherwise, you will get infinite loops and conflicts of Netlify and Cloudflare caching.
Netlify provisions free Lets Encrypt SSL certificates up to 24 hours since you provisioned the domain name record.