<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PowerShell &amp; Automation - ElMajdal.net</title>
	<atom:link href="https://www.elmajdal.net/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.elmajdal.net</link>
	<description>Your go-to resource for Windows Tutorials, tips and tricks</description>
	<lastBuildDate>Thu, 15 Oct 2026 16:56:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://www.elmajdal.net/wp-content/uploads/2023/11/favicon.png</url>
	<title>PowerShell &amp; Automation - ElMajdal.net</title>
	<link>https://www.elmajdal.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Flush DNS Cache in Windows 11 (Command Prompt and PowerShell)</title>
		<link>https://www.elmajdal.net/win11/flush-dns-cache-windows-11-command-prompt-powershell/</link>
		
		<dc:creator><![CDATA[Tarek]]></dc:creator>
		<pubDate>Thu, 15 Oct 2026 16:56:16 +0000</pubDate>
				<category><![CDATA[PowerShell & Automation]]></category>
		<category><![CDATA[Windows 11]]></category>
		<guid isPermaLink="false">https://www.elmajdal.net/uncategorized/flush-dns-cache-windows-11-command-prompt-powershell/</guid>

					<description><![CDATA[<p>Learn how to clear the DNS cache in Windows 11 using ipconfig and PowerShell, check DNS resolution, and troubleshoot persistent website errors safely.</p>
<p>The post <a href="https://www.elmajdal.net/win11/flush-dns-cache-windows-11-command-prompt-powershell/">How to Flush DNS Cache in Windows 11 (Command Prompt and PowerShell)</a> first appeared on <a href="https://www.elmajdal.net">ElMajdal.net</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>When a website opens on one device but fails on your Windows 11 PC, outdated DNS information may be part of the problem. Windows temporarily saves DNS lookup results to speed up future connections. Clearing that cache forces Windows to request fresh records on the next lookup.</p>
<p>In this guide, you will learn how to inspect, clear, and test the DNS cache in Windows 11 using Command Prompt and PowerShell, and what to do if flushing DNS does not fix the issue.</p>
<h2>What is the DNS cache?</h2>
<p>DNS (Domain Name System) translates website names into IP addresses. The Windows DNS Client caches some lookup results, including negative responses. This is useful for performance, but cached records can sometimes be outdated after a website or network changes. Flushing the cache removes those saved DNS-client records; it does <strong>not</strong> delete files, browser history, passwords, or change the DNS server configuration.</p>
<h2>Method 1: Flush DNS with Command Prompt</h2>
<ol>
<li>Open the <strong>Start</strong> menu, type <strong>Command Prompt</strong>, and select <strong>Run as administrator</strong>. Approve the User Account Control prompt.</li>
<li>Enter the following command:</li>
</ol>
<pre><code>ipconfig /flushdns</code></pre>
<p>Windows should respond with <em>Successfully flushed the DNS Resolver Cache.</em> This confirms the cache-clearing command completed, not that the underlying internet problem is fixed.</p>
<h3>Check the existing cache before clearing it</h3>
<p>If you want to see entries first, open Command Prompt and run:</p>
<pre><code>ipconfig /displaydns</code></pre>
<p>The list may be long. You can also export it for review:</p>
<pre><code>ipconfig /displaydns &gt; "%USERPROFILE%\Desktop\dns-cache.txt"</code></pre>
<p>This example writes a local text file containing cached DNS data to your desktop. Avoid publicly sharing the exported file because it can reveal domains accessed by applications.</p>
<h2>Method 2: Clear DNS cache using PowerShell</h2>
<ol>
<li>Right-click the Start button and open <strong>Terminal (Admin)</strong> or <strong>Windows PowerShell (Admin)</strong>.</li>
<li>In a PowerShell tab, enter:</li>
</ol>
<pre><code>Clear-DnsClientCache</code></pre>
<p>The command typically finishes without displaying a success message. To inspect the client cache before or after clearing, use:</p>
<pre><code>Get-DnsClientCache</code></pre>
<p>A small or empty list immediately after clearing can be normal; entries return as Windows and applications perform new lookups. If <code>Clear-DnsClientCache</code> is not recognized, make sure you are in a Windows PowerShell environment with the DnsClient module rather than another shell.</p>
<h2>Method 3: Check whether DNS resolution works</h2>
<p>After clearing the cache, test resolution independently of your browser. Open Terminal and run:</p>
<pre><code>nslookup www.microsoft.com</code></pre>
<p>Look for an address in the response. <code>nslookup</code> queries a DNS server and is useful for testing DNS resolution, but it does not prove every website connection will work. You can also use PowerShell:</p>
<pre><code>Resolve-DnsName www.microsoft.com</code></pre>
<p>To compare your PC&#8217;s default DNS behavior with a chosen public resolver, you can optionally run:</p>
<pre><code>nslookup www.microsoft.com 1.1.1.1</code></pre>
<p><strong>Privacy note:</strong> That final test sends a DNS query to Cloudflare&#8217;s public resolver. On a workplace network, follow your organization&#8217;s policy and use its approved DNS servers instead.</p>
<h2>What if flushing DNS does not solve the problem?</h2>
<h3>1. Confirm you have a working connection</h3>
<p>Check the Wi-Fi or Ethernet icon and try a few unrelated websites. If none work, investigate connectivity before focusing on DNS. See our related guide: <a href="https://www.elmajdal.net/win11/windows-11-wifi-connected-no-internet-fixes/">Windows 11 Wi-Fi Connected but No Internet? 9 Fixes to Try</a>.</p>
<h3>2. Inspect the configured DNS servers</h3>
<p>In PowerShell, run:</p>
<pre><code>Get-DnsClientServerAddress -AddressFamily IPv4</code></pre>
<p>The output lists the DNS servers configured on each network interface. Corporate PCs may use internal DNS servers to resolve Active Directory resources, so do not replace them with public addresses without approval.</p>
<h3>3. Consider browser DNS caches</h3>
<p>Some browsers and applications cache lookups independently or use secure DNS. Close and reopen the affected browser, then retry. If an issue occurs only in one browser, check its secure-DNS settings and extensions before changing Windows network settings.</p>
<h3>4. Check VPN, security software, and the hosts file</h3>
<p>A VPN, filtering application, proxy, or custom hosts-file entry can influence name resolution. On managed devices, speak with IT before modifying these settings. Flushing the Windows cache will not override a hosts-file mapping or repair a broken DNS server.</p>
<h3>5. Restart the computer if necessary</h3>
<p>A restart can help when a program is holding outdated connection state. Avoid resetting the full network stack as a first step: those changes are broader than flushing DNS and can disrupt VPN or enterprise settings.</p>
<h2>Frequently asked questions</h2>
<h3>Is flushing DNS safe?</h3>
<p>Yes, in normal circumstances. It discards cached DNS-client results and allows fresh lookups. The next visit to a domain may require an additional DNS query.</p>
<h3>Does clearing DNS make internet faster?</h3>
<p>Not generally. DNS caching normally improves performance. Flushing is a targeted troubleshooting step for stale or problematic records, not a general speed optimization.</p>
<h3>Do I need to change my DNS servers?</h3>
<p>No. Clearing the cache and changing which DNS server your computer uses are different actions. Try diagnosing the existing DNS service first.</p>
<h2>Quick reference</h2>
<table>
<thead>
<tr>
<th>Task</th>
<th>Command</th>
</tr>
</thead>
<tbody>
<tr>
<td>Flush Windows DNS cache</td>
<td><code>ipconfig /flushdns</code></td>
</tr>
<tr>
<td>View DNS cache</td>
<td><code>ipconfig /displaydns</code></td>
</tr>
<tr>
<td>Clear cache in PowerShell</td>
<td><code>Clear-DnsClientCache</code></td>
</tr>
<tr>
<td>Inspect cache in PowerShell</td>
<td><code>Get-DnsClientCache</code></td>
</tr>
<tr>
<td>Test name resolution</td>
<td><code>Resolve-DnsName www.microsoft.com</code></td>
</tr>
</tbody>
</table>
<p><strong>Further reading:</strong> <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig">Microsoft: ipconfig</a>, <a href="https://learn.microsoft.com/en-us/powershell/module/dnsclient/clear-dnsclientcache">Microsoft: Clear-DnsClientCache</a>, and <a href="https://learn.microsoft.com/en-us/powershell/module/dnsclient/get-dnsclientcache">Microsoft: Get-DnsClientCache</a>.</p>
<p><small>Featured image credit: <a href="https://unsplash.com/@albertstoynov">Albert Stoynov / Unsplash</a>. The image illustrates network infrastructure; command examples above are text for accurate copying rather than simulated screenshots.</small></p><p>The post <a href="https://www.elmajdal.net/win11/flush-dns-cache-windows-11-command-prompt-powershell/">How to Flush DNS Cache in Windows 11 (Command Prompt and PowerShell)</a> first appeared on <a href="https://www.elmajdal.net">ElMajdal.net</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
