Home > Articles > IIS Articles > Simple steps to Map the User Friendly Host Name With Its Corresponding IP Address Using Host File In...

Simple steps to Map the User Friendly Host Name With Its Corresponding IP Address Using Host File In IIS8

by Karthik Sachin   on Jul 26, 2016   Category: IIS  | Level: Beginner  |  Views: 553    |  Points: 100   
Like this article? Bookmark and Share:
In this blog you will learn how to Map the User Friendly Host Name with its Corresponding IP Address Using Host File In IIS8

Introduction

In this  article I am going to cover how to map the user-friendly host name with its corresponding IP address using Host File in IIS.

Background

A few days back I got a requirement to change the IP address of our locally hosted website in IIS 8 of Windows server 2012 R2, since it was difficult for the client to remember the IP address every time.

Screen Shot of Expected Output

Before Changing host file 


Now I am going to change this to some user-friendly name, for ex : www.Karthiksachin.com

After Changing the Host file

Let's see step by step how can we achieve this.

Before the steps, a brief Intro about host file:

What is host file?

In simple words, Host file is like a Telephone directory which will contain the number(IP Address) and associated address(Host Name). So when you give a Host name like www.google.com into your browser, then the Host file is started to see if you have the IP address for that site. If you have, then your computer will get it and act accordingly, otherwise it will ask the details to the ISP.

Location of host file in file system

The path to the Host file in Windows is %systemroot%\system32\drivers\etc\ where %systemroot% is usually c:\windows unless you installed Windows on a different partition. So the same can be written as c:\Windows\System32\Drivers\etc\hosts.

Step 1 - To access the host file in Windows 7 you can use the following command in the Run Line to open notepad and the file.

Then it will open the following text file as shown below,



Then it will open the default file like below

Original File before changing how it looks,

 
After changing the file as per requirement,


(Note: make sure you have taken the # symbol from that line because it denotes comment)

That's it from the host file point of view.

Now just change following in the IIS, like the below screen shots,





Output


Tried the Same in Window server 2012 R2

Output

I hope the above information was a little bit helpful. Kindly share your valuable comments or feedback.



Like this article? Bookmark and Share:

Most viewed Articles

User Comments


  Re :Simple steps to Map the User Friendly Host Name With Its Corresponding IP Address Using Host File In IIS8   
Posted by Adhithvaibhav
on 8/30/2016 7:10:52 AM
Points : 10

Hi Karthik Sachin,

Great stuff, Thanks for the article its really useful.
  Re :Simple steps to Map the User Friendly Host Name With Its Corresponding IP Address Using Host File In IIS8   
Posted by jaafar
on 9/8/2016 5:21:24 AM
Points : 10

very helpful

https://clicksite.ir/layout.php?t=%D8%A2%D9%85%D9%88%D8%B2%D8%B4_%D8%B3%DB%8C_%D8%B4%D8%A7%D8%B1%D9%BE&id=59&act=cat

Submit feedback about this article

Please sign in to post feedback

Latest Posts