View all saved DNS entries in Windows

The Windows operating system uses a cache for DNS entries. DNS (Domain Name System) is a basic internet technology used to resolve IP addresses based on domain names.

powershell dns cache

When users type a domain in the browser (eg iguru.gr), one of the first tasks performed when loading the website is to look up its IP address. The process requires access to DNS servers, that is, to hosts that have huge databases with IP-name mappings.

Your ISP's DNS servers are often used on the Internet, but any user can change and request that the ips be resolved on other DNS servers as they may be faster or offer better privacy.

Switching DNS providers can also help to circumvent Internet prohibition or censorship if DNS is used to block access to certain sites.

Windows uses the DNS resolver cache to speed up lookups. Each DNS lookup is added to the so that if it is requested again it will find it ready and eventually speed up successive visits to the frequently visited domains. Sometimes the listings can be old and show the wrong IP address. Clearing the cache can help in such an erroneous situation, as it removes all cached items to start from scratch.

Display all saved DNS entries
The list of saved entries can be useful for several purposes. The and developers can check if a domain is assigned the correct IP address and users may be interested in seeing all entries, e.g. to find out which domains have been accessed during a session. Here's how to display this list:

Step 1: Open a command prompt. If you do not know how, then press Win + R at the same time and in the popup window that appears type cmd and press Enter.

step 2: In the command prompt window type ipconfig / displayDNS and then Enter to execute the command.

command prompt dns ipconfig

Windows returns all stored DNS entries in a long list. You can also redirect the output to a plain text file by running the command ipconfig /displayDNS > %USERPROFILE%\\dns.txt. This saves the list to the dns.txt file on your desktop.

The same command can also be executed using PowerShell:
1. Click Start, type PowerShell, and select it. If you have Terminal installed, enter Terminal and select it.
2. Execute the command powershell “Get-DnsClientCache | Format-Table -AutoSize ” .

The list here uses better formatting, such as the photo at the beginning of the article. You can redirect the list to a text file, also using the command:
powershell “Get-DnsClientCache | Format-Table -AutoSize ”>% USERPROFILE% \ Desktop \ DNS.txt.

Clear all saved DNS entries
To clear the DNS cache, execute the command ipconfig / flushdns.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.087 registrants.
flushdns, displaydns, ipconfig, dns, cache, command, prompt

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).