alyakin / dns-checker
Laravel-friendly DNS lookup wrapper built on NetDNS2 v2
v3.0.1
2026-10-23 20:14 UTC
Requires
- php: >=8.2
- mikepultz/netdns2: ^2.0
Requires (Dev)
- illuminate/support: ^9.0 || ^10.0 || ^11.0
- laravel/pint: 1.30.4
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10.5.62
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.2+ (tested on 8.2 and 8.3) |
| CI matrix | PHP 8.2, 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
- optional native DNS responses preserving record metadata and every response section
Documentation
- Usage
- Raw DNS responses
- Configuration
- Error Handling
- Caching
- Laravel Integration
- Architecture
- Development
Development
See docs/development.md.
Changelog
See CHANGELOG.md for release history and migration notes.
License
MIT