DNS Management
Learn how to manage DNS zones and records directly through the brdz CLI.
Overview
Section titled “Overview”brdz includes built-in DNS management, allowing you to:
- Create and manage DNS zones
- Add and update DNS records
- Integrate DNS with your applications
- Clone records from existing domains
When to Use brdz DNS
Section titled “When to Use brdz DNS”Use brdz DNS when you want:
- Centralized management of apps and DNS
- API-driven DNS updates
- Tight integration between apps and domains
- Simplified workflow for deployments
Quick Start
Section titled “Quick Start”1. Create a DNS Zone
Section titled “1. Create a DNS Zone”brdz dns:zones:create example.comNote the zone ID and nameserver addresses from the output.
2. Update Nameservers
Section titled “2. Update Nameservers”At your domain registrar, update nameservers to:
ns1.brdz-dns.comns2.brdz-dns.comns3.brdz-dns.comns4.brdz-dns.comNote: Exact nameserver addresses will be provided when you create the zone.
3. Verify Configuration
Section titled “3. Verify Configuration”brdz dns:zones:verify <zone>Wait for verification (may take up to 48 hours for DNS propagation).
4. Add DNS Records
Section titled “4. Add DNS Records”# A record for root domainbrdz dns:records:create example.com A 192.0.2.1 --zone <zone>
# CNAME for wwwbrdz dns:records:create www.example.com CNAME example.com --zone <zone>
# MX for emailbrdz dns:records:create example.com MX mail.example.com --zone <zone> --prio 10Common Workflows
Section titled “Common Workflows”Simple Website Setup
Section titled “Simple Website Setup”# Create zonebrdz dns:zones:create example.com
# After nameserver delegation and verification...
# Point root to your appbrdz dns:records:create example.com A 192.0.2.1 --zone <zone>
# Add www subdomainbrdz dns:records:create www.example.com CNAME example.com --zone <zone>
# Add hostname to your appbrdz hostnames:create example.combrdz hostnames:create www.example.comEmail Configuration
Section titled “Email Configuration”# MX records for emailbrdz dns:records:create example.com MX mail.example.com --zone <zone> --prio 10brdz dns:records:create example.com MX mail2.example.com --zone <zone> --prio 20
# SPF recordbrdz dns:records:create example.com TXT "v=spf1 mx ~all" --zone <zone>
# DMARC policybrdz dns:records:create _dmarc.example.com TXT "v=DMARC1; p=quarantine;" --zone <zone>
# DKIM (get from email provider)brdz dns:records:create default._domainkey.example.com TXT "v=DKIM1; k=rsa; p=..." --zone <zone>Microservices Setup
Section titled “Microservices Setup”# Create zonebrdz dns:zones:create example.com
# Main websitebrdz dns:records:create example.com A 192.0.2.1 --zone <zone>brdz dns:records:create www.example.com CNAME example.com --zone <zone>
# API endpointbrdz dns:records:create api.example.com A 192.0.2.2 --zone <zone>
# Admin panelbrdz dns:records:create admin.example.com A 192.0.2.3 --zone <zone>
# Docsbrdz dns:records:create docs.example.com A 192.0.2.4 --zone <zone>Cloning Existing DNS
Section titled “Cloning Existing DNS”Migrate an existing domain by cloning its records:
# Create new zonebrdz dns:zones:create example.com
# Clone all records from existing DNSbrdz dns:records:clone example.com
# Review imported recordsbrdz dns:records:list --zone <zone>
# Update nameservers at registrar# (to the nameservers provided when creating the zone)Zone Management
Section titled “Zone Management”Creating Zones
Section titled “Creating Zones”# Create zonebrdz dns:zones:create example.com
# Output will include:# - Zone ID (save this!)# - Nameserver addresses# - Next stepsListing Zones
Section titled “Listing Zones”brdz dns:zones:listGetting Zone Details
Section titled “Getting Zone Details”brdz dns:zones:get <zone>Verifying Zones
Section titled “Verifying Zones”# Check if nameservers are configuredbrdz dns:zones:verify <zone>
# Manually check DNSdig example.com NSDeactivating Zones
Section titled “Deactivating Zones”# Temporarily disable without deletingbrdz dns:zones:deactivate <zone>Deleting Zones
Section titled “Deleting Zones”# Permanently delete (deletes all records)brdz dns:zones:delete <zone>Record Management
Section titled “Record Management”Creating Records
Section titled “Creating Records”# A record (IPv4)brdz dns:records:create example.com A 192.0.2.1 --zone <zone>
# AAAA record (IPv6)brdz dns:records:create example.com AAAA 2001:db8::1 --zone <zone>
# CNAME recordbrdz dns:records:create www.example.com CNAME example.com --zone <zone>
# MX recordbrdz dns:records:create example.com MX mail.example.com --zone <zone> --prio 10
# TXT recordbrdz dns:records:create example.com TXT "v=spf1 mx ~all" --zone <zone>Listing Records
Section titled “Listing Records”brdz dns:records:list --zone <zone>Deleting Records
Section titled “Deleting Records”# Get record ID from listbrdz dns:records:list --zone <zone>
# Delete recordbrdz dns:records:delete <record-id>Integration with Apps
Section titled “Integration with Apps”Pattern 1: Separate DNS and Hosting
Section titled “Pattern 1: Separate DNS and Hosting”# Manage DNS in brdzbrdz dns:zones:create example.combrdz dns:records:create example.com A 192.0.2.1 --zone <zone>
# Point to external hosting# DNS managed by brdz, hosting elsewherePattern 2: Unified Management
Section titled “Pattern 2: Unified Management”# Create DNS zonebrdz dns:zones:create example.com
# Deploy appbrdz releases:create release.zip
# Add hostnamebrdz hostnames:create example.com
# Create DNS record pointing to brdzbrdz dns:records:create example.com A <brdz-ip> --zone <zone>Pattern 3: Multiple Apps
Section titled “Pattern 3: Multiple Apps”# One zone, multiple appsbrdz dns:zones:create example.com
# Frontend appbrdz ctx:use # Select frontend appbrdz hostnames:create www.example.combrdz dns:records:create www.example.com CNAME <brdz-target> --zone <zone>
# API appbrdz ctx:use # Select api appbrdz hostnames:create api.example.combrdz dns:records:create api.example.com CNAME <brdz-target> --zone <zone>Best Practices
Section titled “Best Practices”1. Document Zone IDs
Section titled “1. Document Zone IDs”Keep a record of your zone IDs:
echo "example.com zone: example.com" >> dns-zones.txt2. Start with Low TTL
Section titled “2. Start with Low TTL”Use low TTL (300 seconds) during setup:
brdz dns:records:create example.com A 192.0.2.1 --zone <zone> --ttl 300Increase TTL once stable:
# Delete old recordbrdz dns:records:delete <record-id>
# Recreate with higher TTLbrdz dns:records:create example.com A 192.0.2.1 --zone <zone> --ttl 36003. Verify Before Switching
Section titled “3. Verify Before Switching”Always verify zone and records before changing nameservers:
# Check records existbrdz dns:records:list --zone <zone>
# Test resolutiondig @ns1.brdz-dns.com example.com4. Keep Backup of Records
Section titled “4. Keep Backup of Records”Before migrating:
# Export current DNSdig example.com ANY > dns-backup.txt
# Or clone recordsbrdz dns:records:clone example.com5. Monitor After Changes
Section titled “5. Monitor After Changes”After DNS changes:
- Check from multiple locations
- Monitor application availability
- Watch for certificate issues
- Test email delivery (if applicable)
Troubleshooting
Section titled “Troubleshooting”Zone Not Verifying
Section titled “Zone Not Verifying”Symptoms: dns:zones:verify fails
Solutions:
- Check nameservers at registrar match zone nameservers
- Wait for propagation (up to 48 hours)
- Test delegation:
Terminal window dig example.com NSdig @ns1.brdz-dns.com example.com SOA
Records Not Resolving
Section titled “Records Not Resolving”Symptoms: dig example.com doesn’t return records
Solutions:
- Verify zone is active:
Terminal window brdz dns:zones:get <zone> - Check records exist:
Terminal window brdz dns:records:list --zone <zone> - Test directly against nameservers:
Terminal window dig @ns1.brdz-dns.com example.com
Email Not Working
Section titled “Email Not Working”Symptoms: Email delivery fails
Solutions:
- Verify MX records:
Terminal window dig example.com MX - Check SPF record:
Terminal window dig example.com TXT | grep spf - Test email configuration:
Terminal window # Use online tools like mxtoolbox.com
Advanced Usage
Section titled “Advanced Usage”Scripting DNS Changes
Section titled “Scripting DNS Changes”#!/bin/bashZONE="example.com"
# Add multiple recordsbrdz dns:records:create example.com A 192.0.2.1 --zone $ZONEbrdz dns:records:create www.example.com CNAME example.com --zone $ZONEbrdz dns:records:create api.example.com A 192.0.2.2 --zone $ZONEDynamic DNS Updates
Section titled “Dynamic DNS Updates”#!/bin/bash# Update A record with current IP
ZONE_ID="abc123"NEW_IP=$(curl -s ifconfig.me)
# Delete old recordOLD_RECORD_ID=$(brdz dns:records:list --zone $ZONE | grep "home.example.com" | awk '{print $1}')brdz dns:records:delete $OLD_RECORD_ID
# Create new recordbrdz dns:records:create home.example.com A $NEW_IP --zone $ZONEMigration Checklist
Section titled “Migration Checklist”When migrating DNS to brdz:
- Create zone in brdz
- Export existing DNS records
- Clone or recreate records in brdz
- Verify all records are correct
- Lower TTL on existing DNS
- Wait for old TTL to expire
- Update nameservers at registrar
- Monitor DNS propagation
- Verify zone verification
- Test all services (web, email, etc.)
- Monitor for 24-48 hours
- Increase TTL for stability