I See My Website as a Local Page

 

I used to have a wireless web adapter plugged into a usb port on on my PC, Serval. I did this because Serval hosts my website, so I can't see it through my own LAN. ...but I can see http://community-info.org through my wireless network. Unfortuntely, I've been experiencing dropped connections lately. I don't like my website going offline just because my wireless network has been flaky, lately. So...I yanked the wireless adapter out of it's usb port.  Yet, I can still see my website! How is this possible? Here's my hosts file:

# 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
	127.0.0.1	community-info.org
#	::1             localhost

 

The hosts file can be used to assign host names to ip addresses. Your isp has a DNS server that does all that work for you, so most people don't even know they have a hosts file. The hosts file comes with one entry in it; assigning the the ip address 127.0.0.1 to the url localhost. When you host your own web server, 127.0.0.1 is the ip address assigned to the local copy of your default web site's home page. If you enter 127.0.0.1 or localhost in the address field of your browser, the home page of your default website (domain) will appear in your browser (assuming you are hosting it). You can see in my hosts file I assigned community-info.org to 127.0.0.1, so if I enter http://community-info.org or just community-info.org in my brower's address field, my home page pops up. I don't need a wireless adapter to see my home page anymore.

Return To My Blog Page       Return To My Programming Page