Lesson 1.2: DNS Basics for Local Development
Completion requirements
DNS Resolution Process
Understanding the DNS resolution order is crucial for local development:
- Hosts File: First check local hosts file
- Local DNS Cache: Check system DNS cache
- DNS Server: Query configured DNS servers
- 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
- Configure hosts file with test domains
- Test resolution with multiple tools
- Document resolution times and paths
- Clear cache and retest
Last modified: Thursday, 6 November 2025, 8:47 AM