DNS - Cloudflare vs Netlify

Preface:
Despite my computer background, I am a newbie when it comes to DNS and web hosting. I’m the type of person who likes to create robust, flexible systems that are relatively inexpensive and easy to understand. This is my first web project, and I’m looking for opinions based on the research I’ve done so far.

Project:
I’m setting up my first website for a book I’m writing. Construction is underway, and soon I will need to register domain names. Here are my thoughts so far:

  1. Purchasing domains through Domain.com – Unlike Netlify, I can pay in advance for up to 5 years.
  2. Registering multiple domains to catch ‘type-in traffic’ – I plan to use .org for my site given its non-profit nature, but want to register .com just in case people accidentally type that instead.
  3. Using Cloudflare DNS – Here is the big question. Cloudflare sounds appealing because of its reported simplicity and flexibility. It also offers DDoS attack mitigation on its free accounts, and I’m not sure how that compares with Netlify. Lastly, it also sounds slightly easier to set up a 301 redirect for the multiple domains in Cloudflare, but I may be wrong. As for IPv6 support, there should be no problems with either DNS hosting option.

So first of all, the obvious question: Am I going overboard by favoring Cloudflare over Netlify? Which is more robust, easier to set up, and most flexible?

Second, if I do go with Cloudflare, I found this recently posted guide that seems very helpful. Without actually setting things up and testing it out, I’d like to know if this will work.

And just to give some additional background, I have read each of the following:

And this from 2016:

Thanks in advance for any input.

Greetings @makilahy!

And welcome to The Community :netliheart:

Appreciating your background and taking into account the extensive time spent working in/around/with/through Netlify by myself and the other Community Pilots and Netlify staff members here, it would be my genuine and sincere suggestion to use Netlify for DNS. I personally use NameCheap for Domain purchases but proxy nameservers to Netlify every single time. You’re going to have a much easier time working with Netlify tooling, UI, debugging, and workflow. Netlify makes adding multiple domains to a single site (up to 50, IIRC) as simple as clicking “Add Domain”, typing it in, and hitting go :stuck_out_tongue: (so long as you’re using Netlify nameservers for the domain) — this is how jonsully.net is also a simple alias for jsul.ly and jonsullivandev.com (yeah… I’m one of those guys :sweat_smile:). It’s really this simple:

And Netlify fully supports IPv6 (as you know).

Regarding simplicity, if you’re hosting a site on Netlify, Netlify absolutely takes the cake. Using it for DNS is actually a cakewalk, super handy, and is really the only ‘safe’ way to use an apex domain as your primary (e.g. using jonsully.net instead of www.jonsully.net — this really only matters for aesthetics). Netlify’s platform natively protects against DDoS (they’re protecting their servers too) and any form of outage at all is extremely rare. There are features that CloudFlare supports that Netlify does not, but unless you’re running a large enterprise outfit that has multiple folks overseeing CloudFlare services, I may recommend trusting Netlify :slight_smile:

Hope that helps!


Jon

3 Likes

@jonsully Thanks for your suggestions and feedback. Again, as a newbie, is there anything special I’d need to do after registering the domains on NameCheap other than what is documented below on Netlify’s documentation site?

Also, are the domain aliases in your example the exact same as a 301 redirect? I don’t want any negative impacts on my SEO (search engine optimization).

Lastly, something I forgot to ask earlier: Can the MX record be modified easily to use the custom domain feature with my paid ProtonMail account?

I found this, and it partly answers my question:

And related to that, how do you set SPF, DKIM, and DMARC records? All I could find is this:

Again, thanks for the help!

I can totally appreciate the depth of your questions and wanting to get a full-scope view ahead of time :slight_smile:

Regarding the process workflow, once you buy a new domain from the registrar, you would add that domain to your Domains panel at https://app.netlify.com/teams/<YOUR-TEAM>/dns. It allows you to provision DNS records ahead of time, but once you hit “Continue”, you’ll be given the name-servers to point your domain toward:

You’d just enter those values as the name-servers in your registrar’s interface.

Once the domain is configured, you can use Netlify’s DNS interface for managing all of your DNS records (including those outside of Netlify). Here’s an example of mine (although I’ve covered a few for security reasons) — this is a very typical DNS record management interface. Similar to what you’d see at CloudFlare or even at your registrar if you were managing DNS through them. NETLIFY records just indicate a link to one of my Netlify Sites.

I’m sure Netlify’s guide covers this more in depth than I have here, but hopefully that gives you an idea.


Yes, domain aliases are 301 redirects. As noted below, I misspoke in forgetfulness here — Domain aliases aren’t automatic 301 redirects. Please read my next response for more on that.


That should cover it :slight_smile:


Jon

2 Likes

@jonsully The setup was much easier than I anticipated! I forgot to register my second domain before adding it as a domain alias (because those functions are on separate pages), but that was my only hiccup.

I do have one last question. I was under the impression that a domain alias / 301 redirect would forward users to the primary domain. It does take the visitors to the site and uses SSL encryption properly, but the web browser still shows the alias in the address bar rather than correcting it to the official (primary) address. Is that just how it is, or is there a way to fix that? I’m guessing DNS can’t really fix that, can it? Sorry… probably a dumb question.

Otherwise everything is working beautifully! Thank you.

2 Likes

@makilahy I have to apologize! And edit my response above! I totally forgot a piece of the puzzle here and responded incorrectly regarding the 301 redirects.

Yes, domain aliases are 301 redirects.

Domain aliases can be setup as 301 redirects by using a _redirects file. I forgot that I have those _redirects setup on my Site for all of those aliases I showed above. If you don’t set up the _redirects,

Then this is the correct behavior — they really are “aliases”. I’m so sorry for forgetting that bit!

Now, that said, Netlify will automatically add a Link: <https://YOUR_PRIMARY_DOMAIN/>; rel="canonical" header into the response of any request that hits a domain alias. This means it’s not too big a deal from an SEO standpoint that your site is served on multiple domains (the Link: tells SEO crawlers to use your primary domain) but I can understand that you’d want to push all traffic to your main domain regardless (I do the same).

I’d start with a good read of the _redirects documentation:

Then once you have the idea down, you can implement redirects for each of your aliases that look like this: (these are mine):

https://jsul.ly/*                https://jonsully.net/:splat   302!
https://aka.fm/*                 https://jonsully.net/:splat   302!
https://jon.fm/*                 https://jonsully.net/:splat   302!
https://jonsully.netlify.app/*   https://jonsully.net/:splat   302!

Hope that gives you somewhere to start! And again, my apologies for the mishap on the ‘automatic’ 301s!


Jon

1 Like

@jonsully Thanks for the correction. My web developer created a configuration file (netlify.toml) last night, which looks very similar:

[[redirects]]
  from = "https://lemurwhospoke.com/*"
  to = "https://lemurwhospoke.org/:splat"
  status = 301
  force = true

This works perfectly.

1 Like