Computer configuration file to map hostnames to IP addresses
The calculator file hosts is an engage system file that maps hostnames to IP addresses. It is a obviously text file. primitively a file named HOSTS.TXT was manually maintained and made available via file share by Stanford Research Institute for the ARPANET membership, containing the hostnames and address of hosts as contributed for inclusion by extremity organizations. The Domain Name System, first described in 1983 and implemented in 1984, [ 1 ] automated the publication procedure and provided instantaneous and dynamic hostname resolution in the quickly growing net. In modern operating systems, the hosts file remains an alternative name resolution mechanism, configurable often as partially of facilities such as the Name Service Switch as either the primary coil method or as a disengagement method acting .


The hosts file is one of respective arrangement facilities that assists in addressing network nodes in a calculator network. It is a common separate of an operate system ‘s Internet Protocol ( IP ) execution, and serves the function of translating human-friendly hostnames into numeral protocol addresses, called IP addresses, that identify and locate a host in an IP network. In some operate on systems, the contents of the hosts file is used preferentially to other name solution methods, such as the Domain Name System ( DNS ), but many systems follow through name service switches, for example, nsswitch.conf for Linux and Unix, to provide customization. Unlike remote control DNS resolvers, the hosts file is under the lineal control of the local anesthetic calculator ‘s administrator. [ 2 ]

File content.

The hosts file contains lines of textbook consist of an IP address in the beginning text field followed by one or more host names. Each field is separated by white space – tabs are much preferred for historical reasons, but spaces are besides used. Comment lines may be included ; they are indicated by an octothorpe ( # ) in the first place of such lines. entirely blank lines in the file are ignored. For example, a typical hosts file may contain the watch :  localhost loopback
::1        localhost

This model merely contains entries for the loopback addresses of the system and their horde names, a typical default option content of the hosts file. The case illustrates that an IP address may have multiple host names ( localhost and loopback ), and that a host name may be mapped to both IPv4 and IPv6 IP addresses, as shown on the first and second lines respectively .

placement in the file system.

The localization of the hosts file in the file organization hierarchy varies by operating arrangement. It is normally named hosts, without an extension .


The ARPANET, the predecessor of the Internet, had no distributed host name database. Each network node maintained its own map of the network nodes as needed and assigned them names that were memorable to the users of the system. There was no method for ensuring that all references to a given node in a network were using the same diagnose, nor was there a way to read the hosts file of another computer to automatically obtain a copy.

The belittled size of the ARPANET kept the administrative command processing overhead time small to maintain an accurate hosts file. Network nodes typically had one address and could have many names. As local area TCP/IP calculator networks gained popularity, however, the sustenance of hosts files became a larger effect on system administrators as networks and network nodes were being added to the system with increasing frequency. standardization efforts, such as the format specification of the file HOSTS.TXT in RFC 952, and distribution protocols, for example, the hostname server described in RFC 953, helped with these problems, but the centralize and monolithic nature of hosts files finally necessitated the creation of the stagger Domain name System ( DNS ). On some erstwhile systems a file named networks is award that is similar to a hosts file, containing names of networks. [ 11 ]

Extended applications.

In its serve of resolving host names, the hosts file may be used to define any hostname or domain name for practice in the local system .

Redirecting local domains
Some web service and intranet developers and administrators define locally defined domains in a LAN for various purposes, such as accessing the company’s internal resources or to test local websites in development.[12]
Internet resource blocking
Entries in the hosts file may be used to block online advertising, or the domains of known malicious resources and servers that contain spyware, adware, and other malware. This may be achieved by adding entries for those sites to redirect requests to another address that does not exist or to a harmless destination such as the local machine.[13] Commercial software applications may be used to populate the hosts file with entries of known undesirable Internet resources automatically. In addition, user-created hosts files which block nuisance servers are publicly available.[14][15]
Fravia described these files variously as “scrolls”, “precious”, and “powerful” in his anti-advertisement pages, where this usage of hosts was first published.[15]
Software piracy
Some pirated versions of software rely on a modified hosts file to prevent software from contacting the activation servers of the publisher, although activation servers sometimes appear in general purpose hosts files.[16]

security issues.

The hosts file may present an attack vector for malicious software. The file may be modified, for example, by adware, calculator viruses, or trojan knight software to redirect traffic from the intended finish to sites hosting malicious or undesirable content. [ 17 ] The far-flung computer worm Mydoom.B blocked users from visiting sites about calculator security and antivirus software and besides affected access from the compromised calculator to the Microsoft Windows Update web site. In some cases malware has modified the library creditworthy for loading the hosts file in order to redirect it to a file it is able to control freely. [ 18 ]

See besides.


Leave a Reply

Your email address will not be published.