HostName setup for IPs windows and linux

HostName setup for IPs windows and linux


We can access any application through hostname instead IP address in local system. Generally local system application can be accessed though localhost or because both default hostname and IP address.

So we can customize the hostname according to our convient. For this we need to edit the hosts file in windows and linux.

Host file location in windows


File name: hosts

Host file location in linux


File name:hosts


Open the hosts file in Notepad++, and edit the as per following.


windows hosts

windows hosts


Edit the file and then save the file but here we need administratior previleges. Now we can access any application by using any of the host name instead IP address like as follows

So you will be feel like as accessing application as a through real website name. In this we are are talking about only IP but not PORT and Context Path. So whatever port / context path you are using for the application that will be same.





Leave a Reply