Name Servers
Computers don't really find websites by reading their name directly, but by associating the website's name to an IP address located in a Name Server. This is because humans have an easier time remembering www.example.com, than 209.126.190.104, which is the IP address of that domain.
Top level domains are the words you see after the last "dot", for example, in "www.example.com", the top level domain would be ".com", and it's name would be "example". You can only have one of the same domain name on a tope level domain, but you can have the same domain name on a different top level domain, for example, "www.example.org". In this case, you would have the same name "example", but it would be on a different top level, ".org", which would basically be a completely different computer.
But what about the first part? The part at the beginning, BEFORE The first "dot"? In this case, "www" would be the host name, which actually specifies the computer where' you're connecting. This one also needs to be completely unique. So you could have "examplex", "exampley", "examplez" on the same "com" top level domain, and each one would be a completely different machine, whithin that domain.
Each one of these domains, x through z, are registered with network solutions, where they are saved in the global DNS database, which is administered by companies all over the world.
The basic function of a Name Server is to accept requests from applications and other name servers to turn a domain name into an IP address. Each time one of these requests comes in, the name server looks for an IP match for that domain name. If it finds it, it sends the result back. If it does not know the IP, it contacts another name server that probably knows it. If it still can't find it, it gives you an error message.
You need to tell your computer the name server that it's going to be using for this operation. You can configure it manually, or you can let your ISP do it for you. Once your computer knows which name server it's going to be using, when you type a name on your browser, this last one will contact the configured name server and ask the name server to convert the name you just typed into an IP address.
The first thing name servers do to search for IP addresses, is contact the root name servers, these are distributed all over the world and every name server has a list of them. The root name servers know all the top level domain name servers' IP addresses
So what happens is that your name server calls the root name servers on the order which they appear on it's list. Each of these root servers have the IP addresses of the servers that have the top level domains (.com, .org., .net, etc), to narrow down the search to just that top level domain. Then the root server gives your name server the IP of the top level domain servers, so it can look for example.com within them.
Once your name server has the top level domain addresses, it searches for the one that has "example.com" and asks it for the IP address of that domain. This top level domain looks in it's lists and gives the domain name's IP address to your name server, your name server gives it to your browser, and your browser displays the webpage.
When all of this happens, your name servers keep a "history" of the most recent requests, so that next time you ask it for domainx.com, it knows the answer without having to go go to the root and top level domain servers. This is kown as "caching" and it makes it work faster.
There are a lot of name servers all over the world, and many of them have the same IP address information for a specific domain name, so that if one of them goes down, the rest of the name servers can still resolve the IP address for that domain name. Even though this information is stored all over the world and updated by individual companies that take care of updating specific parts of it, it functions as one big database.
Think of it as a big painting, or mural. Someone might be tasked with filling in the parts of the painting that need blue, while someone else might paint only the green parts. In the end though, the mural creates one whole image that everyone understands.