Creating .local Development Domain On Windows

By leen3o on Dec 24 2009 | 0 Comments

This is something very obvious to most, but as I watch a lot of screen casts / tutorials I would always see people typing in their browser things like umbraco.local or devsite.local to get up their local development copy of Umbraco – And I always wondered how they did it as I always used the built in Visual Studio server to develop on, not to mention if I was using IIS locally I could only install one version of Umbraco as I was accessing it using localhost??

After my trip to Doug’s for a bit of XSLT training, I noticed Doug had several .local domains and several Umbraco installs – He was nice enough to explain how easy it is to do.   All you need to do is edit the HOSTS file on your machine to map the fake domain to 127.0.0.1, you can usually find the hosts file on your machine in the following place.

C:\Windows\System32\drivers\etc\hosts

Now just open the hosts file up with Notepad add your .local domains one after the other (Underneath each other) mapping the local IP then a tab then the domain

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost
#    ::1             localhost

127.0.0.1    playerfind.local
127.0.0.1    localhost

Save the file and now you just need to create the sites in IIS and edit the Bindings to map the domain to the site you want

Capture

Amazing that something so simple can make my day! lol…

Post info

Tags:
Categories: IIS

Comments