Ask CWS: How does DNS work?

The Internet runs on a number of fundamental technologies that most people never need to think about. The Domain Name System, or DNS, is one of these. When traffic is routed to machines on the Internet, those machines are identified by a series of numbers called an IP address:, for example. Plug that number into your browser's address bar and you'll be connected to our website. But with hundreds of millions of websites on the Internet, it's much easier to remember something that looks like a name than a string of numbers. The DNS system acts as a sort of global address book for the Internet, mapping human-readable names to the IP addresses that the machines use to communicate.

The system is made more complex, but also very fast, by the fact that it's distributed. Your computer is configured to use a set of DNS servers that are usually located nearby. They're often provided by your Internet Service Provider. Any particular DNS server may hold the authoritative records for only a few domains, but it knows how to look up the records for those that it doesn't hold, and it's generally able to retrieve them much faster than your computer would if it looked them up directly.

Every time you type a domain like www.cws.net into your Web browser, a conversation somewhat like the following takes place, usually in an instant:

  1. Your computer to your primary DNS server: What is the IP address for www.cws.net?
  2. Your DNS server to itself: "Is cws.net a domain that I own the records for? If so, I can answer the question directly. In this case, it looks like I don't own it."
  3. Your DNS server to one of the "root" DNS servers: "Who has the records for cws.net?"
  4. Root DNS server: "Try asking over at"
  5. Your DNS server to CWS DNS server: "What is the IP address for www.cws.net?"
  6. CWS DNS server: www.cws.net maps to
  7. Your DNS server: "Thanks! I'll keep that number handy for a while, so I can answer the question faster next time I'm asked."

This conversation is clearly a simplification, but it illustrates some of the moving parts that can be involved in satisfying a simple request. Most people are likely to care about these conversations only when something changes. Moving a website between hosts, for example, will change the IP address mapped to its domain.

Two key problem areas lie in #3 and #7 above.

The Internet's root DNS servers keep track of which servers have the authoritative records for top-level domains. But those records themselves must be kept up to date by domain registrars. Registrars are the companies who sell and assign ownership for specific names like cws.net. Plus, to keep the entire system as fast as possible, local DNS servers are allowed keep a copy of mappings for a period of time specified in the record. This behavior is called caching, and it means they can answer repeated lookups much more quickly. But it also means that when a change occurs at the root servers, local DNS servers may not see it until they discard the cached answer. Caches can exist in other places, too: your compter has its own DNS cache, and there can be caches on your local network as well.

The system is further complicated by the fact that there are a limited number of IP addresses available under the current system (roughly four billion, which is not as vast a number as it might seem). Often, many websites map to a single IP address. So even though your computer does uses the IP address to connect to the website host, it still specifes the domain in its request to tell that server which particular site it's looking for at that address.

This means that all of the following pieces must be in place to satisfy an individual Web request:

  1. Web server, configured to accept traffic for the domain
  2. DNS server(s), reporting the address of #1 for lookups
  3. Domain registration, keeping the root servers updated with the address of #2

Technically, all three of these services can be provided by different entities. Most people find it simpler to consolidate. Although there's a limited number of accredited registrars, most of them have partner or reseller programs (CWS acts as a Network Solutions partner).

When creating a new website, and especially when moving an existing one, it's crucial to update each of these pieces correctly and in the correct order. It can also take some time before changes are visible to everyone in all locations.

To find out more about how your own domain is set up, you can use the Internet's WHOIS system, which offers public access to the domain registry. A WHOIS record will show who owns a given domain and what DNS servers are listed as authoritative for it.