Custom Domains
Learn how to set up custom domains for your brdz applications.
Overview
Section titled “Overview”Custom domains allow you to serve your application from your own domain name instead of the default platform URL.
Prerequisites
Section titled “Prerequisites”- A deployed application
- A domain name you own
- Access to your domain’s DNS settings
Step 1: Add Hostname to Your App
Section titled “Step 1: Add Hostname to Your App”First, ensure you have the correct app context:
# Verify contextbrdz ctx:get
# Change context if neededbrdz ctx:useAdd your custom hostname:
brdz hostnames:create example.comYou can add multiple hostnames:
brdz hostnames:create example.combrdz hostnames:create www.example.comStep 2: Configure DNS
Section titled “Step 2: Configure DNS”You need to point your domain to the brdz platform. The exact target will be provided when you add the hostname.
For Subdomains (Recommended)
Section titled “For Subdomains (Recommended)”Use a CNAME record for subdomains like www.example.com:
Type: CNAMEName: wwwValue: your-app.brdz-platform.comTTL: 300 (or automatic)For Root Domains
Section titled “For Root Domains”Use an A record for root domains like example.com:
Type: AName: @Value: 192.0.2.1TTL: 300 (or automatic)Using brdz DNS Management
Section titled “Using brdz DNS Management”If you’ve delegated your domain to brdz DNS, create records directly:
# Get your zone IDbrdz dns:zones:list
# Add CNAME for wwwbrdz dns:records:create www.example.com CNAME your-app.brdz-platform.com --zone <zone>
# Add A record for rootbrdz dns:records:create example.com A 192.0.2.1 --zone <zone>Step 3: Wait for DNS Propagation
Section titled “Step 3: Wait for DNS Propagation”DNS changes can take time to propagate:
- Typically: 5-30 minutes
- Maximum: Up to 48 hours
Check propagation:
# Check DNS resolutiondig example.comdig www.example.com
# Or use online tools# whatsmydns.net# dnschecker.orgStep 4: SSL Certificate Provisioning
Section titled “Step 4: SSL Certificate Provisioning”SSL certificates are automatically provisioned:
- Issued via Let’s Encrypt
- Usually completes within 10 minutes
- Automatic renewal before expiration
Check if your site is accessible via HTTPS:
curl -I https://example.comCommon Configurations
Section titled “Common Configurations”Root and WWW
Section titled “Root and WWW”Most sites should configure both:
brdz hostnames:create example.combrdz hostnames:create www.example.comDNS configuration:
example.com. A 192.0.2.1www.example.com. CNAME example.comSubdomain for API
Section titled “Subdomain for API”# Main appbrdz ctx:use # Select web-appbrdz hostnames:create www.example.com
# API appbrdz ctx:use # Select api-appbrdz hostnames:create api.example.comMultiple Environments
Section titled “Multiple Environments”# Productionbrdz ctx:use # Select production/web-appbrdz hostnames:create example.com
# Stagingbrdz ctx:use # Select staging/web-appbrdz hostnames:create staging.example.com
# Developmentbrdz ctx:use # Select development/web-appbrdz hostnames:create dev.example.comVerification
Section titled “Verification”Check DNS
Section titled “Check DNS”# Verify DNS points to correct targetdig example.comdig www.example.com
# Check specific nameserverdig @8.8.8.8 example.comCheck SSL
Section titled “Check SSL”# Test HTTPS connectioncurl -I https://example.com
# Check certificate detailsopenssl s_client -connect example.com:443 -servername example.comTest in Browser
Section titled “Test in Browser”- Open your domain in a browser
- Verify HTTPS is working (lock icon)
- Check certificate is valid
- Confirm your application loads
Troubleshooting
Section titled “Troubleshooting”DNS Not Resolving
Section titled “DNS Not Resolving”Problem: dig example.com doesn’t return expected IP
Solutions:
- Verify DNS records are correct at your registrar
- Wait for propagation (up to 48 hours)
- Clear local DNS cache:
Terminal window # macOSsudo dscacheutil -flushcache# Linuxsudo systemd-resolve --flush-caches# Windowsipconfig /flushdns
SSL Certificate Issues
Section titled “SSL Certificate Issues”Problem: Certificate not issued or invalid
Solutions:
- Verify DNS is pointing correctly
- Wait up to 10 minutes for issuance
- Check no CAA records block Let’s Encrypt
- Ensure port 80 and 443 are accessible
”Hostname Already Exists”
Section titled “”Hostname Already Exists””Problem: Cannot add hostname
Solutions:
- Check if hostname is added to another app
- Remove from other app first:
Terminal window brdz hostnames:listbrdz hostnames:delete <hostname-id> - Verify you own the domain
WWW Redirect Not Working
Section titled “WWW Redirect Not Working”Problem: www and non-www don’t redirect properly
Solutions:
- Add both hostnames:
Terminal window brdz hostnames:create example.combrdz hostnames:create www.example.com - Both will serve the same application
- Implement redirects in your application if needed
Best Practices
Section titled “Best Practices”1. Add Both Root and WWW
Section titled “1. Add Both Root and WWW”brdz hostnames:create example.combrdz hostnames:create www.example.com2. Use Low TTL During Setup
Section titled “2. Use Low TTL During Setup”Set DNS TTL to 300 seconds (5 minutes) while configuring, increase to 3600 (1 hour) once stable.
3. Test Before Migrating
Section titled “3. Test Before Migrating”Test with a subdomain first:
brdz hostnames:create test.example.com4. Document Your Configuration
Section titled “4. Document Your Configuration”Keep notes about:
- Which hostnames point to which apps
- DNS provider and login details
- When changes were made
5. Monitor After Changes
Section titled “5. Monitor After Changes”After adding hostnames:
- Check application logs
- Monitor traffic and errors
- Test from multiple locations
Advanced: Domain Migration
Section titled “Advanced: Domain Migration”Migrating an existing domain to brdz:
1. Prepare
Section titled “1. Prepare”# Deploy your appbrdz releases:create release.zip
# Add hostname but DON'T change DNS yetbrdz hostnames:create example.com2. Test with Hosts File
Section titled “2. Test with Hosts File”Test without changing DNS:
# Add to /etc/hosts (macOS/Linux)192.0.2.1 example.com
# Test in browsercurl https://example.comRemove the hosts entry when done testing.
3. Lower TTL
Section titled “3. Lower TTL”At your current DNS provider, lower TTL to 300 seconds and wait for old TTL to expire.
4. Switch DNS
Section titled “4. Switch DNS”Update DNS records to point to brdz platform.
5. Monitor
Section titled “5. Monitor”Watch for:
- DNS propagation
- SSL certificate issuance
- Application availability
- Error logs
6. Verify
Section titled “6. Verify”# Check from multiple locations# Use online DNS checkers# Test with different devices