DZone
Performance Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Performance Zone > Map the User Friendly Host Name With Its Corresponding IP Address

Map the User Friendly Host Name With Its Corresponding IP Address

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

Karthik Elumalai user avatar by
Karthik Elumalai
·
Jul. 29, 16 · Performance Zone · Tutorial
Like (1)
Save
Tweet
4.23K Views

Join the DZone community and get the full member experience.

Join For Free

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

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

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 screenshots below:


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.

Host (Unix) File system

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Happens-Before In Java Or How To Write a Thread-Safe Application
  • 5 Best Practices for Building Cloud-Native Permissions
  • How to Build Spark Lineage for Data Lakes
  • Replace your Scripts with Gradle Tasks

Comments

Performance Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo