• theparadox@lemmy.world
    link
    fedilink
    English
    arrow-up
    19
    ·
    1 天前

    This is a question that might require a bit of “prior knowledge” in order for an answer to make sense.

    Basically computers keep track of each other with complicated, unique numbers. This isn’t easy for humans to deal with so instead we have websites like netflix.com. DNS is a system that translates “netflix.com” to it’s more complicated unique computer address so that your computer connects to the netflix server when you type in that web address.

    There are a number of servers (DNS Servers) on the Internet with databases that keep track of which website has what computer address. Usually, the company (ISP or Internet Service Provider) that you get Internet from has their own DNS Server and tells your modem to tell your computer or phone to use that server to look things up when you browse the web, but it is possible to use alternative servers.

    Technically, the system is very trust-based - it’s just assumed that they are going to respond accurately and in good faith. It is possible to mess with this but there are other layers of security and authorities your computer should be using to make sure that you are actually visiting the website you think you are visiting. Usually ISPs just use this server to keep track of the websites you visit so they can sell your data to advertisers.

    • towerful@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      1 天前

      I’ll add that it works on a system of delegation.
      So there are authoritative servers (which own a part of a domain) which can then have actual records or delegate to other authoritative servers.

      So the authoritative server for “com” (yes, as in .com, com is technically a valid domain name) will delegate google.com to a DNS server (likely one owned by Google). And then Google will have DNS records for mail.google.com and so on.

      So looking up mail.google.com, technically you ask com DNS for the mail.google.com. It won’t have an actual record, but will essentially say “go talk to this DNS server to get google.com records”. So your computer asks this new DNS server for mail.google.com and it might have an answer, or it might have delegated the mail.google.com somewhere else.

      What your computer most likely is using, however, is a recursive DNS service. You ask it for mail.google.com and it will “walk the tree” to finally return the IP address.
      And then it will cache the results (for com google.com and mail.google.com) so the next queries are significantly faster.