What is a Nameserver?

Author:

Published:

Updated on August 16, 2024

Reading Time: 1 min read

Nameserver #

A nameserver is a critical part of the Domain Name System (DNS). In simple terms, DNS is responsible for answering queries about domain names.

An authoritative nameserver is where the DNS records for your domain name are stored.

Whenever you type a domain name into a web browser, it is the nameservers that find the IP address and facilitate your connection to the site.

Role of Nameservers #

A nameserver helps translate domain names into IP addresses. This is necessary because while humans can easily remember and understand domain names (such as www.stackcp.com), computers and other devices access websites using IP addresses (such as 185.151.30.20).

Types of Nameservers #

There are two types of nameservers: authoritative and recursive.

Authoritative Nameservers: Responsible for storing information about a specific zone, such as its IP address and any subdomains. They only answer queries for domain names that they have zones for.
Recursive Nameservers: Do not store information about domains but instead forward requests for domain information to other nameservers until the correct IP address is found. As an end user, you don’t usually have to worry about recursive nameservers. You’ll either be using recursive nameservers provided by your Internet Service Provider (ISP) or a public DNS service such as Google’s Public DNS or Cloudflare’s 1.1.1.1.

How Nameservers Translate Domain Names into IP Addresses #

When a user types a domain name into their browser, the device sends a DNS query to resolve the domain name to its corresponding IP address.

  • Your computer communicates with your recursive/local nameserver, which in turn queries the domain’s authoritative nameserver for the record.
  • The authoritative nameserver looks up the IP address in its database and returns it to the resolver, which is then given to your device.
  • The browser uses that IP address to access the domain and render the webspace.


Example of Nameservers #

When you visit stackcp.com in your browser, your device sends a query for stackcp.com to your recursive nameserver. Your recursive nameserver first asks the root nameservers and .COM nameservers for the nameservers responsible for stackcp.com.

Our nameservers are ns1.stackdns.com, ns2.stackdns.com, ns3.stackdns.com, and ns4.stackdns.com.

The recursive nameserver then asks one of the 4 stackdns.com nameservers for the DNS records stackcp.com resolves to.

Our nameservers reply with an A record and an IP address like 185.151.30.20. Your browser then makes a connection to this IP address, which will get to the web server hosting the website, and you get the rendered page in your web browser.

The Importance of Nameservers in the Internet Infrastructure #

In summary, nameservers are an essential part of the internet infrastructure, allowing users to access websites using easy-to-remember domain names instead of having to remember complex IP addresses.