Skip to content
← All packages

DNS for Laravel

The DNS toolkit for Laravel: authoritative lookups, domain-ownership verification, DNSSEC validation and intoDNS-style diagnostics, exposed through a facade, Artisan commands and validation rules.

DNS for Laravel is the framework integration for the DNS Toolkit engine. The protocol handling, verification, propagation, SPF and DMARC parsing, and DNSSEC chain validation all live in that core library. This package wires it into the container, config, the console and the validator, so it is one composer require away in a Laravel app. It works with zero configuration out of the box against a raw UDP and TCP socket resolver.

Wired Into Laravel

Facade

Dns::lookup(), verifyDomain(), diagnose() and dnssec()->validate() from a single facade, or inject the core Cbox\Dns\Dns and Resolver contract straight from the container.

Artisan Commands

dns:lookup, dns:verify, dns:diagnose, dns:propagation and dns:dnssec, each returning a table or grouped findings with a non-zero exit on errors for CI.

Validation Rules

DnsRecordExists and DomainVerified plug straight into the validator, so an MX record or an ownership token is checked at the request boundary.

Socket or DoH Transport

A raw UDP and TCP socket resolver for authoritative reads, or a DNS-over-HTTPS JSON transport when you only need recursive answers. Switch with one config key.

Zero Config

Auto-discovered service provider and a working resolver against 1.1.1.1 out of the box. Publish config/dns.php only when you want to tune the transport, nameserver or timeout.

Authoritative Reads

The socket transport can target a zone own authoritative nameservers, which domain-ownership verification and propagation checks require, behind an SSRF filter that only lifts for local testing.

Socket versus DoH

The socket transport can query a zone authoritative nameservers directly, which ownership verification and propagation checks need. The DoH transport only queries a provider recursive resolver, so it cannot answer authoritative or propagation queries. Pick socket when freshness matters, DoH when a plain recursive lookup is enough.