How to Set Up DNS and HTTPS for Netlify
Point a custom domain at a Netlify site, add the correct DNS records and get HTTPS working. A clear walk-through with a worked example and fixes for common problems.
9 min readUpdated Nov 28, 2026By XPASS Editorial Team

What you are actually setting up
When people say they want to connect a domain to Netlify, they usually mean three separate things happening together. First, the domain must resolve, which means the public Domain Name System has to return an address that leads to Netlify when someone types your name. Second, Netlify must know that the name belongs to your site, so it answers requests for that hostname with your content. Third, the connection must be encrypted, so the browser shows a padlock and the visitor reaches your site over HTTPS. If any one of the three is missing, the site looks broken even though the other two are fine.
DNS is the system that turns a name into an address, described in RFC 1034. Your domain registrar holds the registration, but the DNS records can live at the registrar, at Netlify, or at a separate DNS provider. Understanding where your records live is the single most useful habit in this whole process, because most failures come from editing records in one place while the domain actually uses name servers somewhere else.
This guide covers the practical path: decide which address is your main one, add the right records, let Netlify issue the certificate, verify the result and fix the usual problems. It is written for the setup most small sites use, and it points to the official Netlify screens for exact values rather than quoting numbers that can change. If you run the same kind of site on other platforms, the sibling guides for Vercel, Cloudflare Pages and GitHub Pages follow the same overall logic with different record values.

