Skip to main content

DNS

Domain Name System

Updated 3 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/dns

In short

DNS is the internet's naming system that translates human-readable domain names like example.com into the numeric IP addresses computers use to connect.

What is DNS?

DNS, the Domain Name System, is often called the phone book of the internet. People remember names like example.com, but computers find each other using numeric IP addresses such as 203.0.113.10 (IPv4) or 2001:db8::10 (IPv6). DNS translates the name into the address, so your browser knows which server to contact.

When you visit a website, your device asks a recursive resolver, usually run by your internet provider, your company, or a public DNS service, for the address. If the resolver has no cached answer, it walks the hierarchy: a root server points it to the servers for the top-level domain (such as .com), which point it to the domain's authoritative name servers, which return the final answer. The resolver then caches the result for a period called the TTL (time to live), so most repeat lookups take only a few milliseconds.

A domain's DNS settings are made up of records. An A record maps a name to an IPv4 address, an AAAA record maps it to an IPv6 address, a CNAME record makes one name an alias for another, MX records say which servers receive email for the domain, and TXT records hold text used for things like domain verification and email security. Developers edit these records whenever they point a domain at a new server, load balancer, CDN, or hosting platform.

DNS is often confused with domain registration or web hosting. A registrar is where you buy and renew the domain name, a DNS provider hosts the records that say where the domain points, and a hosting provider runs the actual website; one company may do all three, but they are separate jobs. Because of caching, DNS changes are not instant: old answers may be served until their TTL expires, which is why people talk about waiting for DNS propagation.

At a glance

A DNS lookup: the browser asks a resolver for example.com; the resolver asks a root server, then a .com server, then the domain's authoritative server, returns the IP address 203.0.113.10 and keeps it in its cache.example.com?203.0.113.10BrowserResolverrecursiveCachekept for the TTLRoot serverpoints to .com.com TLD serverpoints to example.comAuthoritative serverreturns 203.0.113.10123
The resolver does the legwork, following each referral down the hierarchy, then caches the answer so repeat lookups are almost instant.

Key takeaways

  • DNS translates domain names into IP addresses.
  • Resolvers find answers by querying root, top-level domain, and authoritative name servers.
  • Common record types are A, AAAA, CNAME, MX, and TXT.
  • Answers are cached for a time set by each record's TTL.
  • DNS changes can take time to appear everywhere because of caching.

Example

Looking up DNS records from the command linebash
# Look up the IPv4 address (A record) for a domain
dig example.com A +short

# Find which servers receive email for the domain
dig example.com MX +short

# Show the full answer, including the TTL in seconds
dig www.example.com

# A basic lookup with a tool available on most systems, including Windows
nslookup example.com

Readers ask

What is DNS propagation?

DNS propagation is the time it takes for a DNS change to be seen everywhere. Resolvers around the world keep cached copies of old records until their TTL expires, so updates can take anywhere from a few minutes to a day or two.

What is the difference between an A record and a CNAME record?

An A record points a name directly to an IPv4 address. A CNAME record points a name to another domain name, which is then resolved to an address; a standard CNAME cannot be used at the root of a domain, such as example.com, because it cannot coexist with the other records required there.

What port does DNS use?

DNS traditionally uses port 53, over UDP for most queries and TCP for large responses. Encrypted variants, DNS over HTTPS (DoH) and DNS over TLS (DoT), use ports 443 and 853 to keep lookups private.

See also

Sources

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings