KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: TCP/IP addresses for local web testing
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: January 21, 2000

A TCP/IP address is made up of four numbers, called "octets" separated by periods. These uniquely identify each computer connected to the world-wide Internet (capital 'I'). In order to make the Internet easier for human beings to use, names like www.4D.com are transparently mapped to their corresponding numeric TCP/IP addresses.

Sites with full-time Internet connections normally will have TCP/IP addresses assigned to all computers accessing their network. These are assigned either manually (by system administrators) or using a dynamic allocation protocol such as DHCP. If you set up a test web server on your desktop machine all you need to know is the IP address that has been assigned to your CPU (more than likely you do not have a host name like www.bobscpu.4D.com assigned to your individual computer).

What if you are using a dial-up connection to access the Internet?

Can you still test your web serving locally without connecting first?

RFC1918 defines sets of addresses available for use on private networks that aren't connected to the rest of the Internet. One of these sets is:

192.168.0.0 thru 192.168.255.255

So, you can manually assign any address in this range to computers on your local area network to enable your own internet (small 'i'). Of course, in order to connect to the Internet via dial-up again you will have to reset your TCP/IP settings to be assigned via PPP or SLIP.

Another useful trick (once you have an IP address assigned) is to use the shortcut "localhost" to connect to a web server running on the same machine as your web browser. That way you don't have to remember remember your exact IP address when testing a web server locally. Just type "localhost" into your browser's location entry area to connect to a web server running on the same CPU.