Connect a custom domain to your Netlify deployment to use your own domain name instead of the default Netlify subdomain.
Overview
The production site uses the domain services.dzaleka.com as configured in astro.config.mjs:13:
site: 'https://services.dzaleka.com'
This guide will help you set up any custom domain for your deployment.
Prerequisites
- A registered domain name (from any domain registrar)
- Access to your domain’s DNS settings
- A deployed site on Netlify
Adding a Custom Domain
Log in to your Netlify dashboard
Select your site
Go to Site settings → Domain management
Click Add custom domain
Enter your domain name (e.g., services.dzaleka.com)
Click Verify
Apex domain (root domain):
Netlify recommends using a subdomain like www or a custom subdomain for better performance and flexibility.
If you don’t own the domain on Netlify, you’ll need to verify ownership:
Netlify will provide a verification code
Add a TXT record to your DNS with the code
Wait for verification (can take up to 24 hours)
Return to Netlify to complete setup
DNS Configuration
Configure your DNS records based on your domain type.
Option 1: Netlify DNS (Recommended)
The easiest method is to use Netlify DNS:
In Domain management, click Set up Netlify DNS
Review the DNS records that will be created
Click Verify
Netlify will provide nameservers
Go to your domain registrar (GoDaddy, Namecheap, etc.)
Find DNS/Nameserver settings
Replace existing nameservers with Netlify’s nameservers:
dns1.p0X.nsone.net
dns2.p0X.nsone.net
dns3.p0X.nsone.net
dns4.p0X.nsone.net
(Replace 0X with the actual values provided)
Save changes
DNS changes can take 24-48 hours to fully propagate globally.
Option 2: External DNS
If you prefer to keep DNS with your current provider:
For Subdomain (e.g., services.dzaleka.com)
Add a CNAME record:
| Type | Name | Value |
|---|
| CNAME | services | your-site.netlify.app |
Example for Cloudflare:
Type: CNAME
Name: services
Content: dzaleka-online.netlify.app
Proxy status: DNS only (gray cloud)
TTL: Auto
For Apex Domain (e.g., dzaleka.com)
Add an A record pointing to Netlify’s load balancer:
Netlify’s IP address may change. Using Netlify DNS or a subdomain is more reliable for apex domains.
For better apex domain support, use an ALIAS or ANAME record if your DNS provider supports it:
| Type | Name | Value |
|---|
| ALIAS | @ | your-site.netlify.app |
SSL/HTTPS Setup
Netlify automatically provisions SSL certificates for custom domains.
Automatic SSL Certificate
After adding your domain:
Netlify automatically requests an SSL certificate from Let’s Encrypt
This usually takes a few minutes
You’ll see the status in Domain management → HTTPS
Visit your domain with https://
Check for the padlock icon in your browser
Certificate is valid and automatically renews
Ensure all HTTP traffic redirects to HTTPS:
Go to Domain management → HTTPS
Enable Force HTTPS redirect
All http:// requests will redirect to https://
Troubleshooting SSL
Certificate not provisioning:
- Verify DNS records are correct
- Wait 24-48 hours for DNS propagation
- Check for CAA records blocking Let’s Encrypt
Mixed content warnings:
- Ensure all resources (images, scripts) use HTTPS
- Update hardcoded
http:// URLs to https://
- Use protocol-relative URLs:
//example.com/image.jpg
Domain Redirects
Configure domain redirects for common scenarios.
www to non-www (or vice versa)
Add both domains to Netlify, and Netlify will automatically redirect the secondary domain to the primary.
Example: Redirect www.dzaleka.com to dzaleka.com:
- Add both
dzaleka.com and www.dzaleka.com
- Set
dzaleka.com as the primary domain
- Netlify automatically redirects
www to non-www
Custom redirects
Add custom redirects in netlify.toml:
# Redirect old domain to new domain
[[redirects]]
from = "https://old-domain.com/*"
to = "https://services.dzaleka.com/:splat"
status = 301
force = true
# Redirect specific path
[[redirects]]
from = "/old-path"
to = "/new-path"
status = 301
Use these tools to verify your DNS configuration:
Check DNS records
# Check A record
dig dzaleka.com A
# Check CNAME record
dig services.dzaleka.com CNAME
# Check nameservers
dig dzaleka.com NS
Email Configuration
If you use email with your domain, preserve your email records:
MX Records
Preserve existing MX records when transferring DNS:
Type: MX
Name: @
Priority: 10
Value: mail.example.com
SPF Records
Maintain SPF records for email authentication:
Type: TXT
Name: @
Value: v=spf1 include:_spf.google.com ~all
DKIM Records
Keep DKIM records if configured:
Type: TXT
Name: default._domainkey
Value: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3...
Updating Site Configuration
After setting up your domain, update your site configuration:
Change the site URL to your custom domain:
export default defineConfig({
site: 'https://your-custom-domain.com',
// ... other config
});
Update sitemap and robots.txt
Regenerate your sitemap with the new domain:
Push changes to trigger a new deployment:
git add astro.config.mjs
git commit -m "Update site URL to custom domain"
git push
Testing Your Domain
Verify everything works correctly:
Visit your domain with HTTPS:
Page loads correctly
SSL certificate is valid
No mixed content warnings
Test HTTP to HTTPS redirect:
https://your-domain.com/events
https://your-domain.com/services
https://your-domain.com/about
Verify serverless functions work:
curl -X POST https://your-domain.com/.netlify/functions/submit-voice \
-H "Content-Type: application/json" \
-d '{"title": "Test"}'
Common Issues
DNS not propagating
Symptoms: Domain not resolving or showing old site
Solutions:
- Wait 24-48 hours for full propagation
- Clear your DNS cache:
sudo dscacheutil -flushcache (macOS)
- Try accessing from a different network
- Use incognito/private browsing mode
SSL certificate not provisioning
Symptoms: “Not secure” warning or no HTTPS
Solutions:
- Verify DNS records point to Netlify
- Wait for DNS propagation
- Check for conflicting CAA records
- Contact Netlify support if issue persists
Domain showing Netlify default page
Symptoms: Generic Netlify page instead of your site
Solutions:
- Verify domain is added in Netlify dashboard
- Check that DNS records are correct
- Ensure site is deployed successfully
- Clear browser cache
Next Steps