# DdnsOnCloudFlare
A shell script to automatic update cloudFlare dns record whit actual external ip address, leveraging the official CloudFlare api.
# Guide
## Pre-work
- Have a domain and use Cloudflare's nameserver.
- Find your `ZoneId` from the [overview] page of you domain.
- Create an `api token`. You can find it from [Here](https://dash.cloudflare.com/profile/api-tokens)
- Clone this project to local, fill in `config.conf`. In which, `zoneId` and `apiKey` refer to the contents you just got in the above steps. `recordName`is the dns record name you'd like to operate.
## Update Ipv4 record
Simply run:
```shell
sh ./updateIpv4.sh
```
This will first get your external ipv4 address, and synchronize to the dns record.
If no such record exists, will create one.
If the record is already set as the expected ip, will do nothing.
Or, the record will be updated.
## Update Ipv6 record
Similar to the previous, but just run:
```shell
sh ./updateIpv6.sh
```
The behavior is also the same.
# Note
- You can make it periodically executed using [crontab](https://linuxconfig.org/linux-crontab-reference-guide).
- DO NOT abuse. According to the term of cloudflare, the api call rate is limited to 1200 requests every 5 minutes.
没有合适的资源?快使用搜索试试~ 我知道了~
CloudFlare利用API token进行动态dns解析
共6个文件
sh:3个
conf:1个
license:1个
需积分: 32 3 下载量 161 浏览量
2022-08-09
14:10:49
上传
评论
收藏 15KB ZIP 举报
温馨提示
CloudFlare利用API token进行动态dns解析 1.下载资源到本地解压 2.修改config.conf中zoneId、recordName、apiKey 3.设置任务计划定时运行updateIpv4.sh或者updateIpv6.sh从而自动更新CloudFlare的动态ip
资源详情
资源评论
资源推荐
收起资源包目录
DdnsOnCloudFlare.zip (6个子文件)
DdnsOnCloudFlare-main
updateIpv4.sh 1KB
base.sh 3KB
updateIpv6.sh 2KB
LICENSE 34KB
config.conf 206B
README.md 1KB
共 6 条
- 1
qq_32949623
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0