This script allows to update ipv4/ipv6 dns on cloudflare also for free domains (.tk .ml .ga .cf .gq) that normally could not because the api is blocked.
The dns value will be updated only in case it is different.
Project includes:
- Python
- Selenium webdriver
- Request
- Python3
- Chromium or Chrome
- Chromedriver
- auth_email :
account email
- auth_password :
account password
- auth_key :
see below
- zone_identifier:
see below
- zone_name:
your domain, example: domain.it
- record_name:
your subdomain, example: subdomain.domain.it
- proxy:
do you want to use cloudflare proxy?
- ttl:
if you use the proxy leave the default value
- type:
"AAAA" for ipv6, "A" for ipv4
- Go in your profile in your dashboard
- Select “API Tokens”
- Create a new token api
- Select “Edit zone DNS” templates
- In “Permissions” select ZONE -> DNS -> READ
- In “Zone Resources” select INCLUDE -> your zone or all
- If you want you can define a TTL for your token
- Continue to summary
- Create Token
- Copy your token in the config.json file
- Go in your dashboard and select the correct domain
- In the overview pannel you can found this token
- Install dependencies:
- pip install selenium requests
- Crontab:
- crontab -e
- add */5 * * * * /home/cloudflare/cf-dns.py
- crontab -l
- move chromedriver binary in the same directory
- edit config.json and insert the correct configuration
- python cf-dns.py
- insert chromedriver binary path on the system path
- sudo nano /etc/paths
- example: /Users/luca/chromedriver
- edit config.json and insert the correct configuration
- sudo chmod +x cf-dns.py
- ./cf-dns.py
- move chromedriver binary in the same directory
- edit config.json and insert the correct configuration
- sudo chmod +x cf-dns.py
- ./cf-dns.py
- sudo pacman -S chromium
- Download from assets: https://github.com/electron/electron/releases