Guides
DNS and Nameservers Explained: How a Domain Finds Its Server
2026-06-29 · OSIR Team

Summary: When someone types your domain, their computer asks the Domain Name System (DNS) to translate that name into an IP address. The translation starts at your nameservers - the servers, listed on the domain itself, that hold the authoritative answers. Inside those nameservers live DNS records: an A record points the name to an IPv4 address, a CNAME aliases one name to another, an MX record routes email, and so on. This guide explains how a lookup travels from the root to your server, what each record type does, and why changes take time to propagate.
How a DNS lookup works (the chain)
A single visit to example.com triggers a four-step resolution, usually in milliseconds:
| Step | Who answers | What it returns |
|---|---|---|
| 1. Root | Root nameservers | "Ask the .com registry's servers." |
| 2. TLD | The TLD's nameservers (e.g. Verisign for .com) |
"Ask these nameservers for example.com." |
| 3. Authoritative | Your domain's nameservers | The actual record (e.g. A -> 93.184.216.34). |
| 4. Resolver | Your ISP / public resolver (1.1.1.1, 8.8.8.8) | Caches the answer and hands it back to the browser. |
The resolver does the legwork and caches each answer for a set time, so the full chain only runs when nothing is cached.
The system has been running this way since 1983, when Paul Mockapetris designed DNS to replace a single hosts file. Today the root zone is served by 13 named root servers (a.root-servers.net through m.root-servers.net) operated by 12 organizations - and each of those names is really hundreds of anycast instances spread around the world, which is why the root has never gone down.
Define: DNS (Domain Name System) is the internet's address book - it maps human-readable names (
osir.com) to machine addresses (IP numbers).
What are nameservers?
A nameserver (also written name server - both spellings mean the same thing) is the server that holds the authoritative DNS records for your domain and answers queries about it. Your domain lists its nameservers at the registry (set through your registrar), usually as hostnames like ns1.example-dns.com and ns2.example-dns.com. Whoever controls those nameservers controls where your domain's traffic and email go - which is why pointing your nameservers at the right DNS provider is the single most important setup step.
Define: nameserver is a server that publishes the authoritative DNS records for one or more domains. A domain normally lists at least two for redundancy.
Glue records: the chicken-and-egg fix
If your nameserver is inside the domain it serves (e.g. ns1.example.com serving example.com), DNS would loop forever trying to resolve the nameserver's own address. A glue record breaks the loop: the parent registry stores the nameserver's IP directly, so resolvers get the address without another lookup. You only need glue when you run vanity nameservers on your own domain.
How to check which nameservers a domain uses
Three ways, no login required:
| Method | Command / place | What you get |
|---|---|---|
| Terminal (any OS) | nslookup -type=NS example.com |
The NS records resolvers see right now |
| Terminal (macOS/Linux) | dig NS example.com +short |
Same, in a cleaner list |
| RDAP / WHOIS | Your registrar's lookup, or any RDAP client | What the registry has on file |
If the registry and the live NS answers disagree, a nameserver change is still propagating - or was never saved at the registrar. New to these commands? Our help guide Using dig and nslookup takes you from your first lookup to full propagation debugging.
How to change your nameservers
Nameserver changes happen at the registrar, not at your DNS provider:
- Get the nameserver hostnames from your new DNS provider (usually two to four, like
ns1.provider.com). - In your registrar dashboard, open the domain and replace the existing nameserver entries.
- Re-create your DNS records at the new provider first - the moment the change lands, the old provider stops being consulted, and any record that only exists there goes dark.
- Wait out propagation (registry NS records often carry TTLs of up to 48 hours, though most traffic follows within a couple of hours).
A domain must list at least 2 nameservers; most TLDs allow up to 13.
The DNS records you will actually use
| Record | Purpose | Example value |
|---|---|---|
| A | Name -> IPv4 address | 93.184.216.34 |
| AAAA | Name -> IPv6 address | 2606:2800:220:1::1 |
| CNAME | Alias one name to another | www -> example.com |
| MX | Mail server for the domain | 10 mail.example.com |
| TXT | Free-form text (SPF, DKIM, verification) | v=spf1 include:... |
| NS | Delegates a zone to nameservers | ns1.example-dns.com |
| CAA | Which CAs may issue TLS certs | 0 issue "letsencrypt.org" |
- A / AAAA are the workhorses - they put a name on the map.
- CNAME cannot sit at the bare/root domain (
example.com); use it for subdomains likewwworblog. - MX decides email delivery and is independent of where the website lives.
- TXT quietly powers email authentication (SPF, DKIM, DMARC) and domain-ownership checks.
TTL and propagation: why changes are not instant
Every record carries a TTL (time to live) - how many seconds resolvers may cache it. Change an A record and old resolvers keep serving the stale value until its TTL expires. This cache-expiry lag is what people call propagation; it is not the change "spreading" but old caches timing out.
Tip: lower a record's TTL (e.g. to 300 seconds) a day before a planned migration, then raise it back afterward. Nameserver (NS) changes at the registry can take longer because TLD-level caches use longer TTLs.
Putting it together
To launch a domain you typically: (1) set the domain's nameservers to your DNS provider, (2) add an A/AAAA record for the root and a CNAME for www, (3) add MX + TXT records if you use email, and (4) wait out the TTL. With OSIR you manage all of this per-domain in the dashboard or programmatically through the API and MCP tools - the same DNS record operations an AI assistant can run for you.
DNS and nameservers FAQ
What is the difference between DNS and a nameserver?
DNS is the whole naming system; a nameserver is one server within it that holds the authoritative records for specific domains. DNS is the protocol and hierarchy; nameservers are the machines that answer at the bottom of that hierarchy.
How do I find a nameserver's IP address?
A nameserver is named by a hostname (e.g. ns1.example-dns.com); its IP comes from a normal A/AAAA lookup of that hostname. When the nameserver lives under the domain it serves, the registry publishes its IP as a glue record so resolvers can reach it directly.
What is a glue record?
A glue record is an IP address for a nameserver, stored at the parent registry, used to avoid a circular lookup when a domain's nameserver is a subdomain of that same domain. It is only needed for vanity nameservers.
Why do DNS changes take time to appear?
Resolvers cache records for the duration of each record's TTL. After a change, caches keep serving the old value until the TTL expires - so the delay you see ("propagation") is really cache expiry, not the change travelling across the internet.
Which DNS record points my domain to a website?
An A record (IPv4) or AAAA record (IPv6) maps the name to the server's IP address. For a subdomain like www, a CNAME pointing to the root domain is common.
How many nameservers does a domain need?
At least 2 (a registry requirement, for redundancy), and most TLDs accept up to 13. Two from a reliable anycast DNS provider is plenty for almost every site; more only adds resilience if they are on genuinely separate infrastructure.
How do I change my domain's nameservers?
At your registrar, not your DNS host: open the domain, replace the nameserver hostnames with the new provider's, and save. Copy your DNS records to the new provider before switching, then allow up to 48 hours for registry-level caches to expire.
Go deeper: the Domain Mastery series
DNS is one chapter of our Domain Mastery series in the Help Center - twelve short, practical articles covering everything a domain does between registration and deletion:
- DNS and nameservers - the hands-on companion to this post
- The domain lifecycle - registration, grace periods, redemption, deletion
- Domain status codes - what
clientHoldorpendingDeleteactually mean - Domain transfers - moving a domain without downtime (nameservers travel with it)
- The redemption grace period - recovering a domain after it expires
- WHOIS, RDAP and privacy - who can see what about your domain
For step-by-step record editing in the dashboard, see Managing DNS records.
Manage DNS the AI-native way
Every domain at OSIR comes with anycast DNS and full record management - A, AAAA, CNAME, MX, TXT, NS and more - from one dashboard or via API and MCP automation, so an AI agent can create and update records for you. Browse the extensions directory and pricing to register a name. New here? See Domain Registries Explained and the Domain Lifecycle.
Image generated with AI (Higgsfield).