PHPackages                             lyhiving/dnspod\_api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lyhiving/dnspod\_api

ActiveSymfony-bundle[API Development](/categories/api)

lyhiving/dnspod\_api
====================

The DNSPod User API is restricted to individual users, making it easier and more flexible for users to manage their own domain names and records.

3.0.5(6y ago)011MPL-2.0PHPPHP &gt;=5.6

Since Jul 19Pushed 6y agoCompare

[ Source](https://github.com/lyhiving/dnspod_api)[ Packagist](https://packagist.org/packages/lyhiving/dnspod_api)[ Docs](https://github.com/lyhiving/Dnspod_API)[ RSS](/packages/lyhiving-dnspod-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)DependenciesVersions (8)Used By (0)

[![](Subsidiary/DNSPod.png)](Subsidiary/DNSPod.png)

Dnspod\_API
===========

[](#dnspod_api)

The [DNSPod User API](https://www.dnspod.com/docs/index.html) OR [DNSPod中文文档](https://www.dnspod.cn/docs/index.html) is restricted to individual users, making it easier and more flexible for users to manage their own domain names and records.

[![dnspod](Subsidiary/DNSPod_Logo.png)](https://github.com/lyhiving/dnspod_api)

`Need to cooperate with Curl extension`

### Installation

[](#installation)

Use [Composer](https://getcomposer.org) to install the library. Of course, You can go to [Packagist](https://packagist.org/packages/lyhiving/dnspod_api) to view.

```
    $ composer require lyhiving/dnspod_api

```

### Initialization parameter

[](#initialization-parameter)

- Sample：

```
    require_once dirname(__FILE__) . '/vendor/autoload.php';
    use dnspod_api\Dnspod;
    $uid = 12345;
    $token = X12345;
    $DP = new Dnspod($uid, $token);
```

### Add or modify records

[](#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

[](#copy-a-record)

- Sample：

```
    $domain = 'example.com';
    $DP->copyArecord($domain);
```

### Get domain information

[](#get-domain-information)

- Sample：

```
    $copyDomain = 'google.com';
    $toDomain = 'example.com';
    echo $DP->getDomainInfo($copyDomain, $toDomain);
```

### Get a list of records

[](#get-a-list-of-records)

- Sample：

```
    $domain = 'example.com';
    echo $DP->getRecordList($domain);
```

### Get details of batch tasks

[](#get-details-of-batch-tasks)

- Sample：

```
    $job_id = 'j12345';
    echo $DP->getBatchDetail($job_id);
```

### Add a single record

[](#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

[](#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

[](#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

[](#modify-record-1)

- Sample：

```
    $domain = 'example.com';
    $record_id = 'E12345';
    echo $DP->recordRemove($domain, $record_id);
```

### Other functions

[](#other-functions)

- Sample：

```
    //Get the API version number
    echo $DP->getVersion();

    //Get the level allowed line
    $domain = 'example.com';
    echo $DP->getRecordLine($domain);

    //Change API Region to Global Network And
    $DP->setRegion('global');

    //Change API Region to China Network
    $DP->setRegion('cn');

    //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);

    //Remove share record
    $domain = 'example.com';
    $share_email = 'share@old.com';
    echo $DP->shareRemove($domain, $share_email);
```

Original author
---------------

[](#original-author)

weibo: [yakeing](https://weibo.com/yakeing)

Modify by [lyhiving](https://twitter.com/lyhiving)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~12 days

Total

7

Last Release

2353d ago

Major Versions

v2.5.1 → 3.0.12019-10-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/db1eb069d037acc80edcd4b46bc92eab5bf48255d4cd753390668b36de70bed1?d=identicon)[lyhiving](/maintainers/lyhiving)

---

Top Contributors

[![yakeing](https://avatars.githubusercontent.com/u/6356091?v=4)](https://github.com/yakeing "yakeing (60 commits)")[![lyhiving](https://avatars.githubusercontent.com/u/70043?v=4)](https://github.com/lyhiving "lyhiving (7 commits)")

---

Tags

dnsIPdomainnsMXtxtaAAAAsrvcname

### Embed Badge

![Health badge](/badges/lyhiving-dnspod-api/health.svg)

```
[![Health](https://phpackages.com/badges/lyhiving-dnspod-api/health.svg)](https://phpackages.com/packages/lyhiving-dnspod-api)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP2 PHP API

2.5k85.4M294](/packages/geoip2-geoip2)[ltd-beget/dns-zone-configurator

Php library for parsing and editing dns zones files programmatically with high level abstraction.

22163.7k](/packages/ltd-beget-dns-zone-configurator)[ok/ipstack-client

A PHP wrapper for using Ipstack API

10384.3k](/packages/ok-ipstack-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
