How to setup DNS hosting on Cloudflare

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
So far I've
1) registered a free domain at Freenom (example.cf)
2) Signed up for a free account at Cloudflare
3) Told Freenom to use the Cloudflare DNS for my domain (arnold.ns.cloudflare.com, tia.ns.cloudflare.com)
4) Signed up for DNS-O-Matic account and configured it for Cloudflare (it shows my WAN ip)
5) Setup my pfsense router Service/Dynamic DNS/ Service DNS-O-Matic, Hostname my Freenom domain (example.cf), cached IP shows my WAN IP
6) setup the Nextcloud install script to use DNS validation

When I go to example.cf I get the error 522
"An Error 522 means that the request was able to connect to your web server, but that the request didn't finish. The most likely cause is that something on your server is hogging resources"

My guess is that the problem is with the Cloudflare DNS tab settings. These setting were done manually as nothing showed up on initial setup of the freenom domain in cloudflare.
Questions:
1) Can someone explain how to setup the Cloudflare DNS tab?
2) Do I need to do anything else in the pfsense router to direct traffic to the nextcloud jail like I would if forwarding port 80/443 to the jail?

EDIT: turns out caddy was not running and after the service was started I get error 523. The most common cause is that your DNS settings are incorrect
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey Naskar,

Wow! Let me say that you like to make simple things very complicated :smile:

Just do it all in Cloudflare! That is exactly what I am doing here :
I registered my domain with CloudFlare
Cloudflare is also hosting my DNS zone
My pfSense update my dynamic DNS record at Cloudflare as well

Because you registered with someone else, you will have to move from your actual registrar to Cloudflare. If you "locked" your DNS domain, you will need to unlock it first. That can takes a day or more depending of your first registrar.

Once unlocked, ask your actual registrar for the key to provide to Cloudflare for the move. They will give you the key and you will need to give it to Cloudflare when requesting your move.

Once Cloudflare is both your registrar and DNS hosting service provider, you will be able to get the API Key you need for configuring your DDNS client.

But really, to mix and match 3 providers for a single service, that is just asking for trouble and making the simplest thing as difficult as they can be!
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Heracles,
I trying to use freenom for a free domain to try it out. I can always change to a purchased domain later. While tooling around Cloudflare's site I came across the domain transfer page that says my domain cannot be transfer and is unsupported. That's odd because Danb35 outlines the process in his script readme.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I think I got it working as I got an email from cloudflare that my domain has been added.
1) I had to tell Freenom to use the default DNS setting and wait 24hrs to let it propagate.
2) Add the domain to Cloudflare and get the DNS setting from them and change it in Freenom
3) Wait for the new DNS setting to propagate and an email saying the domain was added appears
Hope this helps someone else that is new to this process like me.
 
Top