Etc-hosts-file

From aldeid
Jump to navigation Jump to search
You might also see: host and hostname

Description

This page describes /etc/hosts file. This file indicates a list of hosts on a network and enables to define aliasses. Most of the time, and especially in big networks, BIND is used instead of this file. Although, this file can be used for initializing a network.

Format

  • Each line must be formatted as follows:
IP_address     hostname     [alias_1,[alias_2,[alias_n]]]
  • Separator is one or more spaces/tabulations.
  • Each line beginning with # is a comment
  • A hostname can only contain alphanumeric characters, "-" and "." and must end with an alphanumerical character.

Example

# localhost definitions
127.0.0.1     localhost
127.0.1.1     aldlin1.aldeid.com     aldlin1

# The following lines are desirable for IPv6 capable hosts
::1           localhost ip6-localhost ip6-loopback
fe00::0       ip6-localnet
ff00::0       ip6-mcastprefix
ff02::1       ip6-allnodes
ff02::2       ip6-allrouters
ff02::3       ip6-allhosts