The Domain Name System (DNS) is a naming system that maps domain names to IP addresses (hosts). The Domain Name System has a hierarchy of domains: root zone > top level domains > second level domains > third level domains. End users can register a namespace (domain name), referred to as a second level domain in a top level domain: for example: the second level domain google in the com top level domain. Second level domain names are registered - for it's owner - by a registrar at a top level domain registry; a registrar is a company that has been certified by ICANN; ICANN manage the Domain Name System and a registry is a company, accredited by ICANN, that manages top level domains. When a domain name is registered, a DNS (Domain Name System) record is created for it. The DNS record for a domain name must contain two or more nameservers; the nameservers handle DNS services for the second level domain. Shown below, is an example of how a nameserver is written (in a DNS record):
The nameserver information is managed by the registrar of the domain name. A registrar will change nameserver information on behalf of the owner, or, the owner can login to the website of the registrar and change it themselves. Any change to the nameservers of a domain name will be updated by the central registry for that domain; it may take 24-48 hours for the registry to change the record. The registrar is a 'middleman' between the owner of the domain name and the 'owner' of the domain.
The purpose of a nameserver is to store DNS records for domain names and to respond to queries made to it. There are a range of different nameservers: root nameservers, authoritative nameservers, caching nameservers and non-authoritative nameservers. There are different DNS record types, such as: A, AAAA, CNAME, NSEC, NS and MX records. The root nameservers are the ultimate authority for resolving naming issues, but the majority of DNS queries are handled by DNS resolvers; root nameservers would struggle to cope if all queries were routed to them.
For example, when a user is surfing the World Wide Web, the following happens:
DNS nameservers handle DNS queries by using software like BIND (Berkeley Internet Name Domain); which includes a resolver library. Using software, like BIND, end users can operate their own nameserver.