verrucktua/dns-library

A PHP library for retrieving DNS records for a specified domain name

dev-main 2023-06-15 09:31 UTC

This package is auto-updated.

Last update: 2024-05-15 11:32:33 UTC


README

This PHP library allows you to retrieve all DNS records for a specified domain name. It is designed to be used with the Laravel framework.

Requirements

  • PHP version 8.0 or later
  • Composer for dependency management

Installation

  1. Open a terminal and navigate to your Laravel project directory.

  2. Run the following command to install the library via Composer:

    composer require phoenix/dns-library
    

Usage

  1. Import the DnsLibrary class into your code:

    use DnsLibrary\DnsLibrary;
    
  2. Create an instance of the DnsLibrary class:

    $dnsLibrary = new DnsLibrary();
    
  3. Use the getDnsRecords method to retrieve all DNS records for a domain:

    $domain = 'example.com';
    $records = $dnsLibrary->getDnsRecords($domain);
    

    The $records variable will contain an array of DNS records.

  4. You can iterate over the records and perform any necessary operations:

    foreach ($records as $record) {
        // Perform operations on each DNS record
    }
    

Examples

Retrieve DNS Records

use DnsLibrary\DnsLibrary;

$dnsLibrary = new DnsLibrary(); $domain = 'example.com'; $records = $dnsLibrary->getDnsRecords($domain);

foreach ($records as $record) { echo $record['host'] . ' ' . $record['type'] . ' ' . $record['target'] . "\n"; }

This example retrieves all DNS records for the example.com domain and displays each record's host, type, and target.

Contributing

If you would like to contribute to this library, please follow these steps:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Make your modifications and commit your changes.
  4. Push your branch to your forked repository.
  5. Submit a pull request to the main repository.

License

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

Credits

This library is developed and maintained by VerrucktUA.

Feel free to provide any feedback, suggestions, or bug reports. Contributions are welcome!

By following the instructions in the README.md file, users will be able to set up and use your library effectively. Make sure to update the placeholders with the relevant information and provide accurate instructions based on your library's implementation.