Skip to content

A tool that can help you update the dns record to your current ip to implement dynamic dns

License

Notifications You must be signed in to change notification settings

hzlmy2002/cloudflare_ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

  1. You should have one domain,and add a subdomain for this script.For example,if your domain name is "helloworld.com",your subdomain name might be "ddns.helloworld.com".
  2. The most important thing is to get your cloudflare api key,it can be found at "https://dash.cloudflare.com/profile/api-tokens". The api_key is the "Global API Key".
  3. Install the requirements.
pip3 install requests
  1. Edit "main.py" and input your own information then using cronjob to run this program automatically.Please be reminded that your should first setup the environment variables(CF_Email,CF_Key,CF_Domain,CF_Host) so that the script can run properly.
#note:This sample only takes effect if you are using vixie-cron(Debian,Ubuntu).If you are using cronie(Arch,Redhat),please use "export xxx" instead.

CF_Email="[email protected]"
CF_Key="adiauyicas4d5a465a46"
CF_Domain="example.com"
CF_Hosts="hostname1,hostname2"
*/5 * * * * /usr/bin/python3 /opt/cloudflare_ddns/main.py
  1. Now it should work, just enjoy.

About

A tool that can help you update the dns record to your current ip to implement dynamic dns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages