PHPackages                             domainreseller/php-dna - 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. domainreseller/php-dna

ActiveLibrary

domainreseller/php-dna
======================

DomainNameAPI PHP Library for Domain Management

V2.1.22(2mo ago)111.6k↓28.6%112MITPHPPHP &gt;=7.4CI passing

Since Mar 15Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/domainreseller/php-dna)[ Packagist](https://packagist.org/packages/domainreseller/php-dna)[ RSS](/packages/domainreseller-php-dna/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (28)Used By (2)

 [ TR ![TR](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/TR.png)](README-TR.md) [ | EN ![EN](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/US.png)](README.md) [ | DE ![DE](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/DE.png)](README-DE.md) [ | SA ![AR](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/SA.png)](README-SA.md) [ | NL ![NL](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/NL.png)](README-NL.md) [ | AZ ![AZ](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/AZ.png)](README-AZ.md) [ | CN ![CN](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/CN.png)](README-CN.md) [ | FR ![FR](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/FR.png)](README-FR.md) [ | IT ![IT](https://raw.githubusercontent.com/yammadev/flag-icons/master/png/IT.png)](README-IT.md)

Installation and Integration Guide
----------------------------------

[](#installation-and-integration-guide)

### Minimum Requirements

[](#minimum-requirements)

- PHP7.4 or higher (Recommended 8.1)
- PHP SOAPClient extension must be active.

### A) Manual Usage

[](#a-manual-usage)

Download the files and examine the examples in the [examples](examples) folder.

```
require_once __DIR__.'/src/DomainNameAPI_PHPLibrary.php';

$dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password');
```

### B) Composer ile entegrasyon için

[](#b-composer-ile-entegrasyon-için)

```
composer require domainreseller/php-dna
```

```
require_once __DIR__.'/vendor/autoload.php';

$dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password');
```

### Usage

[](#usage)

#### Domain Registration Operations

[](#domain-registration-operations)

Note: Additional parameters are required for .tr domains. The Additional parameter is used for domain names that require extra information like .tr.

```
$contact = [
    "FirstName"        => 'John',
    "LastName"         => 'Doe',
    "Company"          => 'Example Corp',
    "EMail"            => 'john.doe@example.com',
    "AddressLine1"     => '123 Lorem Street',
    "AddressLine2"     => 'Suite 456',
    "AddressLine3"     => '',
    "City"             => 'Springfield',
    "Country"          => 'US',
    "Fax"              => '1234567890',
    "FaxCountryCode"   => '1',
    "Phone"            => '9876543210',
    "PhoneCountryCode" => 1,
    "Type"             => 'Contact',
    "ZipCode"          => '12345',
    "State"            => 'IL'
];

$a->RegisterWithContactInfo(
    'example.com',
    1,
    [
        'Administrative' => $contact,
        'Billing'        => $contact,
        'Technical'      => $contact,
        'Registrant'     => $contact
    ],
    ["ns1.example.com", "ns2.example.com"],
    true,
    false,
    //Addional attributes sadece .tr domainler için gereklidir.
    [
        'TRABISDOMAINCATEGORY' => 1,
        'TRABISCITIZIENID'     => '12345678901',
        'TRABISNAMESURNAME'    => 'John Doe',
        'TRABISCOUNTRYID'      => '840',
        'TRABISCITYID'        => '17'
    ]);
```

Sample Output for Domain Registration```
Array
(
    [result] => OK
    [data] => Array
    (
        [ID] => 123456
        [Status] => clientTransferProhibited
        [DomainName] => example.com
        [AuthCode] => Xy9#mK2$pL5@vN8
        [LockStatus] => true
        [PrivacyProtectionStatus] => false
        [IsChildNameServer] => false
        [Contacts] => Array
        (
            [Billing] => Array
            (
                [ID] => 987654
            )
            [Technical] => Array
            (
                [ID] => 987654
            )
            [Administrative] => Array
            (
                [ID] => 987654
            )
            [Registrant] => Array
            (
                [ID] => 987654
            )
        )
        [Dates] => Array
        (
            [Start] => 2024-03-15T10:00:00+03:00
            [Expiration] => 2025-03-15T10:00:00+03:00
            [RemainingDays] => 365
        )
        [NameServers] => Array
        (
            [0] => ns1.example.com
            [1] => ns2.example.com
        )
        [Additional] => Array
        (
            [TRABISDOMAINCATEGORY] => 1
            [TRABISCITIZIENID] => 98765432109
            [TRABISNAMESURNAME] => Jane Smith
            [TRABISCOUNTRYID] => 840
            [TRABISCITYID] => 34
        )
        [ChildNameServers] => Array
        (
                )

        )
    )
)
```

---

#### Domain Renewal

[](#domain-renewal)

```
$dna->Renew('example.com', 1);
```

Sample Output for Domain Renewal```
Array
(
    [result] => OK
    [data] => Array
    (
        [ExpirationDate] => 2025-03-15T10:00:00+03:00
    )
)
```

---

#### Domain Transfer

[](#domain-transfer)

```
$dna->Transfer('example.com', 'Xy9#mK2$', 3);
```

Sample Output for Domain Transfer```
Array
(
    [result] => OK
)
```

---

#### Domain List

[](#domain-list)

```
$dna->GetList(['OrderColumn'=>'Id', 'OrderDirection'=>'ASC', 'PageNumber'=>0,'PageSize'=>1000]);
```

Sample Output for Domain List```
Array
(
    [data] => Array
    (
        [Domains] => Array
        (
            [0] => Array
            (
                [ID] => 564346
                [Status] => Active
                [DomainName] => example.com
                [AuthCode] => DHQ!K52
                [LockStatus] => false
                [PrivacyProtectionStatus] => false
                [IsChildNameServer] => false
                [Contacts] => Array
                (
                    [Billing] => Array
                    (
                        [ID] => 11854114
                    )
                    [Technical] => Array
                    (
                        [ID] => 11854114
                    )
                    [Administrative] => Array
                    (
                        [ID] => 11854114
                    )
                    [Registrant] => Array
                    (
                        [ID] => 11854114
                    )
                )
                [Dates] => Array
                (
                    [Start] => 2024-03-15T10:00:00+03:00
                    [Expiration] => 2025-03-15T10:00:00+03:00
                    [RemainingDays] => 365
                )
                [NameServers] => Array
                (
                    [0] => ns1.example.com
                    [1] => ns2.example.com
                )
                [Additional] => Array
                (
                    [TRABISDOMAINCATEGORY] => 1
                    [TRABISCITIZIENID] => 98765432109
                    [TRABISNAMESURNAME] => Jane Smith
                    [TRABISCOUNTRYID] => 215
                    [TRABISCITYID] => 34
                )
                [ChildNameServers] => Array
                (
                    [0] => Array
                    (
                        [Name] => ns1.example.com
                        [IP] => 1.2.3.4
                    )
                    [1] => Array
                    (
                        [Name] => ns2.example.com
                        [IP] => 2.3.4.5
                    )
                )
            )
        )
    )
    [result] => OK
)
```

---

#### TLD List

[](#tld-list)

```
$dna->GetTldList(100);
```

Sample Output for TLD List```
Array
(
    [data] => Array
        (
            [0] => Array
                (
                    [id] => 1971
                    [status] => Active
                    [maxchar] => 63
                    [maxperiod] => 10
                    [minchar] => 3
                    [minperiod] => 1
                    [tld] =>  cc.bh
                    [pricing] => Array
                        (
                            [backorder] => Array
                                (
                                    [1] => 149.9900
                                )

                            [refund] => Array
                                (
                                    [1] => 149.9900
                                )

                            [restore] => Array
                                (
                                    [1] => 85.0000
                                )

                            [transfer] => Array
                                (
                                    [1] => 149.9900
                                )

                            [renew] => Array
                                (
                                    [1] => 149.9900
                                )

                            [registration] => Array
                                (
                                    [1] => 149.9900
                                )

                        )

                    [currencies] => Array
                        (
                            [backorder] => USD
                            [refund] => USD
                            [restore] => USD
                            [transfer] => USD
                            [renew] => USD
                            [registration] => USD
                        )

                )

            [1] => Array
                (
                    [id] => 1956
                    [status] => Active
                    [maxchar] => 63
                    [maxperiod] => 10
                    [minchar] => 3
                    [minperiod] => 1
                    [tld] => aaa.pro
                    [pricing] => Array
                        (
                            [backorder] => Array
                                (
                                    [1] => 156.2500
                                )

                            [refund] => Array
                                (
                                    [1] => 156.2500
                                )

                            [restore] => Array
                                (
                                    [1] => 80.0000
                                )

                            [transfer] => Array
                                (
                                    [1] => 156.2500
                                )

                            [renew] => Array
                                (
                                    [1] => 156.2500
                                )

                            [registration] => Array
                                (
                                    [1] => 156.2500
                                )

                        )

                    [currencies] => Array
                        (
                            [backorder] => USD
                            [refund] => USD
                            [restore] => USD
                            [transfer] => USD
                            [renew] => USD
                            [registration] => USD
                        )

                )

        )

    [result] => OK
)
```

---

#### Domain Availability Check

[](#domain-availability-check)

```
$dna->CheckAvailability('example.com',1,'create');
```

Sample Output for Domain Availability Check```
 *Array
(
    [0] => Array
        (
            [TLD] => com
            [DomainName] => hello
            [Status] => notavailable
            [Command] => create
            [Period] => 1
            [IsFee] =>
            [Price] => 9.9900
            [Currency] => USD
            [Reason] => Domain exists
        )

    [1] => Array
        (
            [TLD] => net
            [DomainName] => world123x0
            [Status] => available
            [Command] => create
            [Period] => 1
            [IsFee] =>
            [Price] => 12.9900
            [Currency] => USD
            [Reason] =>
        )
    [2] => Array
        (
            [TLD] => net
            [DomainName] => hello
            [Status] => notavailable
            [Command] => create
            [Period] => 1
            [IsFee] =>
            [Price] => 12.9900
            [Currency] => USD
            [Reason] => Domain exists
        )

    [3] => Array
        (
            [TLD] => com
            [DomainName] => world123x0
            [Status] => available
            [Command] => create
            [Period] => 1
            [IsFee] =>
            [Price] => 9.9900
            [Currency] => USD
            [Reason] =>
        )

)
```

---

#### Domain Details

[](#domain-details)

```
$dna->GetDetails('example.com');
```

Sample Output for Domain Details```
Array
(
    [data] => Array
        (
            [ID] => 564346
            [Status] => Active
            [DomainName] => example.com
            [AuthCode] => DHQ!K52
            [LockStatus] => false
            [PrivacyProtectionStatus] => false
            [IsChildNameServer] => false
            [Contacts] => Array
                (
                    [Billing] => Array
                        (
                            [ID] => 11854114
                        )

                    [Technical] => Array
                        (
                            [ID] => 11854114
                        )

                    [Administrative] => Array
                        (
                            [ID] => 11854114
                        )

                    [Registrant] => Array
                        (
                            [ID] => 11854114
                        )

                )

            [Dates] => Array
                (
                    [Start] => 2025-05-26T16:08:37
                    [Expiration] => 2027-05-26T16:08:37
                    [RemainingDays] => 449
                )

            [NameServers] => Array
                (
                    "ns1.example.com",
                    "ns2.example.com"
                )

            [Additional] => Array
                (
                    [TRABISDOMAINCATEGORY] => 1
                    [TRABISCITIZIENID] => 1112221111111
                    [TRABISNAMESURNAME] => "Bunyamin Mutlu"
                    [TRABISCOUNTRYID] => 215
                    [TRABISCITYID] => 41
                )

            [ChildNameServers] => Array
                (
                    Array
                        (
                            [Name] => 'ns1.example.com'
                            [IP] =>'1.2.3.4'
                            )
                    Array
                        (
                            [Name] => 'ns2.example.com'
                            [IP] =>'2.3.4.5'
                        )
                )

        )

    [result] => OK
)
```

---

#### Nameserver Modification

[](#nameserver-modification)

```
$dna->ModifyNameServer('example.com', [
    'ns1'=>'ns1.example.com',
    'ns2'=>'ns2.example.com'
]);
```

Sample Output for Nameserver Modification```
Array
(
    [data] => Array
        (
            [NameServers] => Array
                (
                    [ns1] => ns1.example.com
                    [ns2] => ns2.example.com
                )

        )

    [result] => OK
)
```

---

#### Enable Domain Lock

[](#enable-domain-lock)

```

$lock = $dna->EnableTheftProtectionLock('example.com');
```

Sample Output for Enable Domain Lock```
Array
(
    [data] => Array
        (
            [LockStatus] => true
        )

    [result] => OK
)
```

---

#### Disable Domain Lock

[](#disable-domain-lock)

```
$lock = $dna->DisableTheftProtectionLock('example.com');
```

Sample Output for Disable Domain Lock```
Array
(
    [data] => Array
        (
            [LockStatus] => false
        )

    [result] => OK
)
```

---

#### Add Child Nameserver

[](#add-child-nameserver)

```
$dna->AddChildNameServer('example.com', 'ns1.example.com', '1.2.3.4');
```

Sample Output for Add Child Nameserver```
Array
(
    [data] => Array
        (
            [NameServer] => test5.example.com
            [IPAdresses] => Array
                (
                    [0] => 1.2.3.4
                )

        )

    [result] => OK
)

```

---

#### Delete Child Nameserver

[](#delete-child-nameserver)

```
$dna->DeleteChildNameServer('example.com', 'test5.example.com');
```

Sample Output for Delete Child Nameserver```
Array
(
    [result] => OK
)
```

---

#### Update Child Nameserver

[](#update-child-nameserver)

```
 $dna->ModifyChildNameServer('example.com', 'test5.example.com', '1.2.3.4');
```

Sample Output for Update Child Nameserver```
Array
(
    [data] => Array
        (
            [NameServer] => test5.example.com
            [IPAdresses] => Array
                (
                    [0] => 1.2.3.4
                )

        )

    [result] => OK
)
```

---

#### Modify Domain Privacy

[](#modify-domain-privacy)

```
$lock = $dna->ModifyPrivacyProtectionStatus('example.com', true, 'owners optional comment');
```

Sample Output for Modify Domain Privacy```
Array
(
    [result] => OK
    [data] => => Array
        (
            [PrivacyProtectionStatus] =>trıe
   )
)
```

---

#### Save Domain Contact

[](#save-domain-contact)

```
$contact = [
    "FirstName"        => 'Bunyamin',
    "LastName"         => 'Mutlu',
    "Company"          => '',
    "EMail"            => 'bun.mutlu@gmail.com',
    "AddressLine1"     => 'adres 1 adres 1 adres 1 ',
    "AddressLine2"     => 'test test',
    "AddressLine3"     => '',
    "City"             => 'Kocaeli',
    "Country"          => 'TR',
    "Fax"              => '2626060026',
    "FaxCountryCode"   => '90',
    "Phone"            => '5555555555',
    "PhoneCountryCode" => 90,
    "Type"             => 'Contact',
    "ZipCode"          => '41829',
    "State"            => 'GEBZE'
];

$dna->SaveContacts('example.com','ns1','1.2.3.4');
```

Sample Output for Save Domain Contact```
Array
(
    [result] => OK
)
```

---

#### Get Reseller Details

[](#get-reseller-details)

```
$dna->GetResellerDetails();
```

Sample Output for Get Reseller Details```
Array
(
    [result] => OK
    [id] => 12345
    [active] => 1
    [name] => TEST ACCOUNT 1
    [balance] => 0.0000
    [currency] => USD
    [symbol] => $
    [balances] => Array
        (
            [0] => Array
                (
                    [balance] => 0.0000
                    [currency] => USD
                    [symbol] => $
                )

            [1] => Array
                (
                    [balance] => 0.0000
                    [currency] => TL
                    [symbol] => TL
                )

        )

)
```

---

Return and Error Codes with Descriptions
----------------------------------------

[](#return-and-error-codes-with-descriptions)

CodeDescriptionDetail1000Command completed successfullyOperation successful.1001Command completed successfully; action pendingOperation successful. However, the operation is currently queued for completion.2003Required parameter missingParameter missing error. For example, no phone entry in contact information.2105Object is not eligible for renewalDomain status is not suitable for renewal, locked for update operations. Status should not be "clientupdateprohibited". May be due to other status conditions.2200Authentication errorAuthorization error, security code is incorrect or domain is registered with another registrar.2302Object existsDomain name or nameserver information already exists in database. Cannot be registered.2303Object does not existDomain name or nameserver information does not exist in database. New registration required.2304Object status prohibits operationDomain status is not suitable for updates, locked for update operations. Status should not be "clientupdateprohibited". May be due to other status conditions.CODEDETAIL101System Error Detailed For ({0})!102Multiple Errors Detailed For ({0})!103Unknown Errors Detailed For ({0})!200API command not found ({0})!210API service not found ({0})!211API service provider not set!300Reseller not found!301Your current IP address is not authorized to access. Please make sure you are connecting from an authorized IP address and try again310TLD is not supported!320API not found!321Currency is not supported!330Required parameter(s) not set ({0}).–Make sure you send all contact objects full340Price definition not found ({0}\[{1}\]-{2}{3}).350Insufficent reseller balance. (Reseller Id : {0} - Current Balance : {1} {2}).350Accounting currency does not match or the balance is not sufficient.360Invalid API request for field ({0}).360API quota exceeded!361Throttled error!362Premium domain is not available to register right now.363Operation cancelled because domain in auto-renewal period364This domain is currently unavailable for transaction due to a problem with the registryCODEDETAIL400Invalid contact ({0}).401Contact info can not sync.402No access to contact information from registry.403THE SYSTEM HAS MISSING INFORMATION. ENTER YOUR DEFAULT INFORMATION OR CONTACT SUPPORT TEAM.404DOMAIN CONTACT CANNOT UPDATE. PERMISSION FROM THE REGISTRY.410Contact not found.410Contact not found ({0}).420Invalid Api command for contact {0}.430Contact api not found.440Contact is not synced.450Too many domain contacts.. !451Failed to proceed with contact update.CODEDETAIL500Invalid domain id.500Invalid domain id ({0}).501Domain could not synchronized({0})502Internal transfer failed503Domain registration is not available.504Domain information does not match .. Before :{0}505Enter the Ip Address.506Domain Transfer Has Been Started But Contact Info Not Read ..507Authorization error.510Domain not found.511Expried domains cannot be found.512Domain is not renewalable.513Domain is not in updateable status. It must be active for to be updated514Redemption Period Expected.520Invalid Api command for domain "{0}".530Invalid domain period. Period must be {0} to {1} years. Requested period is {2} years.540Domain cannot be extended beyond {0} years from current date.550Invalid domain name. Domain must be {0} to {1} characters length. Requested domain name is {2} characters.560Invalid name server count. Domain must have {0} to {1} name servers. Requested name server count is {2}.561No name server information found in the incoming request570Idn not supported for tld "{0}".571Period invalid.572Command invalid.573Domain names not found.574TLD names not found.575Domain is not in updateable status. It must be active for name servers to be updated576Domain can be renewed in the last 1 month before the expire date580Transfer not supported for tld "{0}".581Child name server not found582Transfer started by other reseller.583Transfer not initalized. Please contact the support team.584Object status prohibits operation590Auth code is required for this transfer.591Auth code is not valid.592Transfer lock exists on domain.593Domain cannot be transferred, Status Information and Transfer Lock must comply with the required criteria. (Status Information: #ok)594Domain name server adress could not resolved ({0})595Contact information can not be read (whois.registrar.tld) Please make sure that privacy protection status open596Contact information could not verified597Tld Not Found598Unknown error occurred599Domain Forward Not Found

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance85

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~41 days

Recently: every ~24 days

Total

27

Last Release

78d ago

PHP version history (2 changes)V2.0.10PHP &gt;=7.4.0

v2.0.24PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ac5c110e1c7efb16b15100915b92103c396b9dfd633a50c67a0e7bbd85bb4a3?d=identicon)[bakcay](/maintainers/bakcay)

![](https://www.gravatar.com/avatar/9a423cbba1f690ee1a9ea0b20b1dd8e949ea3151b0b7d439177a74a906049f01?d=identicon)[domainreseller](/maintainers/domainreseller)

---

Top Contributors

[![xa81](https://avatars.githubusercontent.com/u/109559440?v=4)](https://github.com/xa81 "xa81 (51 commits)")[![bakcay](https://avatars.githubusercontent.com/u/3975986?v=4)](https://github.com/bakcay "bakcay (44 commits)")[![domainreseller](https://avatars.githubusercontent.com/u/118720541?v=4)](https://github.com/domainreseller "domainreseller (37 commits)")[![omerfdmrl](https://avatars.githubusercontent.com/u/62325045?v=4)](https://github.com/omerfdmrl "omerfdmrl (1 commits)")

---

Tags

phpregistrar-module

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/domainreseller-php-dna/health.svg)

```
[![Health](https://phpackages.com/badges/domainreseller-php-dna/health.svg)](https://phpackages.com/packages/domainreseller-php-dna)
```

PHPackages © 2026

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