@yakeing/dnspod-api

This is a test package please do not use.


Keywords
test, php, DoNotUse, a, aaaa, cname, dns, domain, ip, mx, srv, txt
License
MPL-2.0
Install
npm install @yakeing/dnspod-api@1.0.1

Documentation

Dnspod_API

The DNSPod User API OR DNSPodäø­ę–‡ę–‡ę”£ is restricted to individual users, making it easier and more flexible for users to manage their own domain names and records.

dnspod

https://www.dnspod.com China Hong Kong

https://www.dnspod.cn China Shandong Province

Need to cooperate with Curl extension

Github badge

Downloads Size tag license languages

Installation

Use Composer to install the library. Of course, You can go to Packagist to view.

 Ā  Ā $ composer require yakeing/dnspod_api

Initialization parameter

  • Sampleļ¼š
    $uid = 12345;
    $token = X12345;
    $DP = new Dnspod($uid, $token);

Add or modify records

  • Sampleļ¼š
    $domain = 'example.com';
    $value = array(
        '255.255.255.1',
        '255.255.255.2',
        '255.255.255.3',
        );
    $name = 'www';
    $type = 'A';
    $DP->Records($domain, $value, $name, $type, true);

Copy A record

  • Sampleļ¼š
    $domain = 'example.com';
    $DP->copyArecord($domain);

Get domain information

  • Sampleļ¼š
    $copyDomain = 'google.com';
    $toDomain = 'example.com';
    echo $DP->getDomainInfo($copyDomain, $toDomain);

Get a list of records

  • Sampleļ¼š
    $domain = 'example.com';
    echo $DP->getRecordList($domain);

Get details of batch tasks

  • Sampleļ¼š
    $job_id = 'j12345';
    echo $DP->getBatchDetail($job_id);

Add a single record

  • Sampleļ¼š
    $domain = 'example.com';
    $name = 'www';
    $value = '255.255.255.0';
    $type = 'A';
    echo $DP->addRecord($domain, $name, $value, $type);

Add records in bulk

  • Sampleļ¼š
    $domain_id = '12345';
    $record[0] = array('name'=>'WWW', 'type'=>'A', 'value'='255.255.255.0', 'mx'=>1);
    echo $DP->batchAddRecord($domain_id, $record);

Modify record

  • Sampleļ¼š
    $domain = 'example.com';
    $record_id = 'E12345';
    $name = 'WWW2';
    $value = '255.255.255.0';
    $type = 'A';
    $mx = 1;
    echo $DP->recordModify($domain, $record_id, $name, $value, $type, $mx);

Modify record

  • Sampleļ¼š
    $domain = 'example.com';
    $record_id = 'E12345';
    echo $DP->recordRemove($domain, $record_id);

Other functions

  • Sampleļ¼š
    //Get the API version number
    echo $DP->getVersion();
    
    //Get the level allowed line
    $domain = 'example.com';
    echo $DP->getRecordLine($domain);
    
    //Get a list of domain names
    echo $DP->getDomainList();
    
    //Construct a new record table
    $name = 'example.com';
    $type = 'A';
    $value = '255.255.255.0';
    $DP->newRecords($name, $type, $value);

Sponsor

If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.

Sponsor

Author

weibo: yakeing

twitter: yakeing