What is NameServer ?
A nameserver refers to the server component of the Domain Name System (DNS), one of the two principal namespaces of the Internet. The most important function of DNS servers is the translation (resolution) of human-memorable domain names (example.com). Nameservers are a fundamental part of the Domain Name System (DNS). They allow using domains instead of IP addresses. In simple words, nameservers define your domain's current DNS provider.
Domain NameServer
The Internet maintains two principal namespaces: the domain name hierarchy and the IP address system. The Domain Name System maintains the domain namespace and provides translation services between these two namespaces. Internet nameservers implement the Domain Name System.
The top hierarchy of the Domain Name System is served by the root nameservers maintained by delegation by the Internet Corporation for Assigned Names and Numbers (ICANN). Below the root, Internet resources are organized into a hierarchy of domains, administered by the respective registrars and domain name holders.
A DNS nameserver is a server that stores the DNS records, such as address (A, AAAA) records, nameserver (NS) records, and mail exchanger (MX) records for a domain name and responds with answers to queries against its database.
Caching NameServer
Caching nameservers (DNS caches) store DNS query results for a period of time determined in the configuration (time-to-live) of each domain-name record. DNS caches improve the efficiency of the DNS by reducing DNS traffic across the Internet, and by reducing load on authoritative name-servers, particularly root name-servers. Because they can answer questions more quickly, they also increase the performance of end-user applications that use the DNS. Recursive nameservers resolve any query they receive, even if they are not authoritative for the question being asked, by consulting the server or servers that are authoritative for the question.
Caching nameservers are often also recursive nameservers — they perform every step necessary to answer any DNS query they receive. To do this the nameserver queries each authoritative name-server in turn, starting from the DNS root zone. It continues until it reaches the authoritative server for the zone that contains the queried domain name. That server provides the answer to the question, or definitively says it can't be answered, and the caching resolver then returns this response to the client that asked the question. The authority, resolving and caching functions can all be present in a DNS server implementation, but this is not required: a DNS server can implement any one of these functions alone, without implementing the others.
Internet service providers typically provide caching resolvers for their customers. In addition, many home-networking routers implement caching resolvers to improve efficiency in the local network. Some systems utilize nscd, which stands for the "name service caching daemon".