Skip to content

Update Cloudflare DNS record with shell script (on EdgeRouter X)

License

Notifications You must be signed in to change notification settings

mu373/cloudflare-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cloudflare-ddns

Update Cloudflare DNS record with shell script on EdgeRouter X

Forked from lifehome/systemd-cfddns/src/cfupdater-v4

Use case

This script is intended to be used for specific needs:

  • Upstream router before EdgeRouter X runs NAT
  • EdgeRouter X itself does not have a global IPv4 address on any interfaces

Although EdgeRouter X has build-in Dynamic DNS client, it does not work in an environment where its interface does not have global IPv4 address.

Setup

  • Update settings in the script
    • auth_key: Top right corner, go to "My profile" > "API token" and generate new token allowing access to read and edit DNS.
    • zone_identifier: Can be found in the "Overview" tab of your domain
    • record_name: Domain which you want to update the A record
    • keep_log: Whether or not you want to keep IP address changes as log (true/false)
  • Copy script to EdgeRouter /config/scripts.
  • Update permission on EdgeRouter: chmod 755 cloudflare-ddns.sh
  • Set task scheduler
configure
set system task-scheduler task cloudflare-ddns executable path /config/scripts/cloudflare-ddns.sh
set system task-scheduler task cloudflare-ddns interval 15m
commit; save; exit;
  • Confirm scheduled task
configure
show system task-scheduler
exit

About

Update Cloudflare DNS record with shell script (on EdgeRouter X)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages