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#

  1. You type domain in browser
  2. Browser queries DNS for address
  3. DNS resolves domain to target
  4. Browser connects to application
  5. 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 Console โ†’ Route 53
โ†’ Hosted Zones โ†’ Choose Domain

Step 3: Add Record#

Click "Add Record" or similar:

Fill in:

  1. Name/Subdomain: (e.g., api, www, @)
  2. Type: CNAME or A
  3. Value: Target from Nife
  4. TTL: 3600 or default
  5. 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:

  1. Immediate: Changes at registrar
  2. 5 minutes: Local ISP updates
  3. 1 hour: Most servers updated
  4. 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:

  1. Verify DNS record saved at registrar

  2. Check record name and value

  3. Wait 5-15 minutes for initial propagation

  4. Use online DNS checker

  5. Try flushing DNS cache:

    # Windows
    ipconfig /flushdns
    # macOS
    sudo dscacheutil -flushcache
    # Linux
    sudo systemctl restart nscd

Problem: Old DNS Still Resolving#

Symptoms:

  • Old website still loads
  • DNS shows old target
  • Changes not taking effect

Solutions:

  1. Wait longer for propagation
  2. Lower TTL for faster updates
  3. Check registrar saved changes
  4. 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:

  1. Completely normal during propagation
  2. Most locations update within 1 hour
  3. Wait 24 hours for complete propagation
  4. No action needed, just wait

DNS Best Practices#

1. Lower TTL Before Changes#

Before making DNS changes:

  1. Lower TTL to 300-600 seconds
  2. Wait for propagation
  3. Make DNS changes
  4. Propagates faster
  5. 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 domain
  • api - API endpoint
  • blog - blog section
  • staging - 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#

  1. Adding Custom Domains - Setup your domain
  2. SSL Certificates - Secure your domain
  3. Monitoring Domains - Track usage

Support#

DNS issues?

  • Check sections above
  • Use online DNS tools
  • Verify records in registrar
  • Contact support: [email protected]