Skip to content

SamWang8891/cloudflare-ddns-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudflare-ddns-script

The script to update Cloudflare DNS record

Introduction

This script updates the DNS A record to Cloudflare. This means that you'll get a DDNS-like function by using this script.

Usage

1. Install the needed packages.

The needed package are "curl", "jq" and "git".

  • For Debian/GNU and Ubuntu-based:
sudo apt install -y curl jq git
  • For others, please figure out yourself as I'm not familiar with all OS

2. Create DNS record

Create a DNS A record you want the script to update in the Cloudflare web dashboard.


3. Clone the repository

Change the directory to your desired location then

git clone https://github.com/SamWang8891/cloudflare-ddns-script.git && \
cd cloudflare-ddns-script

4. Modify the config.sh file

Inset the needed information to the config.sh file.


7. Add execute permission to update-dns.sh file.

chmod +x update-dns.sh

8. Run the script

./update-dns.sh

9. (Optional) Add to cronjob.

Run cronjob -e and add * * * * * bash /path/to/update-dns.sh to the file. Change the time as desired.

About

The script to update Cloudflare DNS record

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages