When something goes wrong with a website β it disappears, emails stop delivering, or new hosting does not resolve β the cause is almost always DNS. Understanding how domain names and DNS work gives you the knowledge to diagnose these problems yourself and make confident decisions when setting up or migrating websites.
What a Domain Name Is
A domain name is a human-readable address that maps to numerical IP addresses. IP addresses like 192.168.1.1 are how computers identify each other. Domain names exist because humans cannot memorise hundreds of numerical addresses. The Domain Name System (DNS) is the global directory β often called the internet's phonebook β that performs this translation.
How DNS Resolution Works
When you type a URL, your operating system asks a DNS resolver to look up the domain. The resolver queries authoritative name servers until it finds the record mapping the domain to an IP address. Your browser connects directly to that IP. This typically takes under 100 milliseconds and is completely invisible to the user.
The Four DNS Record Types You Need
An A record maps a domain to an IPv4 address β how your domain points to your server. A CNAME record maps one domain to another, used for www subdomains and hosting provider URLs. An MX record specifies which server handles email. A TXT record stores verification data for domain ownership, SPF, and other services. These four record types handle 95% of real-world DNS tasks.
DNS Propagation
DNS changes do not take effect instantly. Records have a TTL (Time To Live) value β how long resolvers cache them before re-checking. A TTL of 3600 means up to one hour for changes to propagate. Lower your TTL to 300 seconds 24β48 hours before a planned server migration so changes propagate in five minutes rather than 48 hours.
Setting Up a Domain for the First Time
The complete setup sequence for a new website domain: purchase the domain at a registrar (Namecheap, Cloudflare Registrar, or Google Domains); point the domain's nameservers to your DNS provider (if using Cloudflare for DNS, update nameservers in the registrar to Cloudflare's nameservers); in the DNS provider's dashboard, create an A record pointing the domain to your web host's IP address; create a CNAME record for www pointing to the root domain; wait for DNS propagation (typically 1-24 hours); verify the site loads correctly at both the root domain and www subdomain.
HTTPS setup requires an SSL/TLS certificate. Most modern web hosts provide free SSL certificates through Let's Encrypt, automatically provisioned when the domain's DNS correctly points to the host. Cloudflare's free plan includes automatic HTTPS with its Universal SSL feature β any site behind Cloudflare gets HTTPS automatically, even if the origin server does not have its own SSL certificate. The Cloudflare approach requires configuring the SSL mode (Full or Full Strict depending on whether the origin has its own valid certificate).
Email Setup: MX Records and Email Authentication
Receiving email at your domain requires MX records pointing to your email provider's mail servers. Google Workspace, Microsoft 365, Zoho Mail, and Fastmail each publish their required MX records in their setup documentation. Multiple MX records with different priority values create redundancy β if the primary mail server is unreachable, email is delivered to the backup. Email sent from your domain to other servers must pass authentication checks to avoid being marked as spam.
Three email authentication records are necessary for reliable email delivery. SPF (Sender Policy Framework): a TXT record listing the mail servers authorised to send email from your domain. DKIM (DomainKeys Identified Mail): a TXT record containing the public key for verifying email signatures. DMARC (Domain-based Message Authentication, Reporting, and Conformance): a TXT record specifying what to do with emails that fail SPF or DKIM checks (none, quarantine, or reject) and where to send failure reports. All three are required for reliable email deliverability from a custom domain.
Create QR codes linking to your domain for business cards and marketing materials with the QR Code Generator. Free, high-quality, PNG download.
Try the Free Tools
14 free, browser-based utilities. No signup, no data stored, no limits.
Explore All Tools β