Before you start: decide the main address
A domain gives you two natural addresses. The bare form, such as example.com, is called the apex or root domain. The prefixed form, such as www.example.com, is a subdomain. Visitors may type either, so both should work, but one of them should be your canonical address and the other should redirect to it. Search engines and browsers then see a single version of each page instead of two copies.
Neither choice is wrong. The www form is easier from a DNS point of view, because a subdomain can use a CNAME record, which simply says "this name is an alias for that name". The apex form is shorter and looks cleaner, but the DNS rules do not allow a normal CNAME at the root, so you need an A record, or a provider-specific alias record that behaves like a CNAME at the root. Netlify supports both, and its domain settings let you mark one as primary and redirect the other.
Before touching DNS, gather these items:
- The exact Netlify site address that ends in netlify.app. You will find it on the site overview page.
- Access to the place where your DNS records are edited. This might be your registrar or domain provider, or Netlify itself if you delegate the domain.
- A note of existing records, especially MX records for email and TXT records for verification. Take a screenshot or copy them somewhere safe before changing anything.
- The time of a quiet period if the site is already live, because a mistake at the apex can briefly take the site offline.
If you do not yet own the name, check what is available on the domains page first, then return here once registration is complete.
Two ways to manage the records
Netlify offers two approaches, and the best one depends on how much you want to centralise.
Option A: keep DNS where it is
You leave the name servers at your registrar or current DNS host and add the records Netlify asks for there. This is the lowest-risk path for a domain that already has email, verification records or other services, because nothing else moves. You add a CNAME for www and the apex record Netlify specifies, and everything else stays untouched.
Option B: delegate DNS to Netlify
You change the name servers at the registrar to the ones Netlify provides, then manage every record inside Netlify. This simplifies the apex domain because Netlify handles the root record for you, and it keeps the site and its DNS in one dashboard. The cost is that you must recreate every existing record, such as MX, SPF, DKIM and DMARC for email, inside Netlify before you switch. If you forget one, that service stops working the moment the name servers change.
| Question | Keep DNS at registrar | Delegate to Netlify |
|---|---|---|
| Where do you edit records? | Registrar panel | Netlify dashboard |
| Apex domain handling | A record or alias record | Handled for you |
| Risk to email and other services | Low, nothing moves | Higher, records must be copied first |
| Best for | Domains with existing services | New domains used mainly for the site |
Pick one option and stay with it. Editing the same record in two places is the classic cause of "it works for me but not for others".
Step by step: adding the domain to Netlify
Follow the same order each time. It avoids the situation where DNS points to Netlify before Netlify knows what to do with the request.
- Open your site in Netlify and go to the domain settings. Choose the option to add a custom domain.
- Type your domain. Netlify asks whether you own it and offers to add both the apex and the www version. Accept this so both are registered.
- Select which version is primary. The other will redirect to it automatically.
- Netlify shows the DNS records it expects. Leave this page open for exact values.
- Go to your DNS provider and add the records from the next section.
- Return to Netlify and use the verification or check option to confirm that DNS now points to the site.
Do not remove any old record until the new one is working. The safest sequence is add first, test, then delete anything that is no longer needed.
The records you add
For most sites, you need only two records, plus whatever email and verification records already exist.
| Name | Type | Value | Purpose |
|---|---|---|---|
| www | CNAME | your-site-name.netlify.app | Sends the www address to your Netlify site |
| @ (root) | A, or ALIAS / ANAME / flattened CNAME | The value shown in Netlify settings | Sends the bare domain to Netlify |
A few details matter here.
The name field. Some panels want only the label, such as www, while others want the full name, such as www.example.com. Read the placeholder text. If the panel automatically appends your domain and you also type it, you end up with a record for www.example.com.example.com, which does nothing.
The trailing dot. A few interfaces expect a full name to end with a dot and a few reject it. Follow what the panel shows for existing records.
The apex value. Use the exact address or alias target displayed in your Netlify domain settings at the time you set up. Do not copy an address from an old article or forum thread, because platform addresses can change and a stale value will send traffic to the wrong place.
TTL. The time to live controls how long resolvers cache an answer. A lower value, such as a few minutes, makes corrections spread faster while you are experimenting. You can raise it again once everything is stable.
Conflicting records. A name cannot have a CNAME and other records at the same time. If www already has an A record or an old CNAME, replace it rather than adding a second one. Likewise, an old A record at the root pointing to a previous host should be removed once the new one works.
Getting HTTPS to work
HTTPS wraps the connection in TLS so that it cannot be read or altered on the way, as explained in the overview of HTTPS from Cloudflare Learning. Netlify can provision a certificate for you automatically using the ACME protocol defined in RFC 8555, the same mechanism used by Let's Encrypt. The process proves that you control the name by checking that it really points to Netlify, then issues a certificate and renews it before it expires.
What this means in practice:
- The certificate cannot be issued until DNS is correct. If you open the HTTPS section too early, it may report that verification failed. This is normal. Fix DNS, wait, and try again.
- Once issued, enable the option that forces HTTPS so plain HTTP requests redirect to the secure address.
- Renewal is automatic as long as DNS keeps pointing to Netlify. If you later move the DNS records elsewhere without moving the site, the renewal can fail.
- If you need a certificate that you buy and manage yourself, for example to show organisation details, Netlify lets you upload your own. You can look at the options on the SSL page, but the automatic certificate is enough for most sites.
A common surprise is the mixed content warning. It appears when the page itself loads over HTTPS but an image, script or stylesheet is requested over plain HTTP. Search your templates for hard-coded http addresses and switch them to https or to relative paths.

Verifying the result
Do not trust a single refresh in the browser, because your computer may be caching the old answer. Check from several angles:
- Open the site in a private window using both the apex and www forms and with the http prefix as well. All four should end on one final HTTPS address.
- Click the padlock and confirm the certificate is valid for your domain name and has not expired.
- Use a command-line lookup, for example dig on macOS and Linux or nslookup on Windows, to see what the records actually return. Ask for the A record of the apex and the CNAME of www.
- Test from a phone on mobile data. A different network often reveals caching problems on your home connection.
- Look at Netlify's domain page, which should show the domain as configured with a valid certificate.
A short worked example. A designer named Mali launches a portfolio at a freshly registered name. She adds the domain in Netlify, marks the www version as primary and sees the expected records. At her registrar she adds a CNAME for www pointing to her netlify.app address and an A record for the root using the value from Netlify. Her email records already exist, so she leaves them alone. After about twenty minutes the check in Netlify turns green. She opens the HTTPS settings, requests the certificate, waits a couple of minutes and enables the forced redirect. Finally she tests all four address forms from her phone. Everything lands on the secure www address.
Limits and what to watch for
Even a clean setup has edges you should know about.
- Propagation is not instant. Resolvers around the world cache old answers until the TTL runs out, so some visitors may see the old site for a while. This is expected and not a fault in your settings.
- Name servers override everything. If the registrar points to different name servers than the ones where you edited records, your changes have no effect. Check the name server list for the domain first.
- Certificates need accurate DNS. If an old A record remains alongside the new one, verification can randomly fail depending on which answer the checker receives.
- CAA records can block issuance. If your domain has a CAA record that lists allowed certificate authorities and it does not include the one Netlify uses, the certificate request will be refused. Review or adjust CAA records if you have them.
- Proxying layers add complexity. If you place another proxy service in front of Netlify, make sure its own certificate mode and redirect rules do not loop with Netlify's forced HTTPS. Redirect loops are the usual symptom.
- Email is separate. Changing web records does not need to touch MX records. Do not delete mail records while cleaning up.
- Rules change. Platform screens, record values and certificate behaviour can change over time, so treat the live Netlify domain settings as the source of truth and use this guide for the reasoning.
When something fails, work from the bottom up: first confirm the name servers, then the records, then the Netlify domain status, then the certificate. Changing several things at once makes it impossible to tell which one fixed or broke the setup.
Summary
Connecting a domain to Netlify is three tasks: make the name resolve, tell Netlify which site owns it, and enable HTTPS. Pick one main address, add a CNAME for www and the correct apex record, keep email records intact, and let Netlify issue and renew the certificate once DNS is verified. Test from different networks, expect some delay for caching, and always take exact values from your Netlify settings rather than from memory.
If you still need a name for your site, the domains page is a good place to check what is available.
Frequently asked questions
Which DNS records do I need to connect a domain to Netlify?
Usually a CNAME record for the www name that points to your Netlify site address, plus an A record or an ALIAS, ANAME or flattened CNAME record for the bare domain. Always copy the exact values shown in your Netlify domain settings.
Why does my domain show a certificate warning right after I connect it?
The certificate is issued only after Netlify can verify that DNS points to your site. Until then the browser may show a warning. Check the records, wait for propagation and then renew or provision the certificate from the HTTPS settings.
Should I use Netlify DNS or keep my records at my registrar?
Both work. Netlify DNS puts all records in one place and simplifies the apex domain, while keeping DNS at your registrar is fine if you prefer to manage email and other records there. Choose one place and avoid editing the same records in two places.
How long do DNS changes take to work?
It depends on the TTL of the old records and on caching by resolvers. Many changes appear within minutes, but allow several hours and test from more than one network before concluding that something is wrong.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Ready to register your domain?
Search a name, compare extensions and pay once for the years you choose.
.com registration from $18.81 for the first year
Search domainsKeep reading

Domain & DNS Guides
DNS and HTTPS Setup for Vercel: What to Do
A practical guide to the DNS records and HTTPS settings a Vercel site needs, with checks for certificates, CAA records, redirects and mixed content.
10 min read

Domain & DNS Guides
DNS and HTTPS Setup for Cloudflare Pages: What to Do
A technical look at DNS records, proxying, TLS modes, DNSSEC and certificate issuance for a custom domain on Cloudflare Pages, with a troubleshooting table.
10 min read

Domain & DNS Guides
DNS and HTTPS Setup for GitHub Pages: What to Do
A focused look at the DNS records, propagation checks and HTTPS certificate steps behind a custom domain on GitHub Pages, plus fixes for the usual errors.
10 min read