GuidoV

Changing WSL Hostname

https://www.reddit.com/r/bashonubuntuonwindows/comments/q7mox0/is_changing_the_hostname_on_wsl_still_discouraged/?captcha=1

I have followed the instructions here to change the hostname of the Ubuntu instance and it seems to work okay.

Basically:

  1. Add following lines in /etc/wsl.conf.

[network]
hostname = generateHosts = false

  1. Update /etc/hosts, replace all old occurrences of with

  2. Restart Ubuntu