A name server is a computer that translates domain names into IP addresses. Name servers serve a fundamental role in the Domain Name System (DNS). They allow a user to visit a website by entering its domain name into their web browser's address field instead of manually entering the web server's IP address.
Every registered domain name must list at least two name servers in its DNS record. Known as "authoritative name servers," these name servers maintain a record of the IP addresses for that domain name's web server, mail server, subdomains, and other services. These name servers often use the naming convention ns1.example.com and ns2.example.com. The first-listed name server gets checked first, while the second-listed server acts as a backup in case the primary does not respond.
The Domain Name System relies on several layers of name servers that fill separate roles. When your web browser first make a DNS request, it checks with the DNS name server specified by your network's DHCP settings — typically, a name server operated by your ISP. If that name server doesn't have the domain name's record, your computer begins checking other servers starting from the top. The highest-level name servers are called "root DNS servers" and maintain the records of the name servers for each top-level domain (e.g. .com, .net, .ca). Each TLD's name server has the record for the authoritative name server for every domain using that TLD, which then directs your computer to the IP address of that domain's web server.
Large enterprise networks often have their own name servers to direct domain lookups within their intranet. Internal name servers let users access internal web portals, printers, and other resources using internal domain names instead of IP addresses. These resources often use private IP addresses that are not accessible from outside of the local intranet.