Skip to content

kasperhartwich/quickdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickDNS

Latest Version on Packagist

For how to use, take a look at the tests for now. This is work-in-progress.

Requirements

  • PHP 8.2 or later

Installation

You can install the package via composer:

composer require kasperhartwich/quickdns

Example

This example creates multiple domains with the same template.

<?php
include "vendor/autoload.php";

$quickDns = new \QuickDns\QuickDns('[email protected]','password');

$domains = <<<EOD
domain1.dk
domain2.dk
domain3.dk
EOD;

$template = $quickDns->getTemplate('my-template');

$domains = explode(PHP_EOL, $domains);
foreach ($domains as $domain) {
    $zone = new \QuickDns\Zone($quickDns, $domain);
    $zone->create();
    echo $zone->domain . ' created' . PHP_EOL;

    $zone = $quickDns->getZone($domain);
    $template->addZone($zone);
    echo $zone->domain . ' added to template ' . $template->name . PHP_EOL;
}
echo 'Done' . PHP_EOL;

Testing

To test, you need to specify email and password for a account at QuickDNS as environment variables. You can do so by setting the variables in phpunit.xml file.

License

Licensed under MIT License.

Contribute

You are more than welcome to contribute. Just create a pull request.