
How to add a custom domain to your Netlify site
Introduction
Deploying a site to Netlify gives you a free *.netlify.app domain out of the box, which is perfect for testing and previews. But for any real project, you’ll want to use your own custom domain.
Connecting a custom domain on Netlify is straightforward, but DNS is one of those topics that can feel intimidating if you haven’t touched it before. The good news is that Netlify handles most of the complexity for you, especially if you use Netlify DNS.
In this guide, you’ll learn how to add a custom domain to a Netlify site, the difference between using Netlify DNS and an external DNS provider, and how to avoid common pitfalls.
What you need before you start
Before adding a custom domain, make sure you have:
- A deployed site on Netlify
- A domain name you own (from a registrar like Namecheap, Google Domains, or similar)
- Access to your domain’s DNS settings
You do not need a paid Netlify plan to use a custom domain.
Adding a custom domain in Netlify
The first step always happens inside the Netlify dashboard.
- Open your site in the Netlify dashboard
- Go to Site settings
- Navigate to Domains
- Click Add a domain
- Enter your custom domain (for example
example.comorwww.example.com)
At this point, Netlify knows which domain you want to use, but it doesn’t control DNS yet. That comes next.
Choosing how to manage DNS
You have two main options:
- Use Netlify DNS (recommended)
- Use an external DNS provider
Both work. The difference is where DNS records are managed.
Option 1: Using Netlify DNS
This is the simplest and most reliable option.
When you choose Netlify DNS, Netlify becomes the authoritative DNS provider for your domain. You manage all DNS records directly from the Netlify dashboard.
How to switch to Netlify DNS
After adding your domain, Netlify will prompt you to use Netlify DNS.
You’ll be given a set of nameservers, usually something like:
dns1.p01.nsone.net dns2.p01.nsone.net dns3.p01.nsone.net dns4.p01.nsone.net
Go to your domain registrar and replace the existing nameservers with the ones Netlify provides.
DNS changes can take anywhere from a few minutes to several hours to fully propagate.
What Netlify DNS does for you
Once Netlify DNS is active, Netlify automatically:
- Creates the correct A and CNAME records
- Provisions an HTTPS certificate
- Renews SSL certificates automatically
- Handles apex domains and subdomains correctly
For most projects, this is the best option.
Option 2: Using an external DNS provider
If you prefer to keep DNS with your registrar or another provider, you can do that too.
In this case, Netlify will tell you which DNS records to add manually.
Typical DNS configuration
For a root domain (example.com), you’ll usually add an A record:
example.com → 75.2.60.5 example.com → 99.83.190.102
For a www subdomain, you’ll add a CNAME:
www.example.com → your-site-name.netlify.app
The exact values are shown in the Netlify dashboard and may change over time, so always follow Netlify’s instructions.
Apex domain vs www subdomain
A common question is whether to use example.com or www.example.com.
Netlify supports both, and you can even configure one to redirect to the other.
A common setup is:
- Primary domain:
example.com - Redirect
www.example.com→example.com
Or the reverse, if you prefer www.
You can configure this directly in the Domains section of your site settings.
Enabling HTTPS
One of the best things about Netlify is that HTTPS is automatic.
Once your DNS is correctly configured:
- Netlify provisions a free TLS certificate via Let’s Encrypt
- HTTPS is enabled automatically
- Certificates are renewed without any action from you
If HTTPS is stuck in a “provisioning” state, it’s usually a DNS issue. Double-check your records and wait for propagation.
Custom domains and deploy previews
Deploy previews also get their own URLs automatically, but you can’t assign custom domains to individual previews.
However, Netlify does support branch subdomains, like:
feature-x.example.com
This can be useful for staging or long-lived branches.
Common problems and fixes
A few issues come up frequently when adding custom domains.
DNS changes not taking effect
DNS propagation can take time. If things don’t work immediately, wait at least 30–60 minutes before troubleshooting.
HTTPS not provisioning
This almost always means DNS is misconfigured. Make sure:
- There are no conflicting A or CNAME records
- The domain points only to Netlify
- You’re not proxying traffic through another service
Site loads but redirects incorrectly
Check your primary domain settings in Netlify. If both example.com and www.example.com are set as primary, redirects can loop.
When to use multiple domains
Netlify allows you to add multiple domains to the same site.
This is useful for:
- Regional domains (
example.co.uk,example.de) - Marketing domains that redirect to a main site
- Legacy domains during migrations
You can control redirects between them using Netlify’s domain settings or redirect rules.
Conclusion
Adding a custom domain to Netlify is a one-time setup that pays off immediately. With automatic HTTPS, simple DNS management, and built-in redirects, Netlify removes most of the usual pain associated with domains.
If you want the least friction, use Netlify DNS. If you have existing DNS requirements, external providers work just as well with a bit more setup.
Manage Netlify on the go
Download Netli.fyi and monitor your sites, check deploys, and manage your projects from anywhere.


