Skip to content

luo3555/dnspod-ddr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##DNSPod 动态域名解析 DNSPod DNSPod API

  1. 获取DNSPod TOKEN
$dnspod = new DNSpod();

// Set request header
$headers = [
    'UserAgent' => 'DDR/1.0([email protected])'
];
$dnspod->setHeaders($headers);

// Example 1
// Get Access Token
$data = [
    'login_email' => ACCOUNT,
    'login_password' => PASSWOR
];
$dnspod->setData($data);
$dnspod->getAccessToken();
print_r($dnspod->getResponse());
  1. 动态修改IP
$ip = new Ip();

$data = [
    'user_token' => TOKEN,      // Example 1 can get this value
    'domain_id'  => 2411248,    // Your domain id, Example 2 can get this value
    'record_id'  => 15166745,   // subdomain id, Example 4 can get this value
    'sub_domain' => 'mysubdomain-update', // Your subdomain
    'value'      => $ip->getAddress() // Your Current IP address
];
$dnspod->setData($data);
$dnspod->updateDynamicDnsRecord();
  1. Cronjob 动态设置IP
*/5 * * * * php yourScript.php

About

DNSPod Dynamic DNS resolution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages