Summary
This article aims to explain what the Domain Name System or DNS is, how it functions and what role it plays in your hosting and internet usage.
Explanation
The internet as we know it is controlled by a system known as the Domain Name System or DNS, this system converts the simple, easy to remember domain names such as "cwcs-example.com" into the Internet Protocol Address (IP Address) assigned to the server where the website is running from. Therefore instead of having to enter in 10.0.1.123 to view a website we can simply enter "cwcs-example.com" which we can all agree is much easier to remember. DNS is used by yourself every time you visit a website, send an email, stream music or watch a video online, its the backbone of the internet and without it the internet would be very different to what we have today.
How DNS Works
When you enter a domain name in your browser a number of lookups are done to identify the final server that hosts that domains website. The initial lookup determines the name servers the domain currently uses, therefore if we entered in "cwcs-example.com" you are actually entering in "cwcs-example.com." without knowing. The "." at the end represents the root namespace, where the internet begins.
The first check your computer does is to check if they've visited the page before and kept the IP address previously returned in its DNS Cache, if it hasn't your computer asks the name server configured for your internet connection what the IP address is for "cwcs-example.com". This name server may or may not know the IP address for the domain name, if it doesn't it will know how to get to the root name servers, which are represented by the "." at the end of the domain.
The root name servers won't know the IP address for "cwcs-example.com" but it will know the name servers for ".com" and your lookup is then sent to the name servers for the ".com" to attempt to find the IP Address for "cwcs-example.com".
The lookup now asks the ".com" name servers for the IP address for "cwcs-example.com". This then returns the authoritative name servers for the domain name, these name servers are set with the domain registrar when the domain is purchased, and can generally be altered at a later date. We have an article on altering the name servers within CWCS which you can find here - CWCS Knowledgebase Domain Name - Change Name Servers. You can view the current authoritative name servers used by a domain name by doing a WHOIS lookup which will return the registration information, including its name servers, for the domain.
Once the lookup has reached the authoritative name servers for "cwcs-example.com" they will answer with the IP address it holds within its DNS Zone File for "cwcs-example.com". This gets provided to your browser which will then send a request to the IP address to view the website.