Search notes:

%SYSTEMROOT%\System32\drivers\etc\hosts

The hosts file allows to map IP addresses to a host name. This host name can then be used in lieu of an IP address where an IP address is expected, for example in PING.EXE.
The values in a host file are especially useful to give a server a name if the server is not known by the DNS server. On the other hand, this method breaks if the server's address changes and the host file is not updated.
The format of the hosts file is IP-number followed by a host name.
Comments can be be started with the # symbol.
#
#  Test server
#
192.168.110.11 omega
With such an entry, the server can be contacted like so
C:\> ping omega

Pinging omega [192.168.110.11] with 32 bytes of data:
Reply from 192.168.110.11: bytes=32 time<1ms TTL=128
…
If the mapped server is a web server, the web server can then be reached with the URL https://omega/

Windows Subsystem for Linux

In WSL, /etc/hosts inherits the entries from the Windows hosts file.

See also

/etc/hosts

Index