感觉速度还可以
cs.naigou.cn
竟然没封443
ROYWANG 竟然没封443
公网ddns+cdn
i5 4590t 三星ddr3 8g 128g的m.2 宝塔跑分2w,惠普400g1dm小主机,买的时候比较贵,500块收的二手,功率不到30w
丁真 公网ddns+cdn
怪不得......等我狠狠开刷
ddns?那带宽不被ddns限制了吗
我也是
wwwroot ddns?那带宽不被ddns限制了吗
from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.dnspod.v20210323 import dnspod_client, models from urllib.request import urlopen # 添加这行导入语句 import json # 添加这行导入语句 ipv4_flag = 1 # 是否开启 IPv4 DDNS 解析,1 为开启,0 为关闭 secret_id = "xxx" secret_key = "xxx" domain = "1.cn" # 你的主域名 name_ipv4 = "a" # IPv4 DDNS 解析的子域名 cred = credential.Credential(secret_id, secret_key) httpProfile = HttpProfile() httpProfile.endpoint = "dnspod.tencentcloudapi.com" clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile client = dnspod_client.DnspodClient(cred, "ap-guangzhou", clientProfile) def get_records(sub_domain, record_type): params = { "Domain": domain, "SubDomain": sub_domain, "RecordType": record_type } req = models.DescribeRecordListRequest() req.from_json_string(json.dumps(params)) resp = client.DescribeRecordList(req) return json.loads(resp.to_json_string())["RecordList"] def update(record_id, sub_domain, record_type, value): params = { "Domain": domain, "RecordId": record_id, "SubDomain": sub_domain, "RecordType": record_type, "Value": value, "RecordLine": "默认" } req = models.ModifyRecordRequest() req.from_json_string(json.dumps(params)) resp = client.ModifyRecord(req) print(resp.to_json_string()) def add(sub_domain, record_type, value): params = { "Domain": domain, "SubDomain": sub_domain, "RecordType": record_type, "Value": value, "RecordLine": "默认" } req = models.CreateRecordRequest() req.from_json_string(json.dumps(params)) resp = client.CreateRecord(req) print(resp.to_json_string()) # IPv4 DDNS 解析 if ipv4_flag == 1: # 获取当前 IPv4 地址 ip = urlopen('https://api-ipv4.ip.sb/ip').read() ipv4 = str(ip, encoding='utf-8') print("获取到IPv4地址:%s" % ipv4) # 获取腾讯云 DNSPod 上的所有记录 existing_records = get_records(name_ipv4, "A") if not existing_records: add(name_ipv4, "A", ipv4) print("新建域名解析成功") else: if existing_records[0]["Value"].strip() != ipv4.strip(): update(existing_records[0]["RecordId"], name_ipv4, "A", ipv4) print("修改域名解析成功") else: print("IPv4 地址未更改") print("本程序版权属于naigou,博客:https://www.naigou.cn")
python脚本,获取本地IP,自动刷新域名解析啊