Home | Photos | Technical | My Blog | About Me | Contact Me


How Web Servers Work


IP Addresses
To keep all of these machines straight, each machine on the
Internet is assigned a unique address called an IP address. IP
stands for Internet protocol, and these addresses are 32-bit
numbers, normally expressed as four "octets" in a "dotted
decimal number." A typical IP address looks like this:
The four numbers in an IP address are called octets because
they can have values between 0 and 255, which is 28
possibilities per octet.
Every machine on the Internet has a unique IP address. A
server has a static IP address that does not change very
often. A home machine that is dialing up through a modem often
has an IP address that is assigned by the ISP when the machine
dials in. That IP address is unique for that session -- it may
be different the next time the machine dials in. This way, an
ISP only needs one IP address for each modem it supports,
rather than for each customer.
If you are working on a Windows machine, you can view a lot of
the Internet information for your machine, including your
current IP address and hostname, with the command WINIPCFG.EXE
(IPCONFIG.EXE for Windows 2000/XP). On a UNIX machine, type
nslookup at the command prompt, along with a machine name,
like www.howstuffworks.com -- e.g. "nslookup
www.howstuffworks.com" -- to display the IP address of the
machine, and you can use the command hostname to learn the
name of your machine. (For more information on IP addresses,
see IANA.)
As far as the Internet's machines are concerned, an IP address
is all you need to talk to a server. For example, in your
browser, you can type the URL and arrive
at the machine that contains the Web server for HowStuffWorks.
On some servers, the IP address alone is not sufficient, but
on most large servers it is -- keep reading for details.

Domain Names
Because most people have trouble remembering the strings of
numbers that make up IP addresses, and because IP addresses
sometimes need to change, all servers on the Internet also
have human-readable names, called domain names. For example,
www.howstuffworks.com is a permanent, human-readable name. It
is easier for most of us to remember www.howstuffworks.com
than it is to remember
The name www.howstuffworks.com actually has three parts:
The host name ("www")
The domain name ("howstuffworks")
The top-level domain name ("com")
Domain names are managed by a company called VeriSign.
VeriSign creates the top-level domain names and guarantees
that all names within a top-level domain are unique. VeriSign
also maintains contact information for each site and runs the
"whois" database. The host name is created by the company
hosting the domain. "www" is a very common host name, but many
places now either omit it or replace it with a different host
name that indicates a specific area of the site. For example,
in encarta.msn.com, the domain name for Microsoft's Encarta
encyclopedia, "encarta" is designated as the host name instead
of "www."

Name Servers
The whois Command
On a UNIX machine, you can use the whois command to look
up information about a domain name. You can do the same
thing using the whois form at VeriSign. If you type in a
domain name, like "howstuffworks.com," it will return to
you the registration information for that domain,
including its IP address.

A set of servers called domain name servers (DNS) maps the
human-readable names to the IP addresses. These servers are
simple databases that map names to IP addresses, and they are
distributed all over the Internet. Most individual companies,
ISPs and universities maintain small name servers to map host
names to IP addresses. There are also central name servers
that use data supplied by VeriSign to map domain names to IP
If you type the URL
"http://computer.howstuffworks.com/web-server.htm" into your
browser, your browser extracts the name
"www.howstuffworks.com," passes it to a domain name server,
and the domain name server returns the correct IP address for
www.howstuffworks.com. A number of name servers may be
involved to get the right IP address. For example, in the case
of www.howstuffworks.com, the name server for the "com"
top-level domain will know the IP address for the name server
that knows host names, and a separate query to that name
server, operated by the HowStuffWorks ISP, may deliver the
actual IP address for the HowStuffWorks server machine.
On a UNIX machine, you can access the same service using the
nslookup command. Simply type a name like
"www.howstuffworks.com" into the command line, and the command
will query the name servers and deliver the corresponding IP
address to you.
So here it is: The Internet is made up of millions of
machines, each with a unique IP address. Many of these
machines are server machines, meaning that they provide
services to other machines on the Internet. You have heard of
many of these servers: e-mail servers, Web servers, FTP
servers, Gopher servers and Telnet servers, to name a few. All
of these are provided by server machines.

Source : www.howstuffworks.com



2004 Muhammad Tayyeb