Table of Contents

<--   Back

Windows: Flush DNS PowerShell and WSL


Background

Sometime when you using VPN on Windows and run container like Docker or Podman, the DNS cache give some issue because still using the VPN DNS. Resulting your container can not access the internet.

To resolve this issue you need to flush the DNS cache.

Steps

  1. Open PowerShell as administrator or you can run this command on standart PowerShell:
    Start-Process powershell -Verb runAs
  2. Flush DNS:
    ipconfig  /flushdns
    Check DNS:
    ipconfig  /displaydns
  3. Shutdown WSL:
    wsl.exe --shutdown
    And try to run the container and curl on ping inside the container.

Reference

https://www.ask-sheldon.com/flush-dns-cache-for-powershell-and-wsl/


Open GitHub Discussions