• cobysev@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    22 hours ago

    Lot of good explanations here, but here’s another to help understand the basic idea of DNS. I’m gonna use a lot of technical explanations, but I’ll break it down into an ELI5 format for you.

    Computers communicate using computer jargon; codes and numbers and math, etc. that process data immediately. Computers do these calculations incredibly quickly, so they don’t need any fluff to get to the point.

    Humans, on the other hand, can’t process raw data like computers. We need contextual clues to help us understand and relay information. So we build in translations for everything our computers do, to help us understand the raw data that our computers are processing.

    Every website on the Internet is assigned an address, which computers use to locate them. Kind of like street addresses to find a person’s house. But this address is in computer code. In this case, we call it an IP address (Internet Protocol address). A string of numbers if you’re using the old standard IPv4, or a string of even longer letters and numbers if you’re using the new standard, IPv6.


    Mini-tangent: Why do we have two standards for IP addresses? Because the original version 4 standard was too limited. The IP address range was from 0.0.0.0 to 255.255.255.255, which allowed up to 4,294,967,296 unique addresses. But with the boom of the Internet age in the past 3 decades, we quickly used up all those addresses and couldn’t make any more without seriously disrupting the way computers process IP addresses.

    So we added a hexadecimal version 6 IP address scheme that allows for up to 340,282,366,920,938,463,463,374,607,431,768,211,456 (2128) unique IP addresses. Those addresses are written from 0000.0000.0000.0000.0000.0000.0000.0000 to FFFF.FFFF.FFFF.FFFF.FFFF.FFFF.FFFF.FFFF. (Hexadecimal counts from 0-9, then A-F before starting over at 0, so base-16 counting (0-F) instead of our standard base-10 counting (0-9)). I highly doubt we’ll ever run out of addresses with this new standard.


    So our computers use IP addresses to find a website, but how are humans going to remember that? If I wanted to go to Google, I could type 64.233.170.139 into the address bar and find Google, but who’s gonna remember that string of numbers? And that’s only one website. Imagine all the other sites you browse every day. You gonna remember all those IP addresses? It’s gets even more difficult when you mix in IPv6 addresses. You’d have to remember 2404:6800:4003:c00::71 to find Google’s website! And most browsers don’t let you use IPv6 to connect directly to a website, so good luck getting there with only that string of numbers and letters.

    So DNS (Domain Name Service) is a program designed to translate IP addresses into domain names that make sense to the human brain. Instead of remembering the IP address for Google, I can just type google.com into the address bar and DNS knows to translate that domain into an IP address for the computer to find. Now I can remember a simple word or two to find a website! Much easier for our human brains to process, while still allowing for a specific and calculable IP address for computers to process and find an exact host.

    Why don’t we just tell computers to use domain names instead of IP addresses? Well, because computers operate on number operations, not words. Every word we program into a computer needs to be translated into math for the computer to process anyway. If computers just use domain names, they’ll still need to translate it into a number that it can process. Creating a DNS program allows you to set those calculations to the side and process them separately from the computers’ other functions.

    In large corporations, they usually build an entire DNS server just to process all the address translations that the business and its customers will be doing through the course of their daily operations. It puts that work on another machine entirely so you’re not slowing down your regular computers with additional processing power.

    Also… domain names might change. Say you buy twitter.com, but decide to rename it to x.com. It’s still the same website, with the same physical server location. But now with a different, simpler domain for people to remember. The IP address doesn’t change; computers still know exactly where to go to find the website. But now people have a different domain name they can type to find it. It makes it easier to rebrand your site on a whim without creating a whole new address for computers to find.

    You don’t need to ask your local town to give you a new street address simply because you tore down and rebuilt a house on your property; the address is still the same. You just have a new building for people to visit.