Astro / Launch
Connect your domain
Point your own domain to your Netlify site, choose between external DNS and Netlify DNS, keep your email working and get HTTPS automatically.
Beginner 15 min Updated
Once your site is live on its .netlify.app address, the last step is your own domain. This article is for site owners and whoever manages the domain at the registrar. You will add the domain in Netlify, choose how DNS is managed, set the right records without breaking email, and check that HTTPS works.
Before you start
You need:
- Your site deployed on Netlify. See Deploy to Netlify.
- A login for the company where the domain is registered or where its DNS is managed.
- A screenshot or export of the current DNS records. You will need it if anything goes wrong.
Tip: A day before the switch, lower the TTL of the records you are going to change (for example to 300 seconds). Changes then spread faster on launch day.
Add the domain in Netlify
- Open your project in Netlify and go to domain management.
- Add your domain, for example
example.com. - Netlify also adds the
wwwversion. Choose which one is the primary domain. Netlify redirects the other one to it automatically. - Netlify now shows what it needs from your DNS.
Choose how to manage DNS
| Option | How it works | Choose it when |
|---|---|---|
| External DNS | Your DNS stays where it is; you add a few records that point to Netlify | Email and other services are already set up there, or someone else manages DNS |
| Netlify DNS | You move the whole DNS zone to Netlify by changing the nameservers | You want everything for the website in one place |
Option A: external DNS
At your DNS provider, create these records. Always copy the exact values Netlify shows in your domain settings; the ones below are Netlify’s documented defaults at the time of writing.
| Type | Name | Value |
|---|---|---|
| ALIAS, ANAME or flattened CNAME | @ (the bare domain) | apex-loadbalancer.netlify.com |
| A (only if ALIAS is not supported) | @ | 75.2.60.5 |
| CNAME | www | your-project.netlify.app |
- Remove any old A, AAAA or CNAME records for
@andwwwthat point to your previous host. Two records for the same name conflict. - Add the new records.
- Leave MX and TXT records alone. They run your email and domain verifications.
- Go back to Netlify and wait for the domain to show as configured.
Option B: Netlify DNS
- In Netlify, choose to set up Netlify DNS for the domain.
- Add every existing record you still need to the Netlify DNS zone: MX records for email, TXT records for SPF, DKIM, DMARC and verifications, and records for other subdomains.
- Copy the nameservers Netlify assigns to your domain.
- At your registrar, replace the current nameservers with Netlify’s.
- Wait. Nameserver changes can take up to 48 hours to reach everyone, though it is often much faster.
Warning: Changing nameservers moves all DNS records at once. Any record you did not recreate in Netlify stops working, and missing MX records mean incoming email stops. Check the list twice before you switch. See Fix common email problems if mail stops arriving.
HTTPS
Netlify requests a free certificate for your domain automatically once the DNS points to Netlify. This usually takes minutes, sometimes longer while DNS changes spread. You can follow the status in the HTTPS section of your domain settings. If it stays pending for hours, check that no old records for the domain still point elsewhere.
Check that it works
- Check the records from a terminal:
dig example.com +short
dig www.example.com +short
- Open
http://example.com,http://www.example.comandhttps://www.example.com. All of them should end on your primary domain overhttps. - Make sure the site address in
astro.config.tsis your final domain. Canonical URLs, the sitemap and structured data are built from it:
fulldevIntegration({
site: "https://example.com",
name: "Example",
// ...
})
- If you changed the site address, deploy again.
- Add the domain to Google Search Console and submit the sitemap. See Make your Astro site rank well.
If you would rather not touch DNS at all, Viralistic’s managed hosting includes domain and DNS management. Book a strategic call: https://calendly.com/marrallisa/30min
Next steps
Still stuck?
Send us what you tried and a screenshot, and we will help you further. For new projects, book a strategic call.
Strategic call