How does the browser know which website to load when you type in the address?
There might be a bit more to it than you might expect, so lets explore the world of domains, DNS and name servers and hopefully by the end of it you will have a better understanding of how it all works.
As always with the "Basics" series, I will be glancing over some details and simplifying some processes for the sake of, hopefully, keeping things simpler and easier to understand.
You can think of a domain as like a "person". When you type in the name of the domain in your browser, the browser will find the location of the domain and transfer you to their location.
So if domains are like people, how does the browser actually know where they are?
This is where the DNS comes into play.
Domain Name System (DNS)
At the risk of sounding old, the DNS is like a "phonebook" for the domains. Like phonebooks, the DNS have all the addresses and information about any given domain within, and will tell you exactly where a domain's website/server is located (in this case IP address).
For example, when you type in "markeliasen.com" into your browser, the browser does not just know where a domain's website is located. So the browser will first need to check the "phonebook" (DNS) for the domain to find out where to send you to.
But just as in the real world, there are more than just one phonebook so how does the browser know which one to use?
This is where the name servers come into play. The name servers tells you exactly which phonebook you will find the details of any given domain. This is how the browser will know, of all the thousands or more DNS'es out there, which one specifically to look at to find the correct details for a given domain.
But that still leaves a question. How does the browser know the name servers of any given domain?
Domain Name Registrars
It's hard to talk about name servers without also talking about what a "domain name registrar" ("registrar") is.
A domain name registrar is a company that manages the reservation of Internet domain names - Wikipedia
For example, if you register a .com domain, the domain reservation is handled and managed by ICANN who is the governing entity for the .com top-level domain (among others); likewise if you were to register a .co.uk domain, it would be handled by Nominet.
This is where a domain's name servers will be registered to a domain.
Every DNS Resolver (likely the one on your router which are most likely handing your DNS lookups) has a directory where it can look up every top-level domain's registrar to get the name servers of each domain.
I hope this helps your better understand what domains, DNS'es and name servers are and how they work. Knowing this is important, especially if you are a web developer.
If there is anything you believe I didn't clarify properly or you would like me to elaborate on, just let me know!