amset.info
from Sembee Ltd.
UK MS Exchange Consultants

Exchange - Net Admin - Outlook
Windows Mobile - Windows

Contact - Director's Blog

AddThis Social Bookmark Button


Network Admin Home

Branding "System Properties"
with Your Own Information
... Win XP, 2000 and older
... Vista

Changing ISPs Plan

Changing Internal
IP Addresses Plan

Custom Text on the
"Workstation Locked" Screen

Downloading a Complete
Internet Explorer Installation

Group Policy Admin

Login Scripts

Limiting the Number of Logins a User Can Make

NETBIOS Alias

Recovery Console

Reset Administrator Password

Run As

Subnet Masks

Uptime Statistics

Using NetMeeting for
Remote Control

Viewing Printers in a
Web Browser

Network Administration
Page Last Reviewed: 02/02/2010

Windows Hosts File

If you are trying to resolve an external name to a local machine - for example your web site, and you don't have your own internal DNS server, then you should create a "hosts" file for each machine.
A hosts file is like a local DNS server. It can have different information on what to resolve names to than is on the public Internet.
If you on a corporate network you should check with your network admin to ensure that hosts files are not already in use.

If you have an internal DNS server, then a Hosts file should NOT be used. Use split DNS instead.

To create or modify a hosts file, follow these easy instructions:

  1. Search your system for either "hosts" or "hosts.sam" (which is a sample file). You DO NOT want lmhosts or lmhosts.sam.
  2. If you don't have a hosts file, then you should rename the "hosts.sam" file removing the ".sam" suffix. A "hosts" file doesn't have an extension.
  3. Open the "hosts" file in notepad. The easiest way to do this is to hold down the shift key and then right click on it. You will then get an option "Open With..." where you can choose "Notepad".
  4. Once the file is open, you will see the format that you need to make entries. Enter the IP address first, then a tab, then the name. Once complete, save the file. Leave it open while you test it.
  5. To test your file, open a command prompt and enter "ping <name entered>" minus the quotes, where <name entered> is the name you just put in to the hosts file. You should find that it resolves to the local IP address instead.
  6. You can make additional entries, you can even have multiple names for the same IP addresses.

Here is an example hosts file with some entries already made:

# Copyright (c) 1993-1999 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

127.0.0.1 localhost
192.168.0.1 www.example.com
192.168.0.1 ftp.example.com
192.168.0.2 printer

Last Page Update:
02/02/2010
More Content from Sembee Ltd.
 
Resources on amset.info Other Sites Sembee Ltd.
Microsoft Exchange Command Prompt Getting Started Guide Microsoft Exchange Consultancy
Microsoft Outlook Login Scripts Director's Blog
Network Administration MS Exchange Resources  
Internet Explorer Knowledge Base search  
Microsoft Windows Recovery of MS Office content from Temp Files  
Microsoft Windows Mobile Troubleshoot the Automatic Updates Client  
Amazon Store UK ISP Status Pages  

© Sembee Ltd. 1998 - 2010.

Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions. All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned on this site. This site is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.