Friday, October 9, 2009

Hosts file

The hosts file is a computer file used by an operating system to map hostnames to IP addresses. This method is one of several methods used by an operating system to locate network nodes on a computer network. On many operating systems, the host file content is used preferentially over other methods, such as the Domain Name System (DNS). Unlike DNS, the hosts file is under the control of the local computer's administrator.[1]

Location and content

The location of the hosts file in the file system hierarchy of operating systems varies.[2]

Operating System Version(s) Location
Windows 95, 98, Me %WinDir%\
Windows NT, 2000, XP, 2003, Vista, 7 %SystemRoot%\system32\drivers\etc\ by default. Actual location defined in Registry key \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath.

Users of 64-bit versions of Windows Server 2003, Server 2008, and Vista (but not Windows 7) cannot access the HOSTS file with a 32-bit editor.[3]

Macintosh 9 and earlier System Folder: Preferences or System folder
Mac OS X /private/etc/hosts
Linux, BSD based, and similar
/etc/hosts[4]
Novell NetWare
SYS:etc\hosts
iPhone and iPod
/private/etc/hosts
OS/2 and eComStation
"bootdrive":\mptn\etc\
Symbian Symbian OS 6.1-9.0

(Series 60 1st and 2nd edition, UIQ 1-2)

C:\system\data\hosts
Symbian Symbian OS 9.1+

(Series 60 3rd edition, UIQ 3.x)

C:\private\10000882\hosts (AllFiles capable only)

The hosts file consists of lines consisting of an IP address and one or more hostnames, separated by white space. Comment lines in the hosts file start with the '#' (hash) character. Blank lines are ignored.

The default hosts file contents typically includes a line for the localhost definition.[5]

No comments: