DNS update script for Amazon EC2 Instance
- Amazon AWS EC2 instance (ubuntu server 22.04 LTS)
- Cloudflare DNS Service (API)
This project is just a personal hobby project
All configuration is done in
config.py
which is fileconfig.py.example
renamed into
- Clone Repository
git clone https://github.com/ParkSnoopy/ec2-cloudflare-dns-updater.git
- Rename
config.py.example
toconfig.py
mv config.py.example config.py
- Go to Cloudflare Dashboard > Overview > Copy Zone ID
Update config.pyCLOUDFLARE_ZONEID
- Create API token according to this Cloudflare Docs
Update config.pyCLOUDFLARE_DNS_EDIT_APIKEY
- Change
'name'
of eachTARGET_DNSINFOS
into Your Domain Name
Change
COMMENT
or'tags'
if you want to
- run script
./init.sh
./update.sh
- add script to crontab
crontab -e
@reboot /path/to/repository/update.sh