This FAQ addresses common issues and solutions for configuring UniFi devices to update Cloudflare DNS records using DDNS, based on discussions from issues and discussions.
The server configuration depends on your UniFi device model:
-
Older Gateways (e.g., USG, USG Pro):
- Server:
unifi-cloudflare-ddns.<your_worker_subdomain>.workers.dev
- Note: Do not include the path with variables.
- Server:
-
Newer Gateways (e.g., UDM series, UXG series):
- Server:
unifi-cloudflare-ddns.<your_worker_subdomain>.workers.dev/update?ip=%i&hostname=%h
- Note: Include the full path with variables.
- Server:
This distinction is crucial to ensure the DDNS updates function correctly.
-
Access UniFi Controller:
- Navigate to Settings > Internet > WAN > Dynamic DNS.
-
Create New Dynamic DNS Entry:
- Service: Select
custom
. - Hostname: Enter your desired hostname (e.g.,
subdomain.example.com
). - Username: Enter your Cloudflare account email.
- Password: Enter your Cloudflare API token.
- Server: Enter the appropriate server address based on your device model (see FAQ #1).
- Service: Select
-
Save Configuration:
- Click Save to apply the settings.
Remove https://
from the Server field before inputting the server address.
This error typically occurs due to incorrect server configuration. Ensure that:
- For older gateways, the server field contains only the FQDN without the path.
- For newer gateways, the server field includes the full path with variables.
Double-check your device model and adjust the server configuration accordingly.
For UDM-Pro devices:
-
SSH into your UDM-Pro:
- Use an SSH client to access your device.
-
Run the following command:
ps aux | grep inadyn inadyn -n -1 --force -f /run/ddns-eth4-inadyn.conf
-
Check Logs:
- Review
/var/log/messages
for any errors or confirmation messages indicating successful updates.
- Review
For USG devices:
-
SSH into your USG:
- Use an SSH client to access your device.
-
Run the following command:
sudo ddclient -daemon=0 -verbose -noquiet -debug -file /etc/ddclient/ddclient_eth0.conf
-
Check Output:
- Look for
SUCCESS
messages indicating that the DDNS update was successful.
- Look for
Yes, for subdomains (e.g., sub.example.com
), you should manually create an A record in Cloudflare before configuring DDNS on your UniFi device.
For wildcard domains, use *.example.com
in the Hostname field when setting up DDNS in your UniFi device.
The User API token should have the following permissions:
- Zone:
- Read
- DNS Edit
Ensure the token is scoped to only one specific zone (domain) you intend to update.
UniFi devices typically check for IP changes and update DDNS records approximately every two minutes.
In dual WAN configurations, UniFi devices may not natively support configuring DDNS for both WAN interfaces simultaneously. To manage DDNS updates for both connections use different DDNS providers.
Assign separate DDNS providers to each WAN interface if supported. Using the custom
DDNS provider for one WAN connection and dyndns
for the other is recommended.
-
Verify Configuration:
- Double-check all entries in your DDNS settings for accuracy.
-
Check Logs:
- Review system logs on your UniFi device for error messages.
-
Seek Community Assistance:
- Engage with the community by posting issues or questions on relevant GitHub repositories or forums.