dnic / qdns
A Libary for working with PowerdnsAPI
1.0.2
2024-04-07 20:07 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.8
README
This is a very simple SDK, please keep in mind that this SDK has only the most necessary functions to work successfully with the api of Powerdns. It works with all types supported by Powerdns. If you have any questions, feel free to contact me
Install in your Project:
composer require dnic/qdns
Use the Libary:
List all Zones
<?php
require_once 'vendor/autoload.php';
use Qdns\ApiClient;
$client = new ApiClient('your_powerdns_apikey','your_powerdnsurl_with_port');
echo $client->zone()->listZones();
List a single Zone
<?php
require_once 'vendor/autoload.php';
use Qdns\ApiClient;
$client = new ApiClient('your_powerdns_apikey','your_powerdnsurl_with_port');
echo $client->zone()->listZone('example.com');
Add Record to Zone
<?php
require_once 'vendor/autoload.php';
use Qdns\ApiClient;
$client = new ApiClient('your_powerdns_apikey','your_powerdnsurl_with_port');
echo $client->record()->addRecord('example.com', 'test.example.com', 'A', 60,'192.168.178.9');
Delete Record from Zone
<?php
require_once 'vendor/autoload.php';
use Qdns\ApiClient;
$client = new ApiClient('your_powerdns_apikey','your_powerdnsurl_with_port');
echo $client->record()->deleteRecord('example.com', 'test.example.com', 'A');