Netlify 08 ๐ Custom Domains & Netlify DNS โ Managing apex domains, subdomains, DNS records, and Let’s Encrypt SSL
Custom domains and DNS management are the final steps in making your web application publicly accessible under your own brand. While Netlify provides a default *.netlify.app subdomain for every project, production applications require a custom domain (e.g., example.com or docs.project.org) to build trust, handle SEO effectively, and ensure professional branding. Managing this infrastructure requires configuring DNS recordsโthe internetโs phonebookโto point your traffic to Netlifyโs global load balancers.
Netlify offers two primary ways to manage your domain: by using Netlify DNS (where Netlify acts as your name server provider) or by configuring external DNS records at your existing registrar (like GoDaddy, Namecheap, or Cloudflare). Both methods achieve the same end result: routing your domainโs traffic to Netlifyโs CDN. Once connected, Netlify handles the heavy lifting of automated SSL/TLS provisioning via Let’s Encrypt, ensuring that your custom domain is secured with HTTPS without you needing to manage or renew certificates manually.
This chapter details the two approaches to domain management, the critical difference between Apex domains and subdomains, and the automated lifecycle of SSL/TLS certificates on the Netlify platform. We will explore how to troubleshoot DNS propagation issues and the best practices for achieving a “set-and-forget” domain configuration.
Key point: Connecting a custom domain involves two steps: configuring the DNS records at your registrar (to point traffic to Netlify) and confirming the domain within the Netlify Dashboard (to trigger SSL provisioning and traffic acceptance).
Why X exists
The branding requirement. A project.netlify.app URL is functional but does not carry the professional weight of yourbusiness.com. Custom domains are essential for SEO, email delivery, and user trust.
The SSL/TLS automation need. Managing SSL certificates (CSRs, private keys, renewals) manually is an administrative nightmare that risks site downtime when certificates expire. Netlify exists to automate this; as soon as a domain is verified, Netlify provisions a Let’s Encrypt certificate and handles all future renewals automatically.
The DNS routing problem. DNS was built decades ago, long before global CDNs existed. Apex domains (example.com) have technical limitations (they do not support CNAME records), and subdomains (www.example.com) are easier to manage. Netlify DNS simplifies this by providing an “Anycast” network that routes your users to the nearest CDN node regardless of your DNS setup.
The “Global Load Balancer” requirement. By pointing your DNS to Netlify, you aren’t just pointing to a server; you are pointing to a globally distributed network. Netlify’s DNS infrastructure automatically performs load balancing, health checks, and DDoS mitigation.
The trade-off. The trade-off is dependency. By using Netlify DNS, you are tightly coupling your domain’s availability to Netlify’s infrastructure. If you ever need to migrate away, you must perform a “DNS cutover,” which requires planning to avoid downtime and propagation delays.
a. Netlify DNS vs. External DNS
You have two choices for managing your domain. Netlify DNS involves changing your domain’s “Name Servers” (NS records) to point to Netlify. This gives Netlify full control over your DNS, allowing you to manage records directly inside the Netlify UI. It is the easiest “set-and-forget” approach, as Netlify will automatically configure the correct A and CNAME records for your project.
External DNS involves keeping your current name server provider (e.g., Namecheap, AWS Route53) and adding specific A (for Apex) or CNAME (for subdomains) records that point to Netlify’s IP addresses or load balancer. This is preferred if you need to manage other DNS records (e.g., for email/MX records) on a specialized provider.
# DNS Routing Logic
Netlify DNS: Registrar (NS Records) -> Netlify Name Servers -> Netlify CDN
External DNS: Registrar (A/CNAME) -> Netlify Load Balancers -> Netlify CDN
b. Apex Domains and Subdomains
The “Apex” domain (root, example.com) is notoriously tricky in DNS. CNAME records (which are the easiest way to point to a CDN) are technically invalid at the root of a domain. To support Apex domains, Netlify provides specific IP addresses (the “Load Balancer IP”) that you use in A records.
# Apex Domain Setup (A Record)
Name: @
Type: A
Value: 75.2.60.5 (Netlify's Load Balancer IP)
Subdomains (e.g., www.example.com) are simpler. You can use a CNAME record that points directly to your project.netlify.app URL. Using a CNAME is generally superior to an A record because if Netlify ever changes its infrastructure IPs, your CNAME record will automatically follow the update without you needing to change any DNS settings.
c. SSL/TLS Lifecycle
Once your domain is pointed to Netlify, the platform initiates a handshake with Let’s Encrypt. Netlify checks if the DNS records are correctly configured. If they are, it automatically requests a domain-validated certificate. This certificate is installed on Netlify’s edge nodes automatically.
The beauty of this system is that it is “self-healing.” Netlifyโs internal systems continuously monitor the health of your certificate. If it nears expiration, the platform triggers a renewal request with Let’s Encrypt, downloads the new certificate, and updates it on the edge without any downtime or manual input from you.
Complete Example Session
# ============================================
# PART 1: DOMAIN VERIFICATION (EXTERNAL DNS)
# ============================================
# 1. Login to Netlify > Site Settings > Domain Management
# 2. Add custom domain: example.com
# 3. Netlify provides the A and CNAME records
# ============================================
# PART 2: CONFIGURE EXTERNAL REGISTRAR
# ============================================
# Go to Namecheap/Godaddy DNS Settings:
# Add A record: @ -> 75.2.60.5
# Add CNAME record: www -> example.netlify.app
# ============================================
# PART 3: NETLIFY DNS SETUP (ALTERNATIVE)
# ============================================
# 1. Login to Netlify > Domains > Add Domain
# 2. Netlify provides Name Servers:
# dns1.p01.nsone.net
# dns2.p01.nsone.net ...
# 3. Update Name Servers at your Registrar
# ============================================
# PART 4: VERIFY PROPAGATION
# ============================================
# Use dig to check the records
dig example.com +short
# Should return: 75.2.60.5
# ============================================
# PART 5: SSL PROVISIONING
# ============================================
# 1. Go to Domain Management in Netlify
# 2. Click "Verify DNS" (if not automatic)
# 3. Wait for "Provisioning Certificate" status
# ============================================
# PART 6: HSTS/HTTPS ENFORCEMENT
# ============================================
# Under "HTTPS" section, ensure "Enforce HTTPS" is checked.
# This prevents non-secure traffic.
# ============================================
# PART 7: TROUBLESHOOTING
# ============================================
# Check for "DNS Propagation" issues
# (Use tools like `whatsmydns.net`)
# ============================================
# PART 8: REMOVE/REPLACE DOMAIN
# ============================================
# Remove domain from Netlify UI first!
# Only then update the Registrar records.
The example demonstrates the two primary domain connection methods (External DNS vs. Netlify DNS), the verification step, and the automated SSL lifecycle.
Quick Reference
DNS Record Strategy
| Domain Type | Record | Value |
|---|---|---|
Apex (@) | A | 75.2.60.5 |
Subdomain (www) | CNAME | project.netlify.app |
SSL Lifecycle
| Step | Action | Responsibility |
|---|---|---|
| Validation | Check DNS records | Netlify |
| Request | Contact Let’s Encrypt | Netlify |
| Install | Deploy to Edge Nodes | Netlify |
| Renew | Cron-based renewal | Netlify |
Domain Management Options
| Choice | Pros | Cons |
|---|---|---|
| Netlify DNS | Automatic, Easy | Vendor lock-in |
| External DNS | Flexible, Portable | Manual updates |
Best Practices
โ Do This:
# Use CNAME for subdomains whenever possible // โ
# Use 'A' records only for the root Apex domain // โ
# Always enable "Enforce HTTPS" // โ
# Wait 24-48 hours for full DNS propagation // โ
# Verify using `dig` or `nslookup` tools // โ
โ Don’t Do This:
# Point Apex domain to a CNAME (invalid DNS) // โ
# Forget to remove old records when migrating // โ
# Panic if SSL takes an hour to provision // โ
# Use multiple conflicting A records for one host // โ
# Forget to verify in Netlify UI after DNS update // โ
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Certificate Error | DNS not propagated yet | Wait 1 hour, check UI |
| Site not loading | Cached DNS on local machine | Clear DNS cache (ipconfig /flushdns) |
| Apex pointing error | Using CNAME for root | Use A record (75.2.60.5) |
| Redirect loop | Mismatched SSL/Enforce settings | Toggle Enforce HTTPS off/on |
Real-World Examples
1. Professional Business Site
business.com using A record, www.business.com using CNAME.
2. Documentation Portal
docs.library.org using CNAME pointing to my-docs.netlify.app.
3. Personal Portfolio
jane.dev using A record, managed via External DNS.
4. Startup SaaS
Migrating from AWS Route53 to Netlify DNS for automatic SSL.
5. Open Source Project
project.io using Netlify DNS to manage all subdomains.
Visual
DNS Propagation Chain
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ REGISTRAR (Godaddy/Namecheap) โ
โ โ โ
โ โโโบ DNS RECORD (Pointing to 75.2.60.5) โ
โ โ โ
โ โผ โ
โ NETLIFY LOAD BALANCER โ
โ โ โ
โ โผ โ
โ NETLIFY CDN (Your Site) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SSL Handshake
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER โโโบ HANDSHAKE (HTTPS) โโโบ NETLIFY EDGE โ
โ โ
โ (Netlify presents valid certificate) โ
โ โ
โ (Certificate renewed automatically by โ
โ Let's Encrypt/Netlify integration) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Item | Value |
|---|---|
| Apex Record | A (75.2.60.5) |
| Subdomain Record | CNAME |
| SSL Provider | Let’s Encrypt |
| SSL Renewal | Automated |
| DNS Provider | Netlify DNS or External |
Key takeaways:
- Use the correct records. Apex domains must use A records pointing to
75.2.60.5; subdomains should always use CNAME records for portability. - SSL is automated. Once DNS is correctly configured, you should never have to manually touch a certificate file or private key.
- DNS propagation is real. It can take up to 48 hours for DNS changes to propagate globally; always check
digorwhatsmydns.netbefore troubleshooting further. - Netlify DNS is convenient. If you want the easiest possible experience, point your name servers to Netlify and let them handle the records.
- Enforce HTTPS. This is the final step in securing your domain; always ensure it is enabled in your domain management settings.
Remember: Your domain connection is the bridge between your brand and your application. Treat the setup with care, verify your records with command-line tools, and trust in the automated SSL pipeline. Once configured, it is designed to run indefinitely without intervention.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!