tencent cloud

DNSPod API Call Instance
Last updated:2026-03-24 14:32:16
DNSPod API Call Instance
Last updated: 2026-03-24 14:32:16

DNSPod API Call Instances

For a program used to request an API, the User-Agent must be in the format of the program name/version (email address). Common browsers are not allowed to be forged; otherwise, the firewall of DNSPod may reject the requests.
For more samples, please see: API library for Python.
DNSPod DDNS client source code for C# (not the latest version and for reference only)

Sample Code for PHP + CURL (Not the Latest Version and for Reference Only)

Request submitting function:
function postData($url, $data) {

$data = http_build_query($data);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

// curl_setopt($ch, CURLOPT_HEADER, 1);

// curl_setopt($ch, CURLOPT_VERBOSE, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_USERAGENT, 'program name/version (email address)');

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

$response = curl_exec($ch);

curl_close($ch);

return $response;

}
Add a new domain:
$data = array('login_email' => 'foo@bar.com',

'login_password' => 'password',

'format' => 'xml',

'domain' => 'test.com');

echo postData("https://api.dnspod.com/Domain.Create", $data);
Get the list of records for a single domain:
$data = array('login_email' => 'foo@bar.com',

'login_password' => 'password',

'format' => 'xml',

'domain_id' => '123456');

echo postData("https://api.dnspod.com/Record.List", $data);
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback