Using hosts file to redirect URLs locally

There are times when you want to access machines on LAN or internet using the IP address. Hosts files in various systems can help you auto redirect logical names to the IP address. For example

Now whenever you will call, you will be pointing to localhost. Similarly you can use any IP address on LAN or Internet and redirect logical names to them.

More on usage of hosts file :