Beginner developers struggling to connect domains to web hosts, VPS instances, or email services.
- ✓Access to a domain registrar or Cloudflare DNS management dashboard
- ✓Terminal access to run dig or nslookup
🚀 What You Will Learn & Build
- ▸The distinct roles of A, AAAA, CNAME, MX, and TXT records
- ▸How Time to Live (TTL) influences DNS propagation
- ▸Diagnosing DNS issues with terminal tools (dig, nslookup, ping)
- ▸Resolving ERR_NAME_NOT_RESOLVED and circular CNAME loops
1. Core DNS Record Types Explained in Simple Terms
2. Diagnosing DNS Using Command Line Tools
# Check A record of your domain
dig yourdomain.com A +short
# Query specific public DNS (e.g. Google 8.8.8.8 or Cloudflare 1.1.1.1) to bypass local ISP cache
dig @1.1.1.1 yourdomain.com A
# Check MX records
dig yourdomain.com MX +short
# Windows equivalent using nslookup
nslookup -type=A yourdomain.com 1.1.1.13. Fixing Common DNS Errors
✨ Expected Output & Verification
Running 'dig yourdomain.com +short' returns your active server IP address with zero NXDOMAIN errors.
🧪 How to Test the Implementation
- 1Test global propagation using whatsmydns.net
- 2Clear local DNS cache: 'sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder' on macOS or 'ipconfig /flushdns' on Windows
⚠️ Common Errors & How to Fix Them
Root Cause: Old hosting provider IP was not deleted when adding new IP.
Fix: Delete the old A record so traffic routes 100% to your new server.
🛡️ Security Considerations & Best Practices
- !Never share administrative login credentials to your DNS provider.
❓ Frequently Asked Questions (FAQ)
Most modern DNS changes propagate in 2 to 15 minutes, but local Nepali ISPs with aggressive caching may take up to 24 hours.
📌 Summary of Key Takeaways
- ✓A records point to IP addresses; CNAME points to domain names.
- ✓Use 'dig' or 'nslookup' with public resolvers (1.1.1.1) to bypass ISP caching.
Official References & Further Reading
- 🔗Cloudflare DNS Learning Center— Comprehensive guide to DNS fundamentals.
Written by Manoj Neupane
AuthorSoftware developer and programming instructor, Nepal
Building software systems and SaaS platforms with Laravel, Next.js, and Node.js. Passionate about helping students and developers in Nepal master practical, real-world development skills.