Wednesday, April 20, 2011

Host File

Format of Hosts File

The “hosts” file is a plain text file named just that, hosts. It may have to be created. Note that there is no extension on the file name. If you look in the folder \Windows\system32\drivers\etc\, you may find a default hosts file or a text file called "hosts.sam". This file with the extension “sam” is a sample file and has no function other than to illustrate the format. The default hosts (or the hosts.sam) file has these contents on more recent systems (it is slightly different in Windows XP):


# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost
#    ::1             localhost

if we need to add a new entry just add it to the hosts file and save it

example:

1.1.1.1         wcs.mydomain.com

you should can test the result just open a cmd windows and type

ping wcs.mydomain.com

Y:\>ping wcs.mydomain.com

Pinging wcs.mydomain.com [1.1.1.1] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 1.1.1.1:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),


No comments:

Post a Comment