git clone https://github.com/roura356a/alicloud-php-dns-updater.git dyndns-updater cd dyndns-updater vim index.php
<?php date_default_timezone_set('UTC'); include_once 'alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php'; use Roura\Alicloud\V20150109\AlicloudUpdateRecord; $AccessKeyId = '填写你的 AccessKeyId'; $AccessKeySecret = '填写你的 AccessKeySecret'; $updater = new AlicloudUpdateRecord($AccessKeyId, $AccessKeySecret); $newIp = $_SERVER['REMOTE_ADDR']; // New IP$updater->setDomainName('填写你的顶级域名(没有www)如abc.com'); $updater->setRecordType('A'); $updater->setRR('填写作为动态解析的子域名'); $updater->setValue($newIp); print_r($updater->sendRequest());
curl -u http://你服务端域名/dyndns-updater/index.php
设置cronjob每分钟请求一次