Table of Contents
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
- Open PowerShell as administrator or you can run this command on standart PowerShell:
Start-Process powershell -Verb runAs
- Flush DNS:
Check DNS:
ipconfig /flushdns
ipconfig /displaydns
- Shutdown WSL:
And try to run the container and
wsl.exe --shutdown
curl
onping
inside the container.
Reference
https://www.ask-sheldon.com/flush-dns-cache-for-powershell-and-wsl/