定制 xosofox/hetzner-dns-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xosofox/hetzner-dns-api

最新稳定版本:1.0.0

Composer 安装命令:

composer require xosofox/hetzner-dns-api

包简介

Unofficial PHP client for the Hetzner DNS API

README 文档

README

This library implements an unofficial but complete PHP client for the Hetzner Public DNS API.

Comment by Peter: Why this fork?

The original https://github.com/mehr-it/hetzner-dns-api repo seems to be stale. But I like the work that has been done. So I updated it to work for my personal use-cases. --- continue original README ---

Why a proprietary license?

Since Hetzner responded with no interest in supporting the development of a PHP DNS API client library, we do not want to bear the development costs for the integration of their products alone. We are willing to share this package under MIT license, if the there is some kind of participation...

Installation

You should use composer to install this library:

composer require mehr-it/hetzner-dns-api

Usage

Following example demonstrates the creation of a new DNS record. See the official API docs for a full list of operations. The corresponding methods and parameters of the client class are named similar as in the documentation.

$apiToken = '...'; // see https://dns.hetzner.com/settings/api-token to generate one

// create a client instance
$client = new HetznerDnsClient($apiToken);

// retrieve ID of the target zone
$zoneId = $client->getZoneByName('mytestzone.de')->getZones()[0]->getId();

// create new record
$response = $client->createRecord(
    (new Record())
        ->zoneId($zoneId)
        ->ttl(900)
        ->type(Record::TYPE_A)
        ->value('8.8.8.8')
        ->name('www')
);

$recordId = $response->getRecord()->getId();

Known issues

The Hetzner DNS API has some bugs. The bugs have been reported but yet not fixed for several months. The following functions are affected:

  • getAllRecords (pagination seams not to work correctly)
  • bulkUpdateRecords
  • validateZoneFilePlain (valid records are not returned)

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-01-10