gurkanbicer/getdns
最新稳定版本:v1.1.0
Composer 安装命令:
composer create-project gurkanbicer/getdns
包简介
GetDNS is a parser for dig command results.
关键字:
README 文档
README
GetDNS
GetDNS is a parser for the dig command results. This package includes features for querying DNS records by using random public dns servers and for querying domain nameservers.
Example usage:
use Gurkanbicer\Getdns\Getdns;
use Gurkanbicer\Getdns\Exceptions\EmptyResponseException;
use Gurkanbicer\Getdns\Exceptions\InvalidDomainException;
use Symfony\Component\Process\Exception\ProcessTimedOutException;
use Symfony\Component\Process\Exception\ProcessFailedException;
$getdns = new Getdns();
try {
$getdns->setDomain("grkn.co");
$aRecords = $getdns->queryDns("A");
var_dump($aRecords);
$domainNameservers = $getdns->queryDomainNameservers();
var_dump($domainNameservers);
} catch (ProcessFailedException) {
echo "The process has been failed.";
} catch (ProcessTimedOutException) {
echo "The process has been timed out.";
}
Example output:
array(5) {
["status"]=>
string(7) "NOERROR"
["data"]=>
array(2) {
[0]=>
string(12) "188.114.97.3"
[1]=>
string(12) "188.114.96.3"
}
["query"]=>
string(1) "A"
["nameserver"]=>
string(7) "9.9.9.9"
["command"]=>
string(65) "dig +nocmd +noall +multiline +answer +comments grkn.co A @9.9.9.9"
}
Installation
You can install it via Composer: composer require gurkanbicer/getdns
Requirements
- PHP >= 8.0.2
- The dig command should be run on your server, otherwise you should install the package (for installation: https://command-not-found.com/dig)
- Your php environment shouldn't be disable proc_open function and other functions that starts with proc_*
Supported DNS Types
- NS
- SOA
- A
- AAAA
- CNAME
- MX
- TXT
- SRV
- Actual domain nameservers (that the onwer pointed)
Donations
If you wanna support me you can
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-09-09