daniesy / php-digger
Fetch DNS Resource Records associated with a hostname
Installs: 2 389
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 2
Requires
- php: >=7.1.23
Requires (Dev)
- phpunit/phpunit: 7.5.x-dev
This package is auto-updated.
Last update: 2025-03-07 10:06:34 UTC
README
A simple way to fetch DNS Resource Records associated with a hostname.
How to
Using digger is easy as 1, 2, 3.
<?php
require 'vendor/autoload.php';
use Daniesy\Digger;
$records = (new Digger)->getRecords('ping-pong.dev', 'A');
foreach($records as $record) {
var_dump($record);
}
if($records->has('127.0.0.1')) {
echo "The dns record is set";
}
Installation
You can install Digger
with composer by running the following command.
composer require daniesy/php-digger:dev-master
Parameters
- host The host you want to fetch the DNS records from
- type
The type of DNS Records you want to get. At the moment, only the following records are supported:
A
,AAAA
,CAA
,CNAME
,MX
,NS
,PTR
,SOA
,SRV
,TXT
. I'll add more at a later point. - timeout
The timeout in seconds after which the call should fail. The default timeout is
5
seconds.