DNS Resolution Process

Understanding the DNS resolution order is crucial for local development:

  1. Hosts File: First check local hosts file
  2. Local DNS Cache: Check system DNS cache
  3. DNS Server: Query configured DNS servers
  4. Root Servers: Ultimate fallback for public domains

Local Development Strategies

1. .local Domain Strategy

Use .local domains for development services:

nextcloud.local
stash.local
metube.local

Pros: Clear separation, no conflicts
Cons: Requires hosts file on each device

2. Subdomain Strategy

Use subdomains of a real domain you own:

nextcloud.dev.yourdomain.com
stash.dev.yourdomain.com

Pros: Can use real DNS
Cons: Requires domain ownership

3. Custom TLD Strategy

Use custom top-level domains:

nextcloud.mct
stash.mct
metube.mct

MCT Services DNS Configuration

Our current setup uses a hybrid approach:

# Development domains
127.0.0.1    nextcloud.mct.local
127.0.0.1    stash.mct.local
127.0.0.1    metube.mct.local
127.0.0.1    dashy.mct.local

# Alternative short names
127.0.0.1    nc.local
127.0.0.1    stash.local
127.0.0.1    tube.local

Testing DNS Resolution

Essential commands for testing your DNS setup:

# Test basic resolution
ping nextcloud.mct.local

# Detailed DNS lookup
nslookup nextcloud.mct.local

# Trace DNS resolution path
dig nextcloud.mct.local

# Check which DNS servers are being used
cat /etc/resolv.conf

DNS for Docker Services

When running services in Docker, consider:

  • Container Networking: Services communicate via container names
  • Host Access: Use host.docker.internal or bridge IP
  • External Access: Map to host IP addresses

Practical Exercise

Task: Set up DNS testing environment

  1. Configure hosts file with test domains
  2. Test resolution with multiple tools
  3. Document resolution times and paths
  4. Clear cache and retest
Last modified: Thursday, 6 November 2025, 8:47 AM