Skip to content

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_connect config block — see the config reference.
  • Container singletons for Transport, Signer, ZoneLocator, Discoverer, SyncUrlBuilder, and the Cbox\Dns\DomainConnect\DomainConnect front door, plus the Cbox\LaravelDns\Facades\DomainConnect facade. Use this facade (or resolve the front door from the container), not Dns::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, and dns:domain-connect:url; see Artisan commands.
  • fakeDomainConnect() and fakeSigner() on the InteractsWithDns trait; 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(), and outcome() work. Only applyUrl() refuses: the bound signer throws, naming DNS_DOMAIN_CONNECT_PRIVATE_KEY.
  • Provider id. applyUrl() throws unless DNS_DOMAIN_CONNECT_PROVIDER_ID is set and equals the template's providerId, 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 DomainConnect service 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 default false, provider hosts on private or reserved addresses are refused.

Next: Usage — discover, store, redirect, handle the return, re-check.