The file " hosts " (plural of host , English " hosts" or "host" in the sense of provider, provider ; usually in lower case unless the file system does not support this) is a local configuration file to Map host names to IP addresses . This system - file was originally the site of the Domain Name System used. Today it is generally only used for permanent assignment in local (and virtual) computer networks ( LAN ).
The format of the hosts file is originally from the Berkeley Software Distribution , with the UNIX version 4.3, which in conjunction with the developed there network - Stack stands. It was later adopted for various other operating systems .
The file name lmhosts , which is the abbreviation for “Lan-Manager Hosts” and was used in Windows systems by the LAN manager and later also by the SMB software Samba , also comes from that time .
Before the introduction of the Domain Name System (DNS), computer names on the Internet were resolved using these host files. The distribution and updating of these files was a logistical problem. For this reason, hosts files are rarely or no longer used on the Internet and in larger networks. Also loopback addresses do not need an entry in the Hosts file nowadays.
If a host name has to be translated (or "resolved") into an IP address (or vice versa), the operating systems first attempt to resolve the name locally using the assignments saved in the hosts file, before other methods ( DNS , WINS etc.) .) should be tried. On Unix-like systems , the order is determined by entries in the /etc/nsswitch.conf file .
In Windows versions that are no longer based on DOS ( Windows NT or higher), the file is usually no longer required, as the Windows Internet Naming Service usually takes over the task of the current operating system versions .
Paths under different operating systems
NT line from Windows 8
- NT line up to and including Windows 7
%SystemRoot%\system32\drivers\etc\hostsis system default; the path is saved in the registration database and can be adjusted:
95 / 98 / Me
- one key per host in the registry under
- one key per host in the registry under
- NT line from Windows 8
Unix , FreeBSD , OpenBSD , GNU / Linux
/etcis a link with
DEVS:Internet/hosts(from version 4)
OS / 2 and eComStation
1st and 2nd edition:
C:\private\10000882\hosts(Access not easily possible due to platform security.)
- 1st and 2nd edition:
The file consists of a tabular list of IP addresses and associated host names . The columns are separated by spaces or tabs . A typical hosts file looks like this:
# Kommentare werden durch eine vorangestellte Raute eingeleitet 127.0.0.1 localhost.localdomain localhost ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
The first line is used to assign the local host in the IPv4 protocol, the following lines assign IPv6 addresses to.
It should be noted that each subdomain must also be listed, because if the entry does not exist, it will be resolved again.
Host files make it possible to permanently assign a DNS entry to an IP address, which enables, for example, the clear assignment and use in a network with the same name assigned several times. Likewise, computers that have other, possibly unfavorable or missing names, can be given a simple and precisely identifiable name. The use of the hosts file can therefore compensate for a temporary failure of the DNS server. It is also possible to block addresses by redirecting them to the loopback interface (host name localhost, IP address 127.0.0.1). The request for a specific domain name, e.g. B. example.com, answered in such a way that it refers to the address of your own PC. Since the page you are looking for is not available there, you get a page loading error.
Web developers also often register domains for which they are designing content. The contents of the local web server can thus be tested as if they were on a web server with the same domain in the Internet. However, the domain can only be reached locally. Processing of scripts and tasks is possible immediately with the later names.
Use as a filter
Sometimes the hosts file is used to block known advertising servers by entering it as an alias for 127.0.0.1 (better 0.0.0.0). The peculiarity of this method compared to the advertising filters to be installed is that this blocking is valid throughout the system, i.e. it is not limited to just one browser. In addition, such filters can also be used against some malware if they try to retrieve instructions from known servers.
However, excessive use of this file can slow down the entire name resolution process as this file is not optimized for large amounts of data. Ready-made files for use as advertising filters or DNS replacements are available on the Internet.
Windows operating systems in particular are often the target of viruses that modify the hosts file in such a way that users are directed to fake online services. With this trick, a user can be redirected to a fake online banking site (see Pharming and Phishing ). If in doubt, it is advisable to pay attention to encrypted connections and to check the certificate of the connection key .
This is usually accompanied by entries that prevent the antivirus programs from being updated . You can reach the manufacturer's servers through their Internet addresses; the updated virus signatures are provided on these servers . If, because of the invalid or incorrectly entered IP addresses in the hosts file, these cannot be reached, these entries prevent the software from being updated automatically or manually. However , it should be possible to prevent such manipulations beforehand by keeping up-to-date and correctly configured security software ( user account , active background monitor, active firewall).
Another (here deliberately desired) method of manipulation was specially developed by the creators of black copies of software. Since many types of software have to be activated online, an entry is made in the hosts file with the name of the server of the legal software provider that is contacted for activation. This is now only provided with the IP address of a server maintained by the providers of the black copies. The illegally obtained activation keys are then on this. The manipulation of the file is done with a supplied program.
- Blocking Unwanted Parasites with a Hosts File - Information on the hosts file and a continuously updated hosts file for download
- Using a Hosts File To Make The Internet Not Suck - further information and sample hosts files, e.g. B. Block Ads