How to Create SSH Hostname without /etc/hosts

The file /etc/hosts in WSL is always overwritten by the contents from Windows every time when WSL start. Changes applied to it will be removed.

If using with SSH, a short hostname can be created in ~/.ssh/config file.
For example, use server1 instead of server1.mycompany.com:

Add to ~/.ssh/config file:

Host server1
    HostName server1.mycompany.com

You'll only receive email when they publish something new.

More from 19411
All posts