Differences between revisions 5 and 6
Revision 5 as of 2023-06-22 19:44:56
Size: 1220
Comment:
Revision 6 as of 2023-06-22 20:17:13
Size: 1237
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
A description of the '''hosts''' file (`/etc/hosts`). For more details, see `hosts(5)`. A '''`hosts(8)` file''', typically found at `/etc/hosts`, provides [[Protocols/IP|IP addresses]] for domain names.
Line 13: Line 13:

A template hosts file, with interleaved explanations:
Line 40: Line 38:
The hosts file is structured as:
Line 49: Line 45:
----



== See also ==

[[https://man.archlinux.org/man/hosts.5|hosts(5)]]

Hosts

A hosts(8) file, typically found at /etc/hosts, provides IP addresses for domain names.


Example

# IPv4 loopback address
127.0.0.1 localhost.localdomain localhost
# Local hostname resolution. Can otherwise be provided by `myhostname` plugin (see above).
127.0.1.1 <MYHOSTNAME>

# IPv6 loopback address.
::1 ip6-localhost ip6-loopback
# Reserved, as with IPv4 Class E address space (see `https://en.wikipedia.org/wiki/Classful_network#Classful_addressing_definition`).
fe00::0 ip6-localnet
# The Link-local scope, as with `224.0.0.1` in IPv4.
ff02::1 ip6-allnodes
# All routers in the Link-local scope, as with `224.0.0.2` in IPv4.
ff02::2 ip5-allrouters
# Historically all hosts in the Link-local scope, now unassigned.
ff02::3 ip6-allhosts


Syntax

# comment
address name alias[es]

Each address should be listed once. Duplicated lines will be disregarded at best. Aliases should be used sparingly, as to make a local host available with and without specifying the domain.


See also

hosts(5)


CategoryRicottone

Linux/Hosts (last edited 2023-06-22 20:17:13 by DominicRicottone)