alyakin / dns-checker
Laravel-friendly DNS lookup wrapper built on NetDNS2 v2
v2.1.2
2026-03-15 23:12 UTC
Requires
- php: >=8.1
- mikepultz/netdns2: ^2.0
Requires (Dev)
- illuminate/support: ^9.0 || ^10.0 || ^11.0
- laravel/pint: ^1.20
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10.5.62
README
A Laravel-friendly DNS lookup wrapper built on NetDNS2 v2 for custom resolvers, system fallback, typed exceptions, caching, and Laravel integration.
Quick Start
composer require alyakin/dns-checker
Laravel
php artisan vendor:publish --tag=dns-checker-config
use Alyakin\DnsChecker\Facades\DnsChecker; $records = DnsChecker::getRecords('example.com', 'A');
Plain PHP
use Alyakin\DnsChecker\DnsLookupService; $dns = new DnsLookupService([ 'servers' => ['8.8.8.8', '1.1.1.1'], 'timeout' => 2, 'fallback_to_system' => true, ]); $records = $dns->getRecords('example.com', 'MX');
Compatibility
| Component | Supported / used |
|---|---|
| Package runtime | PHP 8.1–8.3 |
| CI matrix | PHP 8.1, 8.3 |
| DNS library | mikepultz/netdns2:^2.0 |
| Laravel support | illuminate/support:^9.0 || ^10.0 || ^11.0 |
Features
- custom DNS servers with optional fallback to the system resolver
- optional typed exceptions for DNS failures
- optional NXDOMAIN logging control
- optional Laravel Cache-backed caching
- facade, fluent API, DI contract and artisan command support
Documentation
Development
See docs/development.md.
Changelog
See CHANGELOG.md for release history and migration notes.
License
MIT