DNS Configuration Guide: CNAME, A Records & Setup | Nife Docs
Configure DNS records to point your domain to Nife applications.
DNS Basics​
What is DNS?​
DNS (Domain Name System) translates domain names to server addresses:
myapp.com
↓
(DNS lookup)
↓
app.elb.nifetency.com
↓
(IP address)
↓
Your application
How It Works​
- You type domain in browser
- Browser queries DNS for address
- DNS resolves domain to target
- Browser connects to application
- Content loads from application
DNS Record Types​
CNAME Record (Recommended)​
Points one domain to another domain:
Format:
Name: api
Type: CNAME
Value: app.elb.nifetency.com
TTL: 3600
When to use:
- ✅ Mapping subdomains
- ✅ Flexible failover
- ✅ Load balancing
- ✅ Multiple apps
Advantages:
- Can change target easily
- Multiple records point to same target
- No IP address needed
- More flexible
Limitations:
- Cannot use on root domain (@) with some registrars
- Extra DNS lookup
- Slightly slower than A records
A Record​
Points domain to IP address:
Format:
Name: myapp
Type: A
Value: 203.0.113.42
TTL: 3600
When to use:
- ✅ Root domain mapping
- ✅ Direct IP address needed
- ✅ Simple setup
- ✅ Some registrars require it
Advantages:
- Fast resolution
- Works for root domain
- Direct IP connection
- One step lookup
Limitations:
- Must update if IP changes
- Less flexible than CNAME
- Not ideal for load balancing
ALIAS Record​
Special record (GoDaddy, some others):
Name: @
Type: ALIAS
Value: app.elb.nifetency.com
When to use:
- ✅ Root domain with CNAME-like benefits
- ✅ When registrar supports it
- ✅ Flexible root domain mapping
Registrars with ALIAS:
- GoDaddy
- Route 53
- Some others
MX Record​
For email routing:
Type: MX
Name: @
Value: mail.example.com
Priority: 10
Use for:
- Email delivery
- Separate from website
Keep separate from:
- Website CNAME records
- Application traffic
Setting Up DNS Records​
Step 1: Log Into Registrar​
Access your domain registrar:
Popular registrars:
- GoDaddy: godaddy.com
- Namecheap: namecheap.com
- Bluehost: bluehost.com
- HostGator: hostgator.com
- Route 53: AWS console
- Cloudflare: cloudflare.com
Step 2: Find DNS Settings​
Navigate to DNS management:
GoDaddy:
Home → My Products → Domains → Choose Domain
→ DNS or Manage Nameservers
Namecheap:
Dashboard → Manage Domain
→ DNS Records
Route 53 (AWS):
AWS Console → Route 53 → Hosted Zones → Select Domain → Create Record
- Subdomain: Type CNAME → Value: app.elb.nifetency.com → TTL: 300
- Apex Domain: Type A → Toggle 'Alias' → Point to Nife Dualstack Load Balancer endpoint
Cloudflare:
Cloudflare Dashboard → Select Domain → DNS → Records → Add Record
- Type: CNAME
- Name: @ (apex) or subdomain (e.g. app, api)
- Target: app.elb.nifetency.com
- Proxy Status:
* DNS Only (Grey Cloud): Direct edge termination by Nife (recommended for automated Let's Encrypt validation)
* Proxied (Orange Cloud): Ensure SSL/TLS encryption mode in Cloudflare is set to 'Full' or 'Full (Strict)'
- TTL: Auto
Step 3: Add Record​
Click "Add Record" or similar:
Fill in:
- Name/Subdomain: (e.g., api, www, @)
- Type: CNAME or A
- Value: Target from Nife
- TTL: 3600 or default
- Priority: (if MX record)
Step 4: Save​
Save the DNS record:
- Record saved immediately
- Propagation may take time
- Status may show "pending"
Common DNS Configurations​
Website + Email​
Setup:
Type Name Value
MX @ mail.example.com (priority 10)
MX @ mail2.example.com (priority 20)
CNAME www app.elb.nifetency.com
CNAME api app.elb.nifetency.com
Result:
- Email uses MX records
- Website uses CNAME
- Both can coexist
Root Domain​
Option 1: With ALIAS (GoDaddy, Route 53)
Type Name Value
ALIAS @ app.elb.nifetency.com
Option 2: With A Record
Type Name Value
A @ [IP Address]
Option 3: Redirect
Redirect example.com → www.example.com
Type www CNAME app.elb.nifetency.com
Multiple Subdomains​
Setup:
Type Name Value
CNAME www app.elb.nifetency.com
CNAME api app.elb.nifetency.com
CNAME blog app.elb.nifetency.com
CNAME staging app.elb.nifetency.com
Result:
- All subdomains point to application
- Can access via any subdomain
- Same application for all
Load Balancing​
Setup:
Type Name Value (weighted)
CNAME app server1.elb.nifetency.com (weight 50)
CNAME app server2.elb.nifetency.com (weight 50)
Result:
- Traffic distributed
- Failover protection
- Load balanced access
DNS Propagation​
How Propagation Works​
When you make DNS changes:
- Immediate: Changes at registrar
- 5 minutes: Local ISP updates
- 1 hour: Most servers updated
- 24 hours: Complete propagation
Factors affecting speed:
- TTL value (lower = faster)
- ISP caching
- DNS resolver caching
- Server locations
Check Propagation​
Using Terminal:
# Check DNS resolution
nslookup myapp.com
dig myapp.com
host myapp.com
# Specific record type
nslookup -type=CNAME myapp.com
dig CNAME myapp.com
Using Online Tools:
- MXToolbox.com
- DNSChecker.org
- WhatIsMyIPAddress.com/DNS-Propagation
Result:
Query returned:
api.myapp.com → app.elb.nifetency.com
Troubleshooting DNS​
Problem: DNS Not Resolving​
Symptoms:
- Domain returns error
- DNS lookup fails
- "Host not found" message
Solutions:
- Verify DNS record saved at registrar
- Check record name and value
- Wait 5-15 minutes for initial propagation
- Use online DNS checker
- Try flushing DNS cache:
# Windowsipconfig /flushdns# macOSsudo dscacheutil -flushcache# Linuxsudo systemctl restart nscd
Problem: Old DNS Still Resolving​
Symptoms:
- Old website still loads
- DNS shows old target
- Changes not taking effect
Solutions:
- Wait longer for propagation
- Lower TTL for faster updates
- Check registrar saved changes
- Try different DNS resolver:
- 8.8.8.8 (Google)
- 1.1.1.1 (Cloudflare)
- 208.67.222.222 (OpenDNS)
Problem: Partial Propagation​
Symptoms:
- Works from some locations
- Doesn't work from others
- Inconsistent results
Solutions:
- Completely normal during propagation
- Most locations update within 1 hour
- Wait 24 hours for complete propagation
- No action needed, just wait
DNS Best Practices​
1. Lower TTL Before Changes​
Before making DNS changes:
- Lower TTL to 300-600 seconds
- Wait for propagation
- Make DNS changes
- Propagates faster
- Then increase TTL back to 3600
2. Backup Records​
Keep record of current DNS:
Type Name Value TTL
CNAME www current 3600
CNAME api current 3600
3. Use Descriptive Names​
Use clear subdomain names:
www- main domainapi- API endpointblog- blog sectionstaging- staging environment
4. Document Changes​
Track DNS modifications:
- Date of change
- What changed
- Reason for change
- Who made change
5. Monitor TTL​
Keep appropriate TTL:
- Development: 300-600 seconds
- Production: 3600+ seconds
- Stability: 3600-86400 seconds
6. Separate Concerns​
Keep DNS records organized:
- Web traffic → CNAME
- Email → MX records
- Other services → Separate records
DNS Tools​
Free Checkers​
- DNSChecker.org: Visual checker
- MXToolbox.com: Detailed diagnostics
- WhatsMyDNS.com: Global propagation
- Zonemaster: DNSSEC validation
Command Line​
# Basic lookup
nslookup domain.com
dig domain.com
host domain.com
# Specific record type
dig CNAME domain.com
dig MX domain.com
# Trace DNS path
dig +trace domain.com
Registrar Tools​
Most registrars have built-in:
- DNS record checker
- Propagation status
- Record editor
- Export/import features
Next Steps​
- Adding Custom Domains - Setup your domain
- SSL Certificates - Secure your domain
- Monitoring Domains - Track usage
Support​
DNS issues?
- Check sections above
- Use online DNS tools
- Verify records in registrar
- Contact support: support@nife.io