DNS stands for Domain Name System. The purpose of the system is to convert a domain name into an IP address.
This conversion process occurs by sending a request to a series of special servers, each of which returns the location of the next server. These servers are called name servers. The last name server provides the IP address that points to a specific service (such as a website, e-mail, etc.) on a unique server on the internet.
The system works as follows:
DNS reads a domain name in, from right to left. So the DNS reads www.yourdomainname.nl as nl.yourdomainname.www.
Every piece of text separated by a full stop is a separate query (request) that is sent to another server in order to ultimately arrive at the correct (authoritative) name server. The authoritative name server provides the IP address for the subdomain www of the domain yourdomainname.nl. First the query for 'nl' is answered by the 'root servers' which know how to reach every computer connected to the internet. These root servers then point to the name server of the SIDN, the organisation that manages the top level domain '.nl'. The SIDN name server then receives the request for 'yourdomainname'.
SIDN subsequently looks in its registration database to see which name servers are associated with 'yourdomainname'. At this point, the SIDN returns the IP address of one of these name servers.
Once the IP addresses of the name servers are known, the query is routed to one of them, and it returns the answer to the following question: What is the IP address of the subdomain 'www' of domain name 'yourdomainname.nl'? The service can then be reached at this IP address.
Name server names
It is also possible, that instead of the name server immediately returning an IP address, the name of another name server, such as ns1.yourotherdomainname.nl, will be returned. This other name server may then point to the ultimate location of the service. The advantage of this is that all the domain names can point to ns1.yourotherdomainname.nl and the IP addresses of the service only have to be managed there.
In that case, the process explained above will be repeated in order to ultimately obtain the IP address of the name server.
DNS Caches and TTL
To reduce internet traffic by eliminating a huge number of lookup queries, various types of DNS caches have been established. A cache retains DNS data so it does not have to be looked up every time.
In broad lines, the caches are kept at two levels: on the computer you are using and at the Internet Service Providers (ISPs) that provide users with their connection to the internet.
The TTL (Time to Live) of a DNS record determines when a cache must refresh its DNS records by requesting them from the authoritative name server. Imagine a situation in which a query for www.yourdomainname.nl passes through an ISP and this query is not yet stored in the cache; the query is then sent to the DNS server and the answer is sent back to the requester. In addition, the answer is saved in the ISP's cache so it won't be necessary to send the request to the DNS server again when there is another request for the same domain name.
Every record for a domain name (www, mail, etc.) has a TTL field which is used to decide when the domain should be eliminated from the cache; thereafter, new requests will once again be sent to the DNS server. If the TTL is low, queries to refresh the cache will have to be performed more often, but changes to a domain name's addresses will reach the requester more quickly. The latter is of importance when a website is moved to a different IP address.