Home | Troubleshooting |  Quick Setup  |  Cisco How to  |  Wireless  |  Forums   | Site Map | Services  | About Us | Chicagotech MVP  | Search                          

Clearapps network inventory
software.

 

Windows HOSTS file

What’s HOSTS file
Why do you need HOSTS file
How to use HOSTS file
HOSTS file Troubleshooting and restriction

 

What’s HOSTS file

Normally, you will use DNS to resolve a host name to an IP address. The Hosts file is another way to resolve a host name to an IP address through a locally stored text file that contains IP-address-to-host-name mappings. On most UNIX-based computers, this file is /etc/hosts. On Windows-based computers, this file is the Hosts file in the systemroot\System32\Drivers\Etc folder.

Why do you need HOSTS file

There are many reasons that you might still need to use a HOSTS file. Here are some of them.

1.      Your router doesn't support loopback. Check this case.

2.      Speeding Up Browsing. If a HOSTS file exists in the Windows folder, it is automatically searched during any process using the Windows TCP/IP stack. The search is done first before any attempt to find a DNS server is made. So that you can speed up to find a Web site if you can resolve IP addresses using HOSTS file instead of waiting for a DNS server. Especially, if you have a slow connection and want to access some web site faster.

3.      You setup a web site at home for test without a DNS server.

How to use HOSTS file

HOSTS file is a text file. You can read, edit, or creat using Notepad or other text editor. The format of the HOSTS file looks like ths

64.176.153.103        chicagotech.net

64.176.153.103   www.chicagotech.net

Just remember when you save the HOSTS file, be sure to save the file with no extension. To do that, save as “hosts”, including the quotation marks.

To test it, ping the domain name for example ping www.chicagotech.net. It should display 64.176.153.103.

HOSTS file Troubleshooting and restriction

  1. If you can access most web sites except one or tow, you may check the HOSTS file. If a HOSTS file enluing these domain name with wrong IP addresses, you will receive "The page cannot be displayed” message.
  2. You cannot use wildcards in the domain name to reference an IP number.
  3. You can only map an IP address to a name and can’t map a name to a name.
  4. You must have separate entries for www.domain.com and domain.com.
  5. You cannot use port numbers. 
  6. The HOSTS file is read from top to bottom, and if you have a domain name mapped to multiple IP addresses, it will go to the first IP addresses and ignore the second one.  However, if the first one fails to go anywhere, the second IP will be read and then used. Host Name Resolution Process starts with Local host name, the HOSTS and the DNS is the last one.

Post your questions, comments, feedbacks and suggestions

Related Topics

Previous Page   Next Page
 

 


 

 

Hit Counter   This web is provided "AS IS" with no warranties.
Copyright © 2002-2013 ChicagoTech.net, All rights reserved. Unauthorized reproduction forbidden.