Skip to main content

    A Beginner's Guide to DNS: What It Is and How It Works

    DNS explained from scratch — how domain resolution works, record types (A, CNAME, MX, TXT), nameservers, TTL, and common DNS mistakes to avoid.

    Chris GraboMarch 27, 20266 min read

    Every time you type a website address into your browser, something invisible happens in the background before the page loads. That something is DNS — the system that translates human-friendly domain names into the numerical addresses computers actually use to find each other.

    If you own a domain or manage a website, understanding the basics of DNS saves you time and prevents common headaches when setting up hosting, email, or other services.

    What Is DNS?

    DNS stands for Domain Name System. It's often called "the phone book of the internet," and the analogy is surprisingly accurate. Just like a phone book maps a person's name to their phone number, DNS maps a domain name (like spectrahost.com) to an IP address (like 192.0.2.1).

    Without DNS, you'd have to memorize IP addresses for every website you want to visit. DNS lets you type easy-to-remember names instead, and handles the translation behind the scenes.

    How DNS Resolution Works

    When you enter a web address, here's what happens step by step:

    • Step 1: Browser cache — Your browser checks if it already knows the IP address for that domain from a recent visit. If yes, it uses the cached result and skips the rest.
    • Step 2: Operating system cache — If the browser doesn't have it, your computer's OS checks its own DNS cache.
    • Step 3: Recursive resolver — Still no answer? Your request goes to a DNS resolver, usually run by your internet provider. This resolver does the heavy lifting.
    • Step 4: Root nameservers — The resolver asks a root nameserver, "Where can I find information about .com domains?" The root server points it to the right place.
    • Step 5: TLD nameservers — The resolver then asks the .com nameserver, "Who handles spectrahost.com?" It gets directed to the domain's authoritative nameservers.
    • Step 6: Authoritative nameserver — Finally, the resolver asks the domain's own nameserver for the specific IP address. It gets the answer and sends it back to your browser.

    This entire process usually takes less than 100 milliseconds. Once resolved, the result is cached at multiple levels so future requests are even faster.

    DNS Record Types Explained

    DNS doesn't just store IP addresses. Different record types serve different purposes:

    A Record

    The most fundamental record. An A record maps a domain name to an IPv4 address. When you point your domain to your hosting server, you're usually creating or updating an A record.

    CNAME Record

    A CNAME (Canonical Name) record maps one domain name to another domain name. It's commonly used for subdomains — for example, pointing www.yourdomain.com to yourdomain.com, or pointing a subdomain to a third-party service.

    MX Record

    MX (Mail Exchange) records tell the internet where to deliver email for your domain. If you use a separate email provider like Google Workspace or Microsoft 365, you'll set MX records to route mail to their servers instead of your hosting server.

    TXT Record

    TXT records store text data and are used for verification and security. Common uses include SPF records (which prevent email spoofing), DKIM signatures, domain ownership verification for Google Search Console, and other third-party service confirmations.

    What Are Nameservers?

    Nameservers are the servers that hold the DNS records for your domain. When you register a domain, it's assigned nameservers — usually your registrar's by default. If you move your hosting, you may need to update your nameservers to point to your hosting provider's nameservers instead.

    For example, if you register a domain and host it with SpectraHost, you'd set the nameservers to our hosting nameservers so DNS queries for your domain get answered by our servers.

    What Is TTL?

    TTL stands for Time to Live, measured in seconds. It tells DNS resolvers how long to cache a record before checking for an updated version. A TTL of 3600 means resolvers will cache the record for one hour.

    Lower TTL values mean DNS changes take effect faster, but generate more DNS queries. Higher values are more efficient but mean changes propagate slowly. When you're about to make DNS changes (like transferring a domain or switching hosts), lowering the TTL a day or two in advance helps the transition go smoothly.

    How to Point a Domain to Your Hosting

    The process depends on whether you update nameservers or individual records:

    • Option A: Change nameservers — Log into your domain registrar, find the nameserver settings, and replace them with your hosting provider's nameservers. This hands full DNS control to your host.
    • Option B: Update A records — Keep your current nameservers but create or update the A record to point to your hosting server's IP address. This lets you manage DNS at the registrar while hosting elsewhere.

    Either approach works. Option A is simpler if you want to manage everything in one place. Option B gives you more granular control.

    Common DNS Mistakes to Avoid

    • Forgetting the www version — Set up both yourdomain.com and www.yourdomain.com. Missing one means some visitors will see an error.
    • Not waiting for propagation — DNS changes can take up to 48 hours to propagate globally, though most resolve within a few hours. Don't panic if changes aren't instant.
    • Wrong record type — Using a CNAME where an A record is needed (or vice versa) is a common mix-up that causes outages.
    • Forgetting MX records after migration — When moving hosts, always verify that your MX records are correct. Losing email is worse than a brief website hiccup.
    • High TTL before a migration — If your TTL is set to 24 hours and you switch servers, some visitors will still be sent to the old server for up to a full day.

    Get Started With Your Domain

    Whether you need to register a new domain or connect one you already own, SpectraHost makes DNS management straightforward. Every hosting plan includes a DNS zone editor, and our support team can help with any DNS configuration questions.

    Search for your perfect domain name →

    Ready to Get Started?

    Free SSL, instant activation, and a 30-day money-back guarantee on every plan.