What is DNS?

in #aceh7 years ago

suppose I were to get into a taxi after a night on the town and tell the driver John's house when he asked me where we're headed, unless the driver somehow very creepily already knows where I live he'll probably tell me to stop being an idiot and give him an actual address where he can actually drop me off, and although that scenario has probably occurred in plenty of taxi cabs where drivers have had to deal with people that ran up way too high of a bar tab that night, your computer or phone can have a much easier time figuring out where to take you on the internet thanks to the domain name system commonly referred to as DNS.

dns.png
Source : Google Images

you see even though most of us get to our favorite websites by punching in addresses like youtube.com or steemit.com your browser actually needs to know the IP address of the site you're trying to access, so to do this it sends a request to the DNS which is sort of like the Internet's version of the Yellow Pages that matches a site URL or a Uniform Resource locator to an IP address, so the DNS request first goes to a recursive name server which is typically operated by your internet service provider but you can also use public servers managed by Google or other organizations.

dns-normal-en.png
Source : Google Images

if your ISP resolver is having issues, a recursive name server might have the IP address of the website you want to access already stored but if it doesn't,it will go to one of thirteen root servers which manage requests for top-level domains like .com or .org although that seems like a tiny number of servers, by the way they actually use redundant physical Hardware all over the globe to make sure these requests are handled quickly, your request is then sent to the appropriate top level domain server, .com if you're trying to get to YouTube for example, which will then contact authoritative name servers that contain a authoritative list of IP addresses and matching URLs which is updated whenever someone buys and registers a domain.
once the IP address you want is retrieved it's sent back to the recursive name server and then on to your computer to save time in the future and make things more efficient, both the recursive name server and your own computer will cache DNS entries for a while, so the next time you want to visit YouTube you won't have to go through this whole rigmarole instead your computer will either know the correct IP right away or it will be able to get it directly from the recursive server DNS, usually works fairly well for most people, but if a website changes IP addresses this can cause problems especially if your computer is trying to use its own cache, this will usually manifest as lots of random 404 errors or taxi drivers taking you to the wrong place if we were to go back to our original analogy, so if you're running Windows it's actually pretty easy to clear out your DNS cache just by opening the command prompt as an administrator and entering the command ipconfig/flushdns which hopefully will fix the problem, however you could run into more serious problems if a piece of malware has poisoned your DNS cache by making DNS entries that are stored locally that point to malicious websites, for example an attacker could tell your PC to make irs.gov point to the IP address of a website running a tack scan that tries to convince you to give up your personal information, so if you're getting weird redirects like this running a reputable anti-malware application may be able to help but despite its vulnerabilities DNS has made the Internet extremely easy to use for many people because thanks to it we don't have to punch in numerical IP addresses like phone numbers except longer every time we want to surf the web and given how hard it is for people to remember phone numbers.