Introduction
Laravel Cloud can host the DNS for your domains. When Cloud is the authoritative DNS provider for a domain, it writes the records your environments need and issues SSL certificates on your behalf, so connecting a domain or a new subdomain no longer requires editing records at another provider. There are two ways to host a domain’s DNS on Laravel Cloud:- Buy the domain in Laravel Cloud. Domains registered through Cloud use Laravel Cloud’s DNS automatically.
- Delegate an existing domain’s nameservers. Keep the registration at your current registrar and point the domain’s nameservers at Laravel Cloud.
Delegate nameservers to Laravel Cloud
Delegating nameservers moves a domain’s DNS to Laravel Cloud while the registration stays with your current registrar.1
Add the domain
Open Network > Domains in your organization, select New domain, then select Add existing. Enter the root domain you want to add (for example,
example.com) and select Add domain. You can’t add a subdomain, such as app.example.com, on its own. Add its root domain instead, then create subdomains once Laravel Cloud has verified the domain’s nameservers. Laravel Cloud takes a moment to set up the domain’s DNS and assign its nameservers.2
Copy your existing records
Once the nameservers change, Laravel Cloud answers every DNS query for the domain, and any record that is not in Cloud stops resolving. Open the domain on the Domains page to see the Before you switch nameservers section. Cloud checks the domain’s current DNS for common records, such as the root domain’s
A, MX, and TXT records, www, _dmarc, and common DKIM records, and lists any that Cloud does not have yet. Select Add these records to Laravel Cloud to copy them.This check does not find every record in your zone. Compare the domain’s records with those at your current DNS provider, and add anything missing with Add record. To add many records at once, export a zone file from your current provider and paste it into the Zone file tab of the Add record dialog.3
Update the nameservers at your registrar
Laravel Cloud shows the nameservers assigned to the domain, such as
ns479.laravel-dns.com. Sign in to your registrar and replace the domain’s existing nameservers with the ones shown in the dashboard. Different domains may be assigned different nameservers, so always copy the nameservers shown for that domain. If your registrar only accepts two nameservers, choose any two. Do not keep your previous provider’s nameservers alongside Cloud’s.4
Wait for Laravel Cloud to verify the nameservers
While Cloud waits for the change, the domain is shown as Awaiting nameservers. Cloud checks the registry directly, so it usually verifies the change within minutes of your registrar publishing it. You can also select Check nameservers to check right away. Once verified, the domain’s nameservers are shown as Laravel Cloud with the date they were verified.
Attach a domain to an environment
Once Laravel Cloud hosts a domain’s DNS and its nameservers are verified, you can attach the domain, or any of its subdomains, to an environment. In your environment’s network settings, select New domain, then select Connect domain, and enter or pick one of your organization’s domains. You can also select Connect next to the domain on the Domains page. You will choose whether to enable wildcard support and, for root domains, howwww redirects should behave.
Laravel Cloud then writes the DNS records the environment needs and issues an SSL certificate. There are no records for you to copy, and no verification records to add. Domains hosted on Laravel Cloud’s DNS point directly at your environment and are not proxied through Cloudflare.
A domain can be attached to one environment at a time. To serve another environment from the same domain, attach a subdomain instead, such as staging.example.com. You can create a subdomain when you connect it to an environment, or from the domain’s Subdomains tab, where a subdomain can also redirect to another address instead of serving an environment.
Laravel Cloud will not attach a domain when:
- The root domain,
www, or the wildcard name already has anAorCNAMErecord that you created. Delete the record from the domain’s DNS records, then connect the domain again. - The environment is served by its own load balancer. Add the domain as a custom domain and create its records manually instead.
- The domain’s nameservers no longer point at Laravel Cloud.
www redirect settings after attaching it, detach the domain and attach it again.
Manage DNS records
Each domain hosted by Laravel Cloud has a DNS records section in its details panel. Open the domain on the Domains page to create, edit, and deleteA, AAAA, CNAME, MX, TXT, SRV, and CAA records, including records that have nothing to do with Laravel Cloud, such as those used by your email provider or for third-party domain verification. A CNAME record cannot be created at the root of the domain.
Time to live
Each record has a time to live (TTL), which controls how long resolvers cache the record before checking for a new value. If you leave the TTL empty, the record uses five minutes. Use a short TTL, such as one or five minutes, ahead of a planned change so the new value is picked up quickly. Use a longer TTL, such as one day, for records that rarely change, such asMX records.

