Have a Question?
It’s Not Working – things to check
Missing dns_write_post.sh file
When daflare is installed, it creates an almost empty file at /usr/local/directadmin/scripts/custom/dns_write_post.sh
daflare’s actual activation script is stored within the plugins folder, but at present this file needs to exist for the plugin’s script to be called by DirectAdmin. It may be that DirectAdmin removes this requirement in the future.
/…/dns_write_post.sh: 1: -e: not found’
To fix the following error:
/usr/local/directadmin/scripts/custom/dns_write_post.sh: 1: -e: not found’Edit the file ‘/usr/local/directadmin/scripts/custom/dns_write_post.sh’ and remove the ‘-e ‘ from the beginning of the script. That script should just be left with the following:
#!/bin/bashFailed Adding Record … CNAME …amazonses.com – DNS Validation Error
Note that some CNAME records are unable to be proxied in Cloudflare. Unfortunately Cloudflare just returns a basic ‘DNS Validation Error’ without a description of why the record couldn’t be added. If this happens, add the CNAME record to a custom configuration for the domain with the proxy set to OFF and try again.
If the error persists, all you can really do is go to Cloudflare and manually add the record and see what extra message Cloudflare gives you.
Unauthorized to access requested resource
If you click on Verify Token and get the message, ‘This API Token is valid and active’, but also get the message, ‘Unauthorized to access requested resource’, this is caused by a missing API Permission.
The permission missing is quite possibly the ‘User -> Read’ permission, which is technically not required to use the plugin, but helps to confirm that you are using the correct token – especially if you have multiple Cloudflare accounts.
Follow the ‘Create an access token’ information on the Setting up Cloudflare page to rectify this.

Cannot use the access token from location
If you click on Verify token and get the message, ‘This API Token is valid and active’, but also get the message, ‘Cannot use the access token from location:’, then your access token is valid, BUT the IP filter you have set is incorrect.
It will most likely be a IPv6 address that it will list as the location you are trying to use the api from. This is the address that needs to be set in your IP filtering settings for your token in Cloudflare.

Incorrect PHP version message
daflare requires PHP version 7.4+
If you get a message saying that you have an incorrect version of PHP, you can easily point daflare to a custom PHP binary.
Domain zone file not found error
If every sync fails with the following error:
Domain zone file not found – maybe domain has not been created on the server…
there are two known causes.
After upgrading to PHP 8.5 (daflare 0.14.x and earlier)
On PHP 8.5, clicking ‘Update Config’ in Admin Defaults could save a PHP deprecation message as the named folder location instead of the real path. Every sync then fails because daflare can’t find any zone files.
To fix this:
- Update daflare to version 0.15.0 or greater: go to the DirectAdmin Plugin Manager, click on + next to daflare, then on ‘Update’.
- Open the daflare Control Panel and click on the red ‘Edit Admin Defaults’ button.
- Scroll to the bottom and click on ‘Update Config’ once. This re-detects and saves the correct named folder location.
From version 0.15.0, daflare reports an invalid saved location with instructions, rather than failing on every sync.
Debian or FreeBSD (daflare 0.11.5b and earlier)
If you are running the Debian or FreeBSD distro, you may see this error when you switch the Direct Zone File Access mode to ‘Standard’.
Version 0.11.6b or greater fixes this error. After updating, click on ‘Edit Admin Defaults’, confirm that Standard mode is selected, then click on ‘Update Config’ at the bottom.
Something fails but no error is shown
From version 0.15.0, PHP errors are no longer displayed in daflare’s output or the DirectAdmin interface. They are written to the log instead, so a problem may now show up as a sync that silently does nothing.
If daflare isn’t behaving as expected, check:
- the daflare log:
/var/log/daflare.log(or the location set in ‘Log messages to file’ in Admin Configuration) - the PHP error log for the PHP binary daflare uses, if the daflare log is disabled or the ‘Log messages to file’ field is blank
See File Locations (Config & Log) for more details.
