From 9b65b4579ca21ec5fbf5942d76040817320b43bd Mon Sep 17 00:00:00 2001 From: Shriya Date: Tue, 2 Dec 2025 12:38:54 +0530 Subject: [PATCH] Correct hostname flags and command references in networking documentation. Updated the networking documentation to use the correct hostname flags and commands: - Replaced `hostname -i` with `hostname -I` - Updated `hostname --ip-addresses` to `hostname --all-ip-addresses` - Ensured command explanations align with actual Linux behavior These changes improve accuracy and prevent confusion for users querying IP addresses in WSL. --- WSL/networking.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WSL/networking.md b/WSL/networking.md index 278b50f3..4a35d835 100644 --- a/WSL/networking.md +++ b/WSL/networking.md @@ -20,12 +20,12 @@ There are two scenarios to consider when identifying the IP address used for a L The Windows host can use command: ```powershell -wsl.exe --distribution hostname -i +wsl.exe --distribution hostname -I ``` If querying the default distribution, this part of the command designating the distribution can be omitted: `-d `. Be sure to use a lower-case `-i` flag. -Under the hood, host command wsl.exe launches the target instance and executes Linux command `hostname --ip-addresses`. This command then prints the IP address of the WSL instance to `STDOUT`. The `STDOUT` text content is then relayed back to wsl.exe. Finally, wsl.exe displays that output to the command line. +Under the hood, host command wsl.exe launches the target instance and executes Linux command `hostname --all-ip-addresses`. This command then prints the IP address of the WSL instance to `STDOUT`. The `STDOUT` text content is then relayed back to wsl.exe. Finally, wsl.exe displays that output to the command line. A typical output might be: @@ -115,7 +115,7 @@ Using `listenaddress=0.0.0.0` will listen on all [IPv4 ports](https://stackoverf ## IPv6 access -- `wsl hostname -i` for the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) +- `wsl hostname -I` for the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) - `ip route show | grep -i default | awk '{ print $3}'` for the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM) Using `listenaddress=0.0.0.0` will listen on all [IPv4 ports](https://stackoverflow.com/questions/9987409/want-to-know-what-is-ipv4-and-ipv6#:~:text=The%20basic%20difference%20is%20the,whereas%20IPv6%20has%20128%20bits.).