Get firadiophp
git clone https://github.com/firadio/firadiophp.git
Save to/config/dnspod1.php
<? PHP return Array ( ' class ' = ' \firadiophp\api\dnspod ', ' URL ' = ' https://dnsapi.cn ', array ( ' created ' = ' 2017-06-27 01:46:01 ', ' name ' = ' firadiophp ', ' id ' = ' 123456789, ' Key ' = ' xxxxxxxxxxxxxxxxxxxxx ', );
Save to Index.php
<?PHP Usefiradiophp\f;$key= ' Xxxxxxxxxxxxxxxxxxxxxxx ';if(!isset($_get[' Key ']) ||$_get[' Key ']!==$key) { Echo"Error key\r\n"; Exit;}$info=Array();$info[' ip_addr '] =$_server[' REMOTE_ADDR '];$info[' domain '] =isset($_get[' Domain ']) ?$_get[' Domain ']: ';$info[' interface '] =isset($_get[' interface ']) ?$_get[' interface ']: ';require__dir__. '/firadiophp/f.php '; F:: Init (__dir__. Ds. ' Config ');$oDnspod 1= F::$oConfig->getinstance (' Dnspod1 ');$aSets=Array();$oSet=Array();$oSet[' type '] = ' A ';$oSet[' value '] =$info[' Ip_addr '];$oSet[' status '] = ' Enable ';$oSet[' remark '] = ' interface= '.$info[' interface '];$aSets[] =$oSet;$oDnspod 1->setrecordips (' firadio.net ', ' DX ',$aSets);$oDnspod 1->setrecordips (' firadio.net ', ' VPS ',$aSets);
Then Crontab-e joined
* * * * * * curl ' http://xxx.xxx.xxx.xxx:12345/firadio/dnspod.php?key=xxxxxxxxxxxxx&domain=vps.firadio.net& INTERFACE=ADSL1 ' >>/tmp/dnspod. Log
DDNS Dynamic Domain name analysis using the Dnspod Library of the Flying Child cloud PHP framework