1. Go to this page and download the library: Download jinomial/laravel-dns library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/**
* Application service provider bootstrap for package services.
*
* \App\Dns\Sockets\DnsResolver is my custom driver class I made.
* The DnsManager needs to know how to construct it.
*/
public function boot(): void
{
$dnsLoader = $this->app->get(\Jinomial\LaravelDns\DnsManager::class);
$driverName = 'my-custom-driver';
$dnsLoader->extend($driverName, function () use ($driverName) {
return new \App\Dns\Sockets\DnsResolver($driverName);
});
}