Basics of Hosts file; HOSTS file location and usage

• Host File is like first referenced address book which associates hostname with IP address.

• Example to associate vijredexample.com to 192.168.1.1:
o o Last line in below image will add the mapping
HostsFile_01

• Location of hosts file
%systemroot%\system32\drivers\etc\

• How to update:
Open Notepad (or any other text editor) in Admin privileges to edit HOSTS file
HostsFile_02

.

Uses:
• Block a site: Avoid ads by pointing ad sites with your local IP address
• Test one server in a cluster: you may hit any server in the cluster by default. If you want to test one specific server, add host entry
• DNS issues: When DNS has issues, HOSTS file is a workaround
• Host Header: At times, you may be able to open a site with IP address but you have to use website (without DNS entry). HOSTS file is the only option

This entry was posted in knowledge, Productivity, Windows Server and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s