1. Go to this page and download the library: Download rahulmukati/hetzner-dns library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rahulmukati / hetzner-dns example snippets
// If you installed via composer, just use this code to espace
use HetznerDNS\HetznerDNS;
// Initialize
$hdns = new HetznerDNS([
'api_token' => 'YOURAPITOKENHERE'
]);
$body = '$ORIGIN example.com.
$TTL 3600
; SOA Records
@ IN SOA ns1.yourdomain.com. dns.yourdomain.com. 2020081403 86400 10800 3600000 3600
; NS Records
@ IN NS ns1.yourdomain.com.
@ IN NS ns2.yourdomain.com.
; A Records
@ IN A 192.168.1.1
; CNAME Records
www IN CNAME example.com.';
$hdns->importZoneFile('ZoneIDHere', $body);