carlosafonso/php-dns-client
Composer 安装命令:
composer require carlosafonso/php-dns-client
包简介
A DNS client written purely in PHP
关键字:
README 文档
README
A DNS client library purely implemented in PHP, compatible with PHP 7.2+.
This is a work in progress. These are the Resource Record types currently understood by the library:
- A
- AAAA
- CNAME
- NS
- SRV
- MX
- SOA
- PTR
Processing responses with other types of Resource Records currently will result in an exception.
Install
Via Composer:
$ composer require carlosafonso/php-dns-client
Usage
The Client class it the main entry point to consume the library. Client instances allow to send Request objects to a name server for resolution using the query() method:
require __DIR__ . '/vendor/autoload.php'; $client = new Afonso\Dns\Client(); // Let's make an A request for example.com $request = new Afonso\Dns\Request('google.com', Afonso\Dns\ResourceRecord::TYPE_A); // Let's send it to name server 8.8.8.8 $response = $client->query($request, '8.8.8.8'); $response->getResourceRecords()[0]; // Instance of AResourceRecord $response->getResourceRecords()[0]->__toString(); // "216.58.211.238"
Security
If you discover any security related issues, please email the author directly instead of using the issue tracker.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-15