Skip to content

Instantly share code, notes, and snippets.

@rampageX
Created October 19, 2016 05:40
Show Gist options
  • Save rampageX/9a2cde2789e3c1b53a34e0c75630420a to your computer and use it in GitHub Desktop.
Save rampageX/9a2cde2789e3c1b53a34e0c75630420a to your computer and use it in GitHub Desktop.
Pure SHELL dnspod DDNS renew
#!/bin/sh
#First you need to login to your dnspod.cn account to get your api key and key id, and your DDNS subdomain=ddns.mydomain.com
#then
LOGIN_TOKEN="key_id,key"
#get domain_id
curl -X POST https://dnsapi.cn/Domain.List -d "login_token=${LOGIN_TOKEN}&format=json"
#Let's say we got domain_id=12345
#get record_id
curl -X POST https://dnsapi.cn/Record.List -d "login_token=${LOGIN_TOKEN}&format=json&domain_id=12345"
#Let's say we got record_id=23456, record_line_id=0
#Now we can renew the ddns.mydomain.com ip:
curl -X POST https://dnsapi.cn/Record.Ddns -d "login_token=${LOGIN_TOKEN}&format=json&domain_id=12345&record_id=23456&record_line_id=0&sub_domain=ddns"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment