What's
New
Doll
Makers
Room
Makers
Puzzle
Makers
Dress Up
Games
GirlSense - online dress up games for girls with fashion sense

Back to Reference Guides

HOSTS file for Linux


History behind the hosts file

During the 70s all the domain name to IP address was contained in a single file called the HOSTS.TXT file. A single for only a few hundred machines on the internet. Of course the load began to grow and eventually a different system supplanted it. The "/etc/hosts" file (without the txt) is now used primarily as a backup (or a cache) if the name servers are inaccessible.

The format of each entry is:
[internet address] [domain name] [alias]
127.0.0.1 www.elouai.com localhost
  • internet address - a standard IP address, i.e. 127.0.0.1
  • domain name - A Fully Qualified Domain Name, FQDN, i.e. www.elouai.com
  • alias - this field is optional, i.e. localhost
Proceeding an entry with a number sign '#' will comment it out.

There is a lookup order which can be changed in /etc/host.conf
The default order is hosts, bind:
  1. hosts - first the host file is checked (local cache)
  2. bind - if it does not find then it checks with the name servers
The line is formatted simply as:
order hosts,bind

/etc/hosts.deny

Describes the name of the hosts which are NOT allowed to use the local INET services. This file is called by "/usr/sbin/tcpd"

/etc/hosts.allow

Describes the name of the hosts which are ALLOWED to use local INET services. This file is called by "/usr/sbin/tcpd"


references:
Redhat Linux 8.0: Managing Hosts





About     Privacy Policy     Hosting by Web Hosting Canada

Except where otherwise noted, this site is licensed under a Creative Commons License



contact us: elouai@gmail.com
©2003-2008 eLouai.com, All rights reserved