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.





The Author


Hello! I am Narayanaswamy founder and admin of I have been working in IT industry more than 7 years. NarayanaTutorial is my web technologies blog. My specialties are Java / J2EE, Spring, Hibernate, Struts, Webservices, PHP, Oracle, MySQL, SQLServer, Web Hosting and Website Development. I am a self learner and passionate about training and writing. I am always trying my best to share my knowledge through my blog.

Leave a Reply