DNS for Laravel
Domain Connect
Domain Connect
Domain Connect is an open standard that lets a
service ask a customer's DNS provider to add a fixed set of records to their
domain, with the customer approving the change at their provider. The protocol,
templates, signing, and the public-key TXT record are implemented and documented
in the cboxdk/dns Domain Connect docs.
This section covers only how that module is wired into a Laravel application.
What this package adds
- A
dns.domain_connectconfig block — see the config reference. - Container singletons for
Transport,Signer,ZoneLocator,Discoverer,SyncUrlBuilder, and theCbox\Dns\DomainConnect\DomainConnectfront door, plus theCbox\LaravelDns\Facades\DomainConnectfacade. Use this facade (or resolve the front door from the container), notDns::domainConnect()from the library: that builds an unconfigured instance that skips the provider-id guard, the configured key host, the timeout, and the SSRF setting. - Three Artisan commands —
dns:domain-connect:discover,dns:domain-connect:keys, anddns:domain-connect:url; see Artisan commands. fakeDomainConnect()andfakeSigner()on theInteractsWithDnstrait; see Fake Domain Connect.
What stays with your application
This package ships no routes, controllers, or storage. The callback route, the
validation of the state value you get back, persisting the discovery result, and
scheduling the re-check are yours. Usage shows the shape end to end.
Behaviour to know about
- No private key configured.
discover(),check(), andoutcome()work. OnlyapplyUrl()refuses: the bound signer throws, namingDNS_DOMAIN_CONNECT_PRIVATE_KEY. - Provider id.
applyUrl()throws unlessDNS_DOMAIN_CONNECT_PROVIDER_IDis set and equals the template'sproviderId, so the app never signs a request for another provider's template. - Invalid private key. A key that is not RSA, is under 2048 bits, or cannot be
parsed makes the whole
DomainConnectservice fail to resolve, so every call throws. This is deliberate: a broken key is found at first use, not when a customer reaches the apply step. - SSRF posture. Discovery follows
dns.allow_non_public_nameservers: with the defaultfalse, provider hosts on private or reserved addresses are refused.
Next: Usage — discover, store, redirect, handle the return, re-check.