Hosts File: What it is and how to use it.

According to Wikipedia, the computer file hosts is an operating system file that maps hostnames to IP addresses. It is a plain text file. Originally a file named HOSTS.TXT was manually maintained and made available via file sharing by Stanford Research Institute.

Basically, the Hosts serve to redirect local domains and block access to resources on the internet.

Locais

Operating System Versions Location
Unix, Unix-like, POSIX /etc/hosts
Microsoft Windows 3.1 %WinDir%\HOSTS
Microsoft Windows 95, 98, ME %WinDir%\hosts
Microsoft Windows NT, 2000, XP, 2003, Vista, 2008, 7, 2012, 8, 10 %SystemRoot%\System32\drivers\etc\hosts
Windows Mobile, Windows Phone Registry: HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts
Apple Macintosh 9 and earlier Preferences or System folder
Apple Macintosh Mac OS X 10.0–10.1.5 (Added through NetInfo or niload)
Apple Macintosh Mac OS X 10.2 and newer /etc/hosts (a symbolic link to /private/etc/hosts)
Novell NetWare SYS:etc\hosts
OS/2 & eComStation "bootdrive":\mptn\etc\
Symbian Symbian OS 6.1–9.0 C:\system\data\hosts
Symbian Symbian OS 9.1+ C:\private\10000882\hosts
MorphOS NetStack ENVARC:sys/net/hosts
AmigaOS 4 DEVS:Internet/hosts
AROS ENVARC:AROSTCP/db/hosts
Android /etc/hosts (a symbolic link to /system/etc/hosts)
iOS iOS 2.0 and newer /etc/hosts (a symbolic link to /private/etc/hosts)
TOPS-20 HOSTS.TXT
Plan 9 /lib/ndb/hosts
BeOS /boot/beos/etc/hosts
Haiku /boot/common/settings/network/hosts
OpenVMS UCX UCX$HOST
OpenVMS TCPware TCPIP$HOST
3.7, 5 !Boot.Resources.!Internet.files.Hosts
RISC OS later boot sequence !Boot.Choices.Hardware.Disabled.Internet.Files.Hosts

 

Examples

  • Original Windows Hosts

 

  • Hosts file blocking Adobe and Techsmish (Warning: if you use this file, some softwares may not work properly afterwards).

  • Unnecessarily large Hosts File blocking Ad serving sites.

Referência

The following two tabs change content below.
Breno RdV
Please allow me to introduce myself...I'm a former psychologist, with almost a decade worth of experience in Human Resources and People Management. Now a developer/software analyst working with PowerBuilder, C#, PowerShell and currently expanding to the world of Python, Xamarin, PHP Angular and (why not?) Unity.
Breno RdV

Latest posts by Breno RdV (see all)

Comments

comments

Posted in Dev, General KB and tagged , , , .