Skip to content

walkerus/wsl-ip-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

About

Each time you reboot the system or restart WSL, the subsystem changes the ip address. This script will help you resolve the WSL address. (Actual for Windows 10 Version 10.0.19041 Build 19041)

Install

sudo wget https://raw.githubusercontent.com/walkerus/wsl-ip-resolver/master/wsl-ip-resolver -P /usr/bin
sudo chmod +x /usr/bin/wsl-ip-resolver

Add permissions in windows to file C:\windows\system32\drivers\etc\hosts for wsl programm or all restricted application packages

Usage

//get wsl ip for host
wsl-ip-resolver --wsl

//get host ip for wsl
wsl-ip-resolver --win

//update C:\Windows\System32\drivers\etc\hosts
wsl-ip-resolver --resolve

After resolving, the subsystem can be accessed by dns as wsl. Example http://wsl

Add to crontab for automatic resolving @reboot wsl-ip-resolver --resolve

About

Bash script for resolve WSL ip in Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages