DNS explained!
The Domain Name System or DNS as it is more commonly known is undoubtedly one of the most important and underrated parts of the internet. Without DNS, the internet as we know it today will simply cease to exist. Most of us know that the internet is made of large groups of servers connected to each other via wires and that each server is identified by a unique number called IP addresses, but we cannot possibly remember the IPs for every website; it’s just way too hard remember all of them, so we use Domain names such as hostilica.com. When you enter a URL into your browser, it will first check if it has the IP address in the cache. If it doesn’t, it will send a request or query for the more tech-savvy of you to the DNS server (think of a phone book for the internet), which matches the URL to the IP address which operates the website.
But how does it work?
A DNS request is first sent to a recursive name server typically operated by your ISP. IF the recursive name server has the IP address you’re trying to visit already stored, it will forward the request to one of the root DNS servers, which are responsible for managing all the TLDs such as .com or .net. The root server then forwards your request to the appropriate TLD server, who will then contact an authoritative name server that contains a list of IP addresses and their matching URLs and is updated every time someone buys or registers a domain. Once the requested IP address is found, it is sent back to the recursive name server, which sends it back to you and both your computer and the recursive server will save that IP address for a while so that they don’t have to go through the same process each time you want to access that website.
Problems with DNS
DNS usually works very well; however, since computers and recursive servers will try to use their own cache, this can cause a problem, especially when websites change IP addresses.
DNS propagation:
When any information about the website servers change, this change needs to propagate through all the servers around the world which are involved in the DNS process, which can take up to 72 hours (typically a few hours in most cases) which might lead your website to be unavailable for users in different locations. You can check this article in order to learn more about DNS propagation.
Local computer cache:
As we mentioned above, the computer will cache a website IP and try to access a website through the saved IP address. This will cause a problem if the IP address for the server changes. However, it’s easily corrected by removing all IP addresses stored in the system, just fire up cmd in windows as an administrator and typing ipconfig/flushdns
DNS poisoning:
Every system has its vulnerability that hackers will try to use and DNS is no exception. Hackers use a technique called DNS poisoning where an attacker will change the DNS cache on your computer to point to malicious sites that look legit sites to try to steal sensitive information like passwords and credit card information.
Conclusion
The domain name system is the backbone that makes up the internet as we know it and without it we wouldn’t have the same easy experience we have to today when we access an online website or service.