How to Set Up a Custom Domain: Complete DNS Guide for Beginners
Why Get a Custom Domain?
A custom domain (like yourbusiness.com) is essential for any professional website.
Benefits:
- Professional appearance
- Brand recognition
- SEO advantages
- Email with your domain
- Full control over your online presence
Step 1: Choose Your Domain Name
Tips for a Good Domain
- Keep it short - Easy to type and remember
- Use keywords - Help with SEO
- Avoid hyphens - They look spammy
- Choose the right extension - .com is most trusted
- Check availability - Social media handles too
Common Extensions
| Extension | Best For | Price Range |
|---|---|---|
| .com | General business | $10-15/year |
| .io | Tech startups | $30-50/year |
| .dev | Developers | $12-15/year |
| .co | Companies | $25-35/year |
| .org | Non-profits | $10-12/year |
Step 2: Buy Your Domain
Popular Domain Registrars
| Registrar | Pros | Cons |
|---|---|---|
| Namecheap | Cheap, free privacy | UI can be complex |
| Google Domains | Simple, reliable | Slightly more expensive |
| Cloudflare | At-cost pricing | Fewer TLD options |
| GoDaddy | Large selection | Upsells aggressively |
| Porkbun | Affordable, clean UI | Newer company |
What to Look For
- WHOIS privacy - Hide your personal info (should be free)
- No hidden fees - Check renewal prices
- Easy DNS management - You'll need this
- Transfer unlocking - Ability to move registrars later
Step 3: Understand DNS Basics
DNS (Domain Name System) translates your domain name to an IP address.
Key DNS Record Types
| Type | Purpose | Example |
|---|---|---|
| A | Points domain to IPv4 address | A @ 185.199.108.153 |
| AAAA | Points domain to IPv6 address | AAAA @ 2606:50c0:8000::153 |
| CNAME | Points subdomain to another domain | CNAME www yourdomain.netlify.app |
| TXT | Text records for verification | TXT @ "v=spf1 ..." |
| MX | Email server routing | MX @ mail.example.com |
Understanding DNS Terminology
- @ (Root/Apex) - Your main domain (example.com)
- Subdomain - Any prefix (www.example.com, blog.example.com)
- TTL - How long records are cached (300-3600 seconds typical)
- Nameservers - Servers that hold your DNS records
Step 4: Connect Domain to Your Host
Connecting to Vercel
- Go to Vercel project → Settings → Domains
- Add your domain
- Add these DNS records:
Type: A
Name: @
Value: 76.76.21.21
Type: CNAME
Name: www
Value: cname.vercel-dns.com
Connecting to Netlify
- Go to Netlify → Domain settings → Add custom domain
- Choose between Netlify DNS or external DNS
- If external, add:
Type: A
Name: @
Value: 75.2.60.5
Type: CNAME
Name: www
Value: your-site.netlify.app
Connecting to GitHub Pages
- Create a
CNAMEfile in your repository with your domain - Add DNS records:
Type: A
Name: @
Values:
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
Type: CNAME
Name: www
Value: username.github.io
Step 5: Configure SSL/HTTPS
Most modern hosts provide free SSL automatically:
- Vercel - Automatic SSL
- Netlify - Automatic SSL
- GitHub Pages - Check "Enforce HTTPS"
- Cloudflare - Free SSL with their proxy
Wait for Propagation
SSL certificates need DNS to propagate first. This can take:
- 5 minutes - If using host's nameservers
- 24-48 hours - If DNS is still propagating
Setting Up WWW vs Non-WWW
Choose one as your primary and redirect the other.
Option 1: Non-WWW Primary (Recommended)
# Primary: example.com
# Redirect: www.example.com → example.com
Option 2: WWW Primary
# Primary: www.example.com
# Redirect: example.com → www.example.com
Most hosts handle this automatically when you add both domains.
Email Setup with Custom Domain
Option 1: Google Workspace
- Sign up at workspace.google.com
- Verify domain ownership
- Add MX records:
MX @ aspmx.l.google.com (priority 1)
MX @ alt1.aspmx.l.google.com (priority 5)
MX @ alt2.aspmx.l.google.com (priority 5)
Option 2: Zoho Mail (Free tier)
- Sign up at zoho.com/mail
- Verify domain
- Add provided MX records
Option 3: Email Forwarding
Many registrars offer free email forwarding:
- Forward [email protected] to your Gmail
- Send replies via Gmail's "Send as" feature
Troubleshooting
Domain Not Working
Wait first - DNS can take up to 48 hours to propagate
Check propagation:
- whatsmydns.net
- dnschecker.org
Verify records:
# Check A record
dig yourdomain.com A
# Check CNAME
dig www.yourdomain.com CNAME
SSL Certificate Error
Common causes:
1. DNS not fully propagated
2. Wrong DNS records
3. Certificate still generating
Solution: Wait 10-30 minutes, then check again
"Site Can't Be Reached"
Check:
1. DNS records are correct
2. Host deployment is active
3. No typos in domain configuration
Best Practices
- Enable WHOIS privacy - Protect your personal info
- Set auto-renew - Don't lose your domain
- Use low TTL during changes - Faster propagation
- Keep registrar login secure - Enable 2FA
- Document your setup - Record what records you added
Domain Costs to Expect
| Item | Cost |
|---|---|
| Domain registration | $10-50/year |
| WHOIS privacy | Free (usually) |
| SSL certificate | Free (from host) |
| Email (optional) | $0-6/user/month |
Total annual cost: $10-50 for most setups
Conclusion
Setting up a custom domain isn't complicated once you understand the basics:
- Buy your domain from a registrar
- Configure DNS records at your registrar
- Connect domain to your host
- Enable SSL
- Set up redirects
Your professional domain will be live in no time!
Need Help with Domain Setup?
We can configure your domain correctly the first time.