python实现dnspod自动更新dns解析的方法
代码如下:
def ddns(): """ 用当前ip更新ddns """ headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/json"} conn = httplib.HTTPSConnection("dnsapi.cn", timeout=30) conn.request("POST", "/Record.Ddns", urllib.urlencode(ddns_params), headers) response = conn.getresponse() # print response.status, response.reason # data = response.read() # print data conn.close() return response.status == 200
相关推荐
xushxbigbear微信 2020-03-04
linuxisperfect 2009-07-27
bnmcvzx 2019-04-01
xiaouncle 2016-02-18
Mrsandman 2016-06-16
DevinChen 2012-01-13
StupidBirds 2013-06-08
hmslucky 2013-06-08
codingtu 2010-08-05
xianhe0 2012-10-28
linuxhong 2010-02-23
ScienceExplorer 2019-04-13