The internet and the World Wide Web are wild frontiers that rely on computer languages and codes to find and share data and information. One of the most fundamental instruments of the internet is the Domain Name System, or DNS. (Although many people think "DNS" stands for "Domain Name Server," it really stands for "Domain Name System.") DNS is a protocol within the set of standards for how computers exchange data on the internet and on many private networks, known as the TCP/IP protocol suite. Its purpose is vital, as it helps convert easy-to-understand domain names like "howstuffworks.com" into an Internet Protocol (IP) address, such as 184.108.40.206 that computers use to identify each other on the network. It is, in short, a system of matching names with numbers.
The DNS concept is like a phone book for the internet. Without this kind of wayfinding system, you'd have to resort to much more complicated and esoteric means to sift through the virtual open plains and dense cities of data strewn across the global internet ... and you can bet that it wouldn't be nearly as much fun, especially since there are now hundreds of millions of domain names [source: VeriSign].
Computers and other network devices on the internet use an IP address to route your request to the site you're trying to reach. This is similar to dialing a phone number to connect to the person you're trying to call. Thanks to DNS, though, you don't have to keep your own address book of IP addresses. Instead, you just connect through a domain name server, also called a DNS server or name server, which manages a massive database that maps domain names to IP addresses.
Whether you're accessing a website or sending e-mail, your computer uses a DNS server to look up the domain name you're trying to access. The proper term for this process is DNS name resolution, and you would say that the DNS server resolves the domain name to the IP address. For example, when you enter "www.howstuffworks.com" in your browser, part of the network connection includes resolving the domain name "howstuffworks.com" into an IP address, for example 220.127.116.11, for HowStuffWorks' web servers.
But, you're probably more likely to remember "howstuffworks.com" when you want to return later. In addition, a website's IP address can change over time, and some sites associate multiple IP addresses with a single domain name.
Without DNS servers, the internet would shut down very quickly. But how does your computer know what DNS server to use? Typically, when you connect to your home network, internet service provider (ISP) or WiFi network, the modem or router that assigns your computer's network address also sends some important network configuration information to your computer or mobile device. That configuration includes one or more DNS servers that the device should use when translating DNS names to IP address.
So far, you've read about some important DNS basics. The rest of this article dives deeper into domain name servers and name resolution. It even includes an introduction to managing your own DNS server. Let's start by looking at how IP addresses are structured and how that's important to the name resolution process.
DNS Servers and IP Addresses
You just learned that the primary job of a domain name server, or DNS server, is to resolve (translate) a domain name into an IP address. That sounds like a simple task, and it would be, except for the following points:
- There are billions of IP addresses currently in use, and most machines have a human-readable name as well.
- DNS servers (cumulatively) are processing billions of requests across the internet at any given time.
- Millions of people are adding and changing domain names and IP addresses each day.
With so much to handle, DNS servers rely on network efficiency and internet protocols. Part of the IP's effectiveness is that each machine on a network has a unique IP address in both the IPV4 and IPV6 standards managed by the Internet Assigned Numbers Authority (IANA). Here are some ways to recognize an IP address:
- An IP address in the IPV4 standard has four numbers separated by three decimals, as in: 18.104.22.168
- An IP address in the IPV6 standard has eight hexadecimal numbers (base-16) separated by colons, as in 2001:0cb8:85a3:0000:0000:8a2e:0370:7334. Because IPV6 is still a very new standard, we'll concentrate on the more common IPV4 for this article.
- Each number in an IPV4 number is called an "octet" because it's a base-10 equivalent of an 8-digit base-2 (binary) number used in routing network traffic. For example, the octet written as 42 stands for 00101010. Each digit in the binary number is the placeholder for a certain power of two from 2 to 27, reading from right to left. That means that in 00101010, you have one each of 21, 23 and 25. So, to get the base-10 equivalent, just add 21 + 23 + 25 = 2 + 8 + 32 = 42.
- There are only 256 possibilities for the value of each octect: the numbers 0 through 255.
- Certain addresses and ranges are designated by the IANA as reserved IP addresses, which means they have a specific job in IP. For example, the IP address 127.0.0.1 is reserved to identify the computer you're currently using. So, talking to 127.0.0.1 is just talking to yourself [sources: Cisco, Lammele].
Where does your computer's IP address come from? If we're talking about your desktop or laptop computer, it probably comes from a Dynamic Host Configuration Protocol (DHCP) server on your network. The job of a DHCP server is to make sure your computer has the IP address and other network configuration it needs whenever you're online. Because this is "dynamic," the IP address for your computer will probably change from time to time, such as when you shut down your computer for a few days. As the user, you'll probably never notice all this taking place. See the sidebar on this page for hints on where to find the IP address assigned to your computer or mobile device.
Web servers and other computers that need a consistent point of contact use static IP addresses. This means that the same IP address is always assigned to that system's network interface when it's online. To make sure that interface always gets the same IP address, IP associates the address with the Media Access Control (MAC) address for that network interface. Every network interface, both wired and wireless, has a unique MAC address embedded in it by the manufacturer.
Now, let's look at the other side of the DNS equation: domain names.
If we had to remember the IP addresses of all our favorite websites, we'd probably go nuts! Human beings are just not that good at remembering strings of numbers. We are good at remembering words, however, and that is where domain names come in. You probably have hundreds of domain names stored in your head, such as:
- howstuffworks.com — our favorite domain name
- google.com — one of the most used domain names in the world
- mit.edu — a popular EDU name
- bbc.co.uk — a three-part domain name using the country code UK
You'll recognize domain names as having strings of characters separated by dots (periods). The last word in a domain name represents a top-level domain. These top-level domains are controlled by the IANA in what's called the Root Zone Database, which we'll examine more closely later. There are more than 1,000 top-level domains, and here are some of the most common:
- COM — commercial websites, though open to everyone
- NET — network websites, though open to everyone
- ORG — non-profit organization websites, though open to everyone
- EDU — restricted to schools and educational organizations
- MIL — restricted to the U.S. military
- GOV — restricted to the U.S. government
- US, UK, RU and other two-letter country codes — each is assigned to a domain name authority in the respective country
In a domain name, each word and dot combination you add before a top-level domain indicates a level in the domain structure. Each level refers to a server or a group of servers that manage that domain level. For example, "howstuffworks" in our domain name is a second-level domain off the COM top-level domain. An organization may have a hierarchy of sub-domains further organizing its internet presence, like "bbc.co.uk" which is the BBC's domain under CO, an additional level created by the domain name authority responsible for the U.K. country code.
The left-most word in the domain name, such as www or mail, is a host name. It specifies the name of a specific machine (with a specific IP address) in a domain, typically dedicated to a specific purpose. A given domain can potentially contain millions of host names as long as they're all unique to that domain. (The "http" part stands for Hypertext Transfer Protocol and is the protocol by which information is sent by the user to the website she is visiting. Nowadays, you're more likely to see "https" which is a sign the information is being sent by secure protocol where the information is encrypted. This is especially important if you're providing a credit card number to a website [source: EasyNews].)
Because all of the names in a given domain need to be unique, there has to be some way to control the list and makes sure no duplicates arise. That's where registrars come in. A registrar is an authority that can assign domain names directly under one or more top-level domains and register them with InterNIC, a service of ICANN, which enforces uniqueness of domain names across the internet. Each domain registration becomes part of a central domain registration database known as the whois database. Network Solutions, Inc. (NSI) was one of the first registrars, and today companies like GoDaddy.com offer domain registration in addition to many other website and domain management services. [source: InterNIC]
Later, when we look at how to create a domain name, we'll see that part of registering a domain requires identifying one or more name servers (DNS servers) that have the authority to resolve the host names and sub-domains in that domain. Typically, you would do this through a hosting service, which has its own DNS servers. Next, we'll look at how these DNS servers manage your domain, and how DNS servers across the internet work together to ensure traffic is routed properly between IP addresses.
The Distributed System
Every domain has a domain name server handling its requests, and there is a person or IT team maintaining the records in that DNS server's database. No other database on the planet gets as many requests as DNS servers, and they handle all those queries while also processing data updates from millions of people every day. That's one of the most amazing parts of DNS — it is completely distributed throughout the world on millions of machines, managed by millions of people, and yet it behaves like a single, integrated database!
Because managing DNS seems like such a big job, most people tend to leave it to the IT professionals. However, by learning a little bit about how DNS works and how DNS servers are distributed across the internet, you can manage DNS with confidence. The first thing to know is what the purpose of a DNS server is on the network where it resides. A DNS server will have one of the following as its primary task:
- Maintain a small database of domain names and IP addresses most often used on its own network, and delegate name resolution for all other names to other DNS servers on the internet.
- Pair IP addresses with all hosts and sub-domains for which that DNS server has authority.
DNS servers that perform the first task are normally managed by your internet service provider (ISP). As mentioned earlier, the ISP's DNS server is part of the network configuration you get from DHCP as soon as you go online. These servers reside in your ISP's data centers, and they handle requests as follows:
- If it has the domain name and IP address in its database, it resolves the name itself.
- If it doesn't have the domain name and IP address in its database, it contacts another DNS server on the internet. It may have to do this multiple times.
- If it has to contact another DNS server, it caches the lookup results for a limited time so it can quickly resolve subsequent requests to the same domain name.
- If it has no luck finding the domain name after a reasonable search, it returns an error indicating that the name is invalid or doesn't exist.
The second category of DNS servers mentioned above is typically associated with web, mail and other internet domain hosting services. Though some hardcore IT gurus set up and manage their own DNS servers, hosting services have made DNS management much easier for the less technical audience. A DNS server that manages a specific domain is called the start of authority (SOA) for that domain. Over time, the results from looking up hosts at the SOA will propagate to other DNS servers, which in turn propagate to other DNS servers, and so on across the internet.
This propagation is a result of each DNS server caching the lookup result for a limited time, known as its Time To Live (TTL), ranging from a few minutes to a few days. People managing a DNS server can configure its TTL, so TTL values will vary across the Internet. So, each time you look up "www.howstuffworks.com," it's possible that the DNS server for your ISP will find the lookup results "22.214.171.124" in its own cache if you or someone else using that server looked for it before within the server's TTL.
This great web of DNS servers includes the root name servers, which start at the top of the domain hierarchy for a given top-level domain. There are hundreds of root name servers to choose from for each top-level domain. Though DNS lookups don't have to start at a root name server, they can contact a root name server as a last resort to help track down the SOA for a domain.
Now that you know how DNS servers are interconnected to improve the name resolution process, let's look at how you can configure a DNS server to be the authority for your domain.
Creating a New Domain Name
When you want to create a new domain name, you need to do the following:
- Use the Whois database to find a unique domain name that isn't yet registered. There are several sites that offer free Whois database searches, such as Network Solutions. If the search comes up empty, you know the domain name is available.
- Register the domain name with a registrar. There are a lot of registrars to choose from, and some offer special prices for registering the COM, NET, and ORG versions of a domain at the same time, for registering for two or more years, or for hosting the domain with the same company.
- If you're hosting the domain at a different company than your registrar, configure the registrar to point your domain name to the correct host name or IP address for your hosting company (see information below about A records) [source: Wilson and Randall].
Using the DNS servers from your registrar or hosting company means that you have a parked domain. This means that someone else owns the computer hardware for the DNS servers, and your domain is just part of that company's larger DNS configuration. Alternatively, if you're passionate about hosting your own DNS, you can set up your own server, either as a physical or virtual machine. Whichever DNS setup you decide on, that DNS server (or group of servers) becomes the SOA for your domain, as described earlier [source: BlueHost].
Whether your SOA is somewhere else or on your own system, you can extend and modify your DNS settings to add sub-domains, redirect e-mail and control other services. This information is kept in a zone file on the DNS server. If you're running your own server, you'll probably need to manually edit the zone file in a text editor. Many registrars today have a web interface you can use to manage DNS for your domain. Each new configuration you add is called a record, and the following are the most common types of records you can configure for your DNS server [source: GoDaddy.com].
- Host (A) — This is the basic mapping of IP address to host name, the essential component for any domain name.
- Canonical Name (CNAME) — This is an alias for your domain. Anyone accessing that alias will be automatically directed to the server indicated in the A record.
- Mail Exchanger (MX) — This maps e-mail traffic to a specific server. It could indicate another host name or an IP address. For example, people who use Google for the e-mail for their domain will create an MX record that points to ghs.google.com.
- Name Server (NS) — This contains the name server information for the zone. If you configure this, your server will let other DNS servers know that yours is the ultimate authority (SOA) for your domain when caching lookup information on your domain from other DNS servers around the world.
- Start of Authority (SOA) — This is one larger record at the beginning of every zone file with the primary name server for the zone and some other information. If your registrar or hosting company is running your DNS server, you won't need to manage this. If you're managing your own DNS, you can peek at tips for doing so using this article on the structure of a DNS SOA Record.
The following is an example of what a zone file might look like for those who are editing it directly in a text editor. Note that the center column (second item on each line) includes a record type from those listed above. When you see an "@" in the left column, it means that the record applies in all cases not otherwise specified:
@ NS auth-ns1.howstuffworks.com
@ NS auth-ns2.howstuffworks.com
@ MX 10 mail
mail A 126.96.36.199
vip1 A 188.8.131.52
www CNAME vip1
Typical users will probably get the most use out of MX and CNAME records. The MX records allows you to point your mail services somewhere other than your hosting company if you choose to use something like Google Apps for your domain. The CNAME records let you point host names for your domain to various other locations. This could include setting google.example.com to redirect to google.com, or setting up a dedicated game server with its own IP address and pointing it to something like gameserver.example.com.
DNS is Constantly Evolving
Now you know more about domain name servers, how DNS maps domain names to IP addresses, and how to choose your domain name and configure it to work within the distributed system of DNS servers around the world. Furthermore, you're in the zone with zone files and registered for success with domain name servers.
You should understand that DNS is not a static concept. In late 2018, ICANN finally rolled out new security features for DNS. In short, those changes affected the cryptographic keys used in the Domain Name System Security Extensions (DNSSEC) protocol, known by techies as the root zone key signing key (KSK). The security improvements were necessary, says ICANN, because of the way networks are rapidly changing and expanding, in part due to the Internet of Things, which brings millions of new interconnected devices into the internet's fold [source: Cooney].
Those safety measures are incredibly important because criminal-minded hackers often try to tap into the DNS system to steal personal information or simply wreak havoc, for example, in attacks like DNS hijacking. That means defense-minded computer users and IT professionals alike must stay up to date on preventative measures to prevent DNS poisoning attacks and denial-of-service attacks, among others [sources: Greenberg, SecurityTrails].
But there's an even bigger picture at stake with the status of DNS. It's often possible for tech gurus and powerful companies (or oppressive political regimes) to track traffic DNS traffic. In the wrong hands, that kind of data could be used for all sorts of nefarious ventures without any sort of regulatory oversight. In 2018, the internet Engineering Task Force accepted a new DNS-over-HTTPS as a standard – essentially an encryption concept meant to offer better privacy for everyone who uses the internet, no matter their purposes, making it much more difficult for manipulative or evil-minded digital empires to follow you around online [sources: Chirgwin, Morgenroth].
Like all things Internet, though, the new DNS-over-HTTPS paradigm is anything but a settled matter and subject to all sorts of potential adjustments and alterations. In other words, like the internet itself, the phone book that is DNS will keep evolving at an ever-faster pace – and it's increasingly important to maintain and protect these resources to keep our networks working like they should.
Last editorial update on Jan 31, 2019 10:37:26 am.
More Great Links
- Bluehost Web Hosting. "Parked Domain Definition." https://my.bluehost.com/hosting/help/79 (Nov. 5, 2018)
- Chirgwin, Richard. "'The Inmates Have Taken over the Asylum': DNS Godfather Blasts DNS over HTTPS Adoption." The Register. Oct. 23, 2018. (Nov. 5, 2018) https://www.theregister.co.uk/2018/10/23/paul_vixie_slaps_doh_as_dns_privacy_feature_becomes_a_standard/
- Cisco. "IP Addressing and Subnetting for New Users." August 10, 2016. https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html (Nov. 5, 2018)
- Cooney, Michael. "ICANN's Internet DNS Security Upgrade Apparently Goes off Without a Glitch." Network World. Oct. 12, 2018. (Nov. 5, 2018) https://www.networkworld.com/article/3313341/internet/icanns-internet-dns-security-upgrade-apparently-goes-off-without-a-glitch.html
- GoDaddy.com. "Help: What are zone files and zone records?" GoDaddy.com, Inc., May 5, 2011. (Nov. 5, 2018)
- GoDaddy.com. "Manage DNS Zone Files." https://www.godaddy.com/help/manage-dns-zone-files-680 (Nov. 5, 2018)
- Greenberg, Andy. "ackHacker Lexicon: What is DNS Hijacking?" Wired. Sep. 4, 2017. https://www.wired.com/story/what-is-dns-hijacking/ (Nov. 5, 2018)
- InterNIC. "InterNIC FAQs on the Domain Names, Registrars, and Registration." InterNIC. Internet Corporation for Assigned Names and Numbers. Sept. 25, 2003. (Nov. 5, 2018) http://www.internic.net/faqs/domain-names.html (Nov. 5, 2018)
- IT Geared. "What is an SOA Record in DNS?" Oct. 28, 2011. http://www.itgeared.com/articles/1132-what-is-soa-record-in-dns/ (Nov. 5, 2018)
- Lammele, Todd. "Getting to Know Your IP Addresses." Tech Republic. May 3, 2001. https://www.techrepublic.com/article/getting-to-know-your-ip-addresses/ (Nov. 5, 2018)
- Modi, Archit. "How to Find Your IP Address in Linux." OpenSource.com. May 17, 2018. https://opensource.com/article/18/5/how-find-ip-address-linux (Nov. 5, 2018)
- Morgenroth, Sven. "Pros and Cons of DNS Over HTTPS." Security Boulevard. Nov. 1, 2018. https://securityboulevard.com/2018/11/pros-and-cons-of-dns-over-https/ (Nov. 5, 2018)
- Price, David. "How to Find Your Mac's IP Address." MacWorld. April 24, 2018. https://www.macworld.co.uk/how-to/mac/mac-ip-address-3676112/ (Nov. 5, 2018)
- Rusen, Ciprian. "8 Ways to Find Your IP Address in Windows (All Versions)." Digital Citizen. Dec. 6, 2017. https://www.digitalcitizen.life/find-ip-address-windows (Nov. 5, 2018)
- SecurityTrails.com. "8 Tips to Prevent DNS Attacks." July 4, 2018. https://securitytrails.com/blog/8-tips-to-prevent-dns-attacks (Nov. 5, 2018)
- Verisign. "The Verisign Domain Industry Brief." 2018. https://www.verisign.com/en_US/domain-names/dnib/index.xhtml (Nov. 5, 2018)
- Wilson, Jeffrey and Randall, Neil. "How to Register a Domain Name for Your Website." PC Mag. July 27, 2018. https://www.pcmag.com/article2/0,2817,33918,00.asp (Nov. 5, 2018)