computer Networks/Ipconfig/DNS Cache Options

From Wikiversity
Jump to navigation Jump to search

ipconfig /displaydns displays the contents of the Domain Name System (DNS) resolver cache. ipconfig /flushdns purges the DNS resolver cache. These activities will show you how to use ipconfig /displaydns and ipconfig /flushdns.

Readings[edit]

Preparation[edit]

To prepare for this activity:

  1. Start Windows.
  2. Log in if necessary.

Activity 1 - View the hosts File[edit]

Host name to IP address resolution on Windows is a combination of the contents of the hosts file and the records returned from the specified DNS server(s) in response to DNS queries, with the hosts file being queried first. To understand the entries you will see in the DNS resolver cache, you should first examine the contents of the hosts file.

  1. View the hosts file.

Activity 2 - View DNS Server Settings[edit]

To display DNS server settings:

  1. Open a command prompt.
  2. Use ipconfig /all to display all IP configuration information.
  3. Observe the DNS Servers settings. The DNS servers are queried for any name that has to be resolved into an IP address that does not exist in the hosts file. Common examples include server names for URLs typed into an Internet browser. The DNS resolver cache will contain a history of names that have been resolved recently.

Activity 3 - Display the Contents of the DNS Resolver Cache[edit]

To display the contents of the DNS resolver cache:

  1. Type ipconfig /displaydns and press Enter.
  2. Observe the contents of the DNS resolver cache. It is generally not necessary to view the contents of the DNS resolver cache, but this activity may be performed as a name resolution troubleshooting method.

Activity 4 - Purge the DNS Resolver Cache[edit]

To purge the DNS resolver cache:

  1. Type ipconfig /flushdns and press Enter.
  2. Type ipconfig /displaydns and press Enter to observe the contents of the DNS resolver cache and verify that it has been purged. It may be necessary to purge the DNS resolver cache when updating records on a corporate DNS server or adjusting incorrect proxy server settings.
    Note: After purging, the DNS resolver cache will still have records for any entry in the hosts file.
  3. Close the command prompt to complete this activity.

See Also[edit]

Internet Protocol Analysis - Name Resolution

References[edit]