Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Modify the DDNS script and add relevant information
- #Set up scheduled tasks
- #Connect the domain name to cloudflare
- #Open cloudflare, log in to your account to add a website and follow the prompts
- #Get Global API Key
- #Visit https://dash.cloudflare.com/profile to find the Global API Key at the bottom of the page, click View on the right to view the Key, and save it, find the Global API Key at the bottom of the page, click View on the right to view the Key, and save it down
- #Set the second-level domain name for DDNS resolution, the traffic does not pass through the CDN (clouds are grayed out)
- #Add an A record, for example: hkt.test.com, set Proxy status to DNS only
- #Download DDNS one-click script
- curl https://raw.githubusercontent.com/aipeach/cloudflare-api-v4-ddns/master/cf-v4-ddns.sh > /root/cf-v4-ddns.sh && chmod +x /root/cf-v4-ddns.sh
- #Modify the DDNS script to add your own information
- vim cf-v4-ddns.sh
- # incorrect api-key results in E_UNAUTH error
- # Fill in the Global API Key
- CFKEY=
- # Username, eg: [email protected]
- # Fill in the CloudFlare login email
- CFUSER=
- # Zone name, eg: example.com
- # Fill in the first-level domain name that needs to be used for DDNS
- CFZONE_NAME=
- # Hostname to update, eg: homeserver.example.com
- # Fill in the second-level domain name of DDNS (just fill in the prefix)
- CFRECORD_NAME=
- #Run the script after setting
- ./cf-v4-ddns.sh
- #Run the script for the first time, the output will display the current IP, enter cloudflare to check to make sure the IP has been changed to the current IP
- #Set timed tasks (environment centos7)
- crontab -e
- */2 * * * * /root/cf-v4-ddns.sh >/dev/null 2>&1
Add Comment
Please, Sign In to add comment