fbpx
Blog image

3 – Cloudflare DNS Synchronization with CyberPanel

You are here:
< Back

In version v2.0.0, CyberPanel has added the ability to synchronize DNS entries between Cloudflare and CyberPanel DNS on your own server

What is Cloudflare?

Cloudflare is reverse proxy service, which offers certain features such as

  • CDN (Cloud Delivery Network) by caching the data from your website and serving them from their Point of Presence nearest to your visitor. This decreases the load on your server and saves bandwidth
  • Network Gateway by automatically translating between IPv4 and IPv6
  • SSL provider by issuing a certificate for your domain on their own server with one click with zero changes on your server
  • WAF (Web Application Firewall) as Cloudflare sits between your visitors and your server it can block
  • It offers direct installation of many apps without changing anything on site.

Why do you need synchronization

In order to use Cloudflare the nameservers of the domain are changed to the ones provided by Cloudflare and that means any changes done such as adding subdomains or changing mail providers or using a new DKIM key on CyberPanel have to be manually inputted in CloudFlare’s DNS panel. You have to repeat the process for every change you make to every domain on your account on CyberPanel.

That’s a lot of manual data entry and we at CyberPanel made it easier for you to do by adding Cloudflare integration right into your CyberPanel.

What does CyberPanel Synchronisation do

CyberPanel has added deep integration with Cloudflare which can automatically do the following on your behalf

  • Add, edit or remove DNS records: Whenever you create new DNS entry like for email or subdomain or text verification, you don’t have to log in to your Cloudflare account and do it again manually
  • Create necessary zone info and domain in Cloudflare: When you create a new website on CyberPanel, CyberPanel checks if that domain is in your Cloudflare account.
    • If it is already present, Cyberpanel will create all the DNS records and copy them over to Cloudflare DNS records.
    • If it isn’t present. CyberPanel will create the domain in Cloudflare with a basic free account and then create all the DNS records and copy them over to Cloudflare DNS records.
  • Constant sync: If you change any of the records on CyberPanel or any record is missing from the Cloudflare account, this feature will update and/or populate the changes on your Cloudflare account.

How to use Cloudflare integration

From version v1.9.5 onwards, you can use Cloudflare integration by going into DNS-> Cloudflare

You will be greeted by a screen like this

In order to obtain API token from Cloudflare click the avatar on the right of you Cloudflare account and under profile setting click the API token tab

Click on the blue “View” button next to Global API Key. Enter your password to get your API token key

 

Please enter the email address that you use on the Cloudflare account and you Cloudflare API token generated in the last step on Cloudflare setting page in CyberPanel and select Enable for Sync local Records to Cloudflare

Click save

On the next screen, you can add remove or sync your DNS between CyberPanel and Cloudflare

Voila, in less than 10 minutes we were able to integrate Cloudflare with Cyberpanel and we have made DNS updates easy as a breeze directly from the CyberPanel

 

Author's page
Muttahir Syed

Muttahir is a passionate developer and a DevOps engineer who loves to help others by documenting tech. At CyberPanel, he works as DevOps support and documents new changes

Comments

  • Walter March 7, 2020 at 7:21 pm

    Hello, a query, I tried to synchronize by following all the steps, but when I am at the end and try to access the dns already synchronized I get this message “Cannot fetch records. Error message:module ‘CloudFlare’ has no attribute ‘CloudFlareAPIError'”.
    can you give me a hand please.

    Reply
    • Muttahir Syed March 14, 2020 at 8:16 pm

      Check API permissions from Cloudflare to make sure you allowed all zone level powers and update CyberPanel as issues are fixed daily on beta version

      Reply
      • Furkan March 29, 2020 at 12:09 am

        Whenever api key n account id entered and i choose sync to cloudflare and save it, on the next page named “manage dns”, whenever i choose the domain, im getting same error.

        Reply
  • Cassius Giorgio March 8, 2020 at 7:59 pm

    Awesome! Great Job!!!

    Reply
Leave a Reply