ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Hosts file - Wikipedia, the free encyclopedia

Hosts file

From Wikipedia, the free encyclopedia

The hosts file is a computer file used to store information on where to find a node on a computer network. This file maps hostnames to IP addresses. The hosts file is used as a supplement to (or instead of) the domain name system on networks of varying sizes. Unlike DNS, the hosts file is under the control of the local computer's administrator.

Contents

[edit] History

The ARPANET (predecessor to the Internet) had no domain name system for giving network nodes their own addresses. Because there was no centralized system for this purpose, each network node contained its own “map” of the network nodes that it needed to know about, and assigned them names that were memorable to the user. There was no system for ensuring that all systems on a network were called the same thing, nor was there a way to read some other user’s hosts file to automatically obtain their copy.

The small size of the ARPANET permitted hosts files to be used with some convenience for some time. Network nodes typically had one address, and could have potentially many names. As individual TCP/IP computer networks started becoming popular, however, the hosts file became a large burden on system administrators — networks and network nodes were being added all the time — making maintenance of the hosts file a task which grew significantly.

[edit] Location and default content

The host file is located in different locations in different operating systems and even in different Windows versions: [1]

  • Windows NT/2000/XP/2003/Vista: %SystemRoot%\system32\drivers\etc\ is the default location, which may be changed. The actual directory is determined by the Registry key \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath.
  • Windows 95/98/Me: %WinDir%\
  • Linux and other Unix-like operating systems: /etc
  • Mac OS 9 and earlier: System Folder: Preferences or System folder (format of the file may vary from Windows and Linux counterparts)
  • Mac OS X: /private/etc (uses BSD-style Hosts file)
  • OS/2 and eComStation: "bootdrive":\mptn\etc\
  • Symbian 1st/2nd edition phones: C:\system\data\hosts
  • Symbian 3rd edition phones: C:\private\10000882\hosts, only accessible with file browsers with AllFiles capability, most are not. [2]

[edit] Default content on Windows operating systems

In Windows, the default hosts file is often blank or it contains (inactive) comment lines followed by IPv4 or IPv6 localhost entries.

127.0.0.1       localhost
::1             localhost

An example can be found at http://vlaurie.com/computers2/Articles/hosts.htm.

[edit] Other uses for the hosts file

[edit] Blocking

The hosts file has alternative uses, including filtering ads by having entries for known ad-servers redirect to machines without the advertising on them or more typically by redirecting references to ad-servers to the local address 127.0.0.1. This can save network bandwidth, as well, by eliminating a request to the DNS server normally used for obtaining address information, as well as by not downloading the advertisements. The user experience may be further enhanced by running a minimal web server locally that only returns a blank page for every request [3]. In this way the ads from the web pages literally disappear without any error. However, if the hosts file is to be used for this purpose, it must be kept up-to-date with lists of Internet servers known to host such content. On Windows machines, the "DNS Client" service may need to be stopped in order for changes to the hosts file to have effect.

Blocking ads in this way can cause improper browser operation or performance degradation and is risky for several reasons. First, directing name lookups to incorrect/invalid addresses, the browser is forced to attempt to load each "blocked" element from a bad address. If the bad address is an IP that does not exist or one that does not host a web server, the system must attempt and timeout every connection attempt. Secondly, the DNS system is a database driven system designed to return results quickly. Introducing a large hosts file to a system forces it to parse through the entire file for a match before even issuing a DNS request. Large hosts files can significantly increase the amount of time it takes the system to do any DNS lookup, not just inside the browser.

A less intrusive solution is to block browser requests for the ads in the first place. This can be done through browser based plugins such as "No Script" and "Adblock" for Firefox. Another solution would be to block the ad addresses via a proxy or firewall.

Another use of the host file is to block known dubious or criminal domains and servers (with spyware and other malware). This has the same risks as hosts blocking ads, but generally requires fewer addresses in the hosts file and therefore would have a smaller impact on the system.

[edit] Redirecting

[edit] Malicious use

The hosts file can also be "hijacked", or used for malicious purposes. For example, adware, computer viruses, trojan horses, or other malware can edit the hosts file to redirect traffic from a "safe" site (such as Google or Wikipedia) to sites hosting content that may be offensive or intrusive to the user or the user’s computer system. For example, a trojan (Qhosts) redirected traffic from search engines such as Google and AltaVista to a site specified by the author of the trojan horse [4]. Mydoom.B (a malware program) blocked users from visiting sites regarding computer security and antivirus software, which also affected the Windows Update web site.

[edit] Beneficial use

Another useful and time-saving tip for website programmers, intranet developers and IT managers is to enable non-standard TLDs on a LAN such as example.local (for accessing Example Company's Intranet) or sample.new (for a new version of the Sample.com website during testing).

192.168.1.100       example.local
127.0.0.1           sample.new

[edit] See also

[edit] References and footnotes

[edit] External links

[edit] Custom hosts files

[edit] Applications to Manage Hosts Files


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -