supersem/fetch-dns-service

The library which get all DNS records for specified domain name.

1.0.0 2023-07-16 23:05 UTC

This package is auto-updated.

Last update: 2024-12-17 02:40:32 UTC


README

This is a PHP library for the Laravel framework that allows us to get all DNS records for the specified domain name.

Requirements

  • PHP v.8.2 or later
  • Composer

Installation

Navigate to your project directory and install the library via composer:

   cd your-project
   composer require supersem/fetch-dns-service

Usage/Examples

use Supersem\FetchDnsService\FetchDnsService;

$fetchDnsService = new FetchDnsService();
$result = $fetchDnsService->getDnsRecords("gmail.com");

print_r($result);

[
    ["type" => "A", "host" => "gmail.com", "ttl" => "3360", "ip" => "142.250.1.19"],
    ["type" => "TXT", "host" => "gmail.com", "ttl" => "18640", "txt" => "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8="],
    ...
];

Running Tests

To run tests, run the following command

./vendor/bin/phpunit vendor/supersem/fetch-dns-service/tests

License

This library is open-source and available under the MIT license.