Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Dns and another server ?
So the domain name gets linked with the Ip adress. But what happens afterwards ? Next to the DNS, you can see another server looking like a black barrel. What is this one for ?
Jessica Murillo9,119 Points
I found this. It might answer your question I hope: Domain Name Servers (DNS) are the Internet's equivalent of a phone book. They maintain a directory of domain names and translate them to Internet Protocol (IP) addresses. This is necessary because, although domain names are easy for people to remember, computers or machines, access websites based on IP addresses.
So I think if you use the phone book example, you (the computer) would to go through each phone book(DNS) to look for the person's name (Domain Name) with the phone number (IP address) that you (the computer) is looking for.
That is how I understood it. I hope that it is right.
Ryan Ruscett23,309 Points
I will try and answer this for you the best I can. Let's start with this example. This is trivial since the internet doesn't just use DNS, there are routers, overlay networking etc. But let's keep it simple.
In my browser, I type www.purple.com. This address has no IP at the current moment. It's just a name. My computer says, "Ok I need to figure out where this is". Let me send it to DNS. DNS is a server that has a set of records. Think of it like this.
My computer sends the www.purple.com request to the DNS server, which is another computer. That computer says, "AHHH ok, www.purple.com, here is the address. Got it. Now I have to send it to that address:..
I believe the question you are asking is what happens now? Well, this is what happens.
An IP address is broken into chunks we'll call it for simplicity. The first thing the DNS server does is send it to a router. The router looks at the ip much like a DNS does. The router has similar records.
- Record A 126.96.36.199/24 --- > Go to this server/router "ServerTeam1"
- Record B 192.0.0.0/24 ---- > Go to this server/router "ServerTeam2"
The above is CIDR notation. All it's saying is that record no matter what IP address you have. If it starts with 185 or 192, it's going to send it along to the proper server/router.
So now what?
It does it again. Since we are going to www.purple.com with an ip address we got from DNS of 192.168.14.01, My request was sent to a router. The router said no matter what the IP address is, as long as it starts with 192. Which purple.com does. We continue on down the path to ServerTeam1. ServerTeam 1 has records too.
- Record A 192.168.0.0/16 ----> Go to TeamServer3
- Record B 188.8.131.52/16 ----> Go to TeamServer4
- Record C 184.108.40.206/16 ----> Go to TeamServer5
The ServerTeam1 has a set of records, Our IP we know is 192.168.14.01 So I know by looking at the records, I want to go to TeamServer3. TeamServer 3 will get this request and filter it again and again until it gets to it's destination.
Things to keep in mind.
It doesn't actually always break the ip down into 4 sections like I have done here. Sometimes it breaks it up into many more or sometimes many less hops. A hop being each time the request hits a router to get to it's locations.
Once the IP get's to it's location, this information is cached, which means that each request already knows exactly how to get to the server. This is basis off which overlay networks and SDN's function. But that is wayyy outside the scope treehouse.
Let me know if this helps you better understand or if it just confuses you more.
HELDER SILVA1,517 Points
It just translates. It translates a humanly-meaningful, text-based identifier to a system-internal, numeric identification IPv4 or IPv6. After it gets its numeric name it will then proceed to find its server where the website data is.
correct if I am wrong.