All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| getDNSSnapshotListV1() | GET /api/dns/v1/snapshots/{domain} | Get DNS snapshot list |
| getDNSSnapshotV1() | GET /api/dns/v1/snapshots/{domain}/{snapshotId} | Get DNS snapshot |
| restoreDNSSnapshotV1() | POST /api/dns/v1/snapshots/{domain}/{snapshotId}/restore | Restore DNS snapshot |
getDNSSnapshotListV1($domain): \Hostinger\Model\DNSV1SnapshotSnapshotResource[]Get DNS snapshot list
Retrieve DNS snapshots for a domain. Use this endpoint to view available DNS backup points for restoration.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
$domain = mydomain.tld; // string | Domain name
try {
$result = $apiInstance->getDNSSnapshotListV1($domain);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DNSSnapshotApi->getDNSSnapshotListV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domain | string | Domain name |
\Hostinger\Model\DNSV1SnapshotSnapshotResource[]
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getDNSSnapshotV1($domain, $snapshotId): \Hostinger\Model\DNSV1SnapshotSnapshotWithContentResourceGet DNS snapshot
Retrieve particular DNS snapshot with contents of DNS zone records. Use this endpoint to view historical DNS configurations for domains.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
$domain = mydomain.tld; // string | Domain name
$snapshotId = 53513053; // int | Snapshot ID
try {
$result = $apiInstance->getDNSSnapshotV1($domain, $snapshotId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DNSSnapshotApi->getDNSSnapshotV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domain | string | Domain name | |
| snapshotId | int | Snapshot ID |
\Hostinger\Model\DNSV1SnapshotSnapshotWithContentResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
restoreDNSSnapshotV1($domain, $snapshotId): \Hostinger\Model\CommonSuccessEmptyResourceRestore DNS snapshot
Restore DNS zone to the selected snapshot. Use this endpoint to revert domain DNS to a previous configuration.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
$domain = mydomain.tld; // string | Domain name
$snapshotId = 53513053; // int | Snapshot ID
try {
$result = $apiInstance->restoreDNSSnapshotV1($domain, $snapshotId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DNSSnapshotApi->restoreDNSSnapshotV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| domain | string | Domain name | |
| snapshotId | int | Snapshot ID |
\Hostinger\Model\CommonSuccessEmptyResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]