Earlier, I posted a step by step guide on Creating IIS7 sites, applications, and virtual directories using Internet Information Services Manager. In the article, I created a new website named “bloggingdeveloper” and created a single HTTP binding configured to listen on all interfaces, port 81, and without a host-header restriction. The site was accessible via http://localhost:81/. 

Serving over Port 81
Serving via http://localhost:81/


In this step by step tutorial, I will describe accessing a local site via name (e.g. http://bloggingdeveloper/) using the Hosts file.

  1. Start IIS Manager

      To start IIS Manager from the Run dialog box
    1. On the Start menu, click Run.
    2. In the Open box, type inetmgr and then click OK.

      To start IIS Manager from the Administrative Services console
    1. In the Control Panel window, click Administrative Tools.
    2. In the Administrative Tools window, click Internet Information Services (IIS) Manager.

  2. Internet Information Manager 7.0
    Internet Information Manager 7.0


  3. Select your site (bloggingdeveloper) from the left side and select Bindings from the right side under the Edit Site section.

  4. IIS Bindings
    IIS Bindings


  5. In the bindings window Click Add, enter 127.0.0.2 as the IP Address, leave the host header empty and click OK.

  6. IIS Add Bindings
    IIS Add Bindings


  7. Edit the Hosts File

    1. Browse to Start -> All Programs -> Accessories
    2. For Windows Vista Users : Right click "Notepad" and select "Run as administrator"
    3. Click "Continue" on the UAC prompt
    4. Click File -> Open
    5. Browse to "C:\Windows\System32\Drivers\etc"
    6. Change the file filter drop down box from "Text Documents (*.txt)" to "All Files (*.*)"
    7. Select "hosts" and click "Open"

    8. Unedited Hosts File
      Unedited Hosts File


    9. To the end of the file add the following line:

    10. 127.0.0.2 bloggingdeveloper

      Edited Hosts File
      Edited Hosts File


    11. Close Notepad. Save when prompted.

  8. If you skip Step b in Windows Vista and try to modify your hosts file, it will not let you save it. It tells you that you don't have permission. To successfully modify the hosts file, run notepad.exe as an administrator.

    Error when trying to save hosts file without administrative privilages
    Error when trying to save hosts file without administrative privilages


    You may use any IP Address between 127.0.0.2 and 127.0.0.254.

  9. Browse your site via http://bloggingdeveloper/

  10. Serving via http://bloggingdeveloper
    Serving via http://bloggingdeveloper


Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5




Add comment





(will not be displayed)








  • javascript
  • querystring
  • url parameters
  • parse querystring
  • delayed redirect
  • settimeout
  • focus
  • textbox
  • page load
  • after submit
  • set focus in asp.net 2.0/3.5
  • on page load
  • after postback
  • set control focus
  • postback
  • asp.net 1.x
  • substring
  • substr
  • javascript string methods
  • parsefloat
  • convert strings to numbers
  • parseint
  • javascript history
  • history.go
  • history.back
  • http requests
  • image maps
  • css sprites
  • external css
  • external javascript
  • compress javascript
  • javascript compression
  • ajaxcontroltoolkit
  • tab control
  • array
  • length
  • javascipt
  • lastmodified
  • mstsc
  • terminal services
  • remote desktop connections
  • null
  • undefined
  • array.join
  • string concatenation
  • setinterval
  • clearinterval
  • timing events
  • cleartimeout
  • javascript timing events
  • url redirection
  • location.href
  • location.replace
  • redirect
  • redirection
  • system.io.compression
  • viewstate compression
  • compress viewstate
  • gzipstream
  • loadpagestatefrompersistencemedium
  • savepagestatetopersistencemedium
  • form spam
  • captcha
  • prevent spam without captcha
  • url redirect
  • defaultbutton
  • enter key
  • default button
  • asp.net
  • 2.0
  • form
  • panel
  • 1.1
  • form submit
  • dopostback
  • onkeypress
  • onkeydown
  • onkeyup
  • javascript key events
  • keycode 13
  • disable enter key
  • int32.parse
  • convert.toint32
  • int32.tryparse
  • google
  • hoax
  • gmail
  • storage
  • counter
  • mail
  • visual studio 2005
  • vs 2008
  • copy
  • paste
  • clipboard data
  • static variables
  • application object
  • static property
  • server control
  • web file manager
  • iz web file manager
  • convert
  • parse
  • tryparse
  • file upload control
  • maxrequestlength
  • executiontimeout
  • httpruntime
  • asp.net 2.0
  • registering scripts
  • registerclientscript
  • registerstartupscript
  • cross-browser
  • events
  • improve web site performance
  • compression
  • caching
  • elmah
  • error logging
  • exception
  • error
  • httphandler
  • google sitemap generator
  • sitemap
  • internet information services
  • iis7
  • hosts file
  • localhost
  • windows vista
  • search engine optimization
  • seo
  • search engine friendly pages
  • headscriptmanager
  • class library
  • head
  • css
  • c#
  • iis
  • internet information services manager
  • 401.3 unauthorized
  • 500.0 internal server error
  • http error 500.19
  • google toolbar
  • yellow input fields
  • input
  • select
  • background color
  • mozilla firefox
  • medium trust
  • orcas
  • compileroptions
  • warninglevel
  • zyb
  • mobile phones
  • online backup service
  • online services
  • textarea
  • maxlength
  • limit input length
  • custom server control
  • internal error 2739
  • adobe cs3
  • adobe customer support
  • solution
  • error code 0x80004005
  • 500.19 internal server error
  • meta tags
  • keywords meta tag
  • meta
  • description meta tag
  • fake page rank domains
  • scammers
  • google page rank technology
  • ebay
  • general
  • title
  • page rank