## Cloudflare Integration

The Cloudflare integration with HWI allows users to use Cloudflare rather than HWI for DNS hosting, and gives the ability to use Cloudflare DDoS Mitigation and Cloudflare DNS Proxy services.

### Cloudflare Setup

#### Step 1:
From your [Cloudflare Profile Page](https://dash.cloudflare.com/profile) scroll down to 'API Keys' and click 'View' for 'Global API Key'.

#### Step 2:
After entering your password, copy the API Key and enter it into your HWI config. (Read the [Web Based Config](web-config#optional-integrations) or [Manual Config](manual-config#integrations) pages for info on how to do this.)

#### Step 3:
Enter the email address for your Cloudflare account in your HWI config. (Read the [Web Based Config](web-config#optional-integrations) or [Manual Config](manual-config#integrations) pages for info on how to do this.)

All Done!

### Enabling Cloudflare DNS for a Domain

#### Step 1:
Ensure the domain you disire to enable Cloudflare on is pointed to your HestiaCP server with 'NS' records. Cloudflare DNS will not work on domains using 'A' records.

#### Step 2: 
From the Management -> DNS page, (once your Cloudflare API Key and Email Address are entered in the HWI cofig) all eligible domains (Valid Top Level Domains) for Cloudflare DNS will display a button with the Cloudflare logo under the action column labeled 'Enable Cloudflare'. Click this button and allow the system to process the domain and records.

#### Step 3:
The domain should now show that Cloudflare is enabled, but it may take up to 24 hours for the DNS to propgate before Cloudflare services are active on the domain.

### Errors

The Cloudflare Integration is still in beta, and therefore, some errors may occur when attempting to enable Cloudflare or moving DNS records to Cloudflare's servers, and while an error code system is currently unavailable, all DNS records other than origianl NS records are backed up on the HestiaCP server.

If you face errors with Cloudflare, you can disable it from the Management -> DNS page or the DNS Domain edit page and your DNS records should be untouched. After disabling Cloudflare, your DNS Domain's NS records may need to be manually changed back to the HestiaCP defaults.