發表文章

目前顯示的是 5月, 2018的文章

[Weekly Report] 2018.04.05 - 04.18

[Weekly Report] 2018.04.05 - 04.18 My dormitory doesn't have static public IP address so I tend to use Dynamic DNS (DDNS) method. Even though my D-Link Access Point (AP) provides free DDNS service, but I want to use my own domain name. First I change my domain name server from freenom to Cloudflare , then install ddclient for automatically update my IP address to Cloudflare. But no matter how I changed the arguments of the configuration file for hours, it still didn't work. Then I tended to use Cloudflare API and read the official document, it succeeded in ten minutes. Here is my sample DNS-update code, you can also use requests library instead of curl : '''This program will get record from Cloudflare and compare my current IP address''' import json from os import popen, system getCMD = 'curl -X GET "https://api.cloudflare.com/client/v4/zones/{ZONE-ID}/dns_records?type=A&name={YOUR-FULL-DOMAIN-NAME}" \ -H "X-Auth-Email: {YOUR-