He.net Dynamic DNS(動態域名)更新方法

linux腳本

#!/bin/bash

IPv4=$(wget -qO- http://v4.ipv6-test.com/api/myip.php)
IPv6=$(wget -qO- http://v6.ipv6-test.com/api/myip.php)
wget --no-check-certificate -qO- "https://dyn.dns.he.net/nic/update?hostname=要更新的域名&password=域名動態密碼&myip=$IPV4"
wget --no-check-certificate -qO- "https://dyn.dns.he.net/nic/update?hostname=要更新的域名&password=域名動態密碼&myip=$IPV6"

需使用curl進行更新

% curl -4 “http://dyn.example.com:Enable entry for dynamic [email protected]/nic/update?hostname=dyn.example.com”
% curl -6 “http://dyn.example.com:Enable entry for dynamic [email protected]/nic/update?hostname=dyn.example.com”