You may often hear the term DNS. Well, in this article we want to discuss DNS and how to flush DNS so that you are not directed to malicious websites that contain malware and viruses. Before we begin, let’s first discuss what DNS is.
Definition of DNS
DNS stands for Domain Name System. They act as contacts on the Internet. So when someone accesses information online through a domain like Bloggerconcept.com or Technadvice.com. Meanwhile, the web browser searches for a website through an IP address.
DNS is what helps translate domain names to IP Addresses so that browsers can search and find the website. Each device is connected to the internet with a unique IP address. This is what is mostly used to find the device. DNS helps humans so we do not need to remember IP Addresses that can be considered difficult to remember.
DNS cache to speed up a website loading
You must be familiar with the word cache. Basically, the cache is an activity where data from previous requests is reused with the aim of speeding up the request in the future.
As explained earlier, when you enter a URL such as Bloggerconcept.com the browser will then ask your router for an IP address. Routers have a DNS server so they can ask DNS what the IP Address is from that URL. Because the DNS server can find Bloggerconcept’s IP address, the browser can then present the page you are looking for.
This process happens every time you want to access a website. Now, with DNS Cache, this process can be faster.
How DNS Cache works
Before the browser issues its request to an outside network, the computer will bypass each other and search for domain names in the DNS cache database. The database contains a list of all domain names that were recently accessed and the address that was calculated by DNS for them when the request was first made.
Following is an example of a DNS record:
docs.google.com
————————————-
Record Name. . . . . : docs.google.com
Record Type. . . . . : 1
Time to Live. . . . : 21
Data Length. . . . . : 4
Section. . . . . . . : Answer
A (Host) Record. . . : 172,217.6,174
For DNS, A record is part of the DNS entry that contains the IP address for the given hostname. Now, what is stored by the DNS cache is this address, the name of the requested website, and some parameters of the DNS host entry.
Sometimes, the DNS cache can experience a problem called DNS poisoning. What is that? A DNS cache can be poisoned or polluted if an unauthorized domain name or IP address is entered.
Caches can be damaged due to technical problems, but DNS poisoning is usually associated with computer viruses or attacks from other networks that enter invalid DNS entries in the cache. If DNS poisoning occurs, the browser will usually send users to the wrong page, usually malicious websites or pages full of ads.
For example, if the docs.google.com record has a different A record, then when you enter docs.google.com in your browser, you will be taken to another page. This, of course, can cause big problems for popular websites. If you want to access the Gmail website but instead are taken to a website similar to Gmail, you could be hit by a phishing attack.
Then how to overcome this if this happens? You have to flush the DNS.
Flush DNS to clear DNS Cache
To overcome DNS cache poisoning or other internet problems, users might want to flush, that is, delete, reset, or delete, cache DNS.
Because clearing the DNS cache erases all entries, invalid records will also be deleted and force your computer to re-record the pages of the website that you access. This new address will be taken from the DNS server that has been provided for your network.
So if we go back to using the example above, if your Gmail.com record is poisoned and redirects you to a strange website, flushing the DNS is a good first step so that you are directed back to the correct Gmail website.
A router can have a DNS cache too. That is why rebooting the router can also help solve the problem. For the same reason you might flush the DNS cache on your computer, you can reboot your router to delete DNS entries stored in temporary memory.
If you want to know how to flush your DNS, let’s continue reading this article.
How to Flush DNS on Windows
The following is how to flush DNS on Windows:
Flush DNS on Windows 7 or earlier
- Click the Start Menu
- Select All Programs
- Select Accessories and right-click Command Prompt
- Select Run as Administrator
- After that, enter the command line below and press Enter
ipconfig / flushdns
Flush DNS on Windows 8
- Press Windows Key or hover your mouse to the bottom left and click the Windows Icon.
- Type Command Prompt
- Right-click the application and select Run as Administrator
- Enter the command line below and press Enter
ipconfig / flushdns
How to Flush DNS on Mac
Following is how to flush DNS on Mac:
- Open a terminal from Utilities
- Enter the command line below depending on your version of macOS
Sierra : sudo killall -HUP mDNSResponder
El Capitan : sudo killall -HUP mDNSResponder
Yosemite : sudo discoveryutil udnsflushcaches
Mavericks : sudo killall -HUP mDNSResponder
Mountain Lion : sudo killall -HUP mDNSResponder
Lion : sudo killall -HUP mDNSResponder
Snow Leopard : sudo dscacheutil –flushcache
Older versions : sudo lookup –flushcache
After that pressing Return and your DNS will reset
Read More: How to Overcome 10 Common Problems Of WordPress
How to Flush DNS on Linux
For those of you who use Linux, here is how to flush DNS on Linux
- Open your terminal
- Enter the following command line:
sudo /etc/init.d/nscd restart
or
sudo /etc/init.d/nscd restart
For those of you who use Ubuntu, here is the command line to flush your DNS
sudo service network-manager restarts
Conclusion
In this article, we have already discussed the DNS flush and how to do it. Flush DNS is indeed important to do to maintain the security of your computer in accessing websites. You certainly do not want to get hit by phishing or other types of malware.