it gets different for subnets n stuff. here is a bit about how it all works (you proably know most of it, its a bit simple)BTW DNS= Domain Name Server
like robin said a hostname is just an alias for an ip #.
A DNS is basically a resource for converting friendly Hostnames (like hotmail.com)which humans can easily
understand, into IP addresses which machines need to communicate to the host i.e. hotmail.com. Now what basically happens in that when you type
http://www.hotmail.com in the location bar of your browser, the browser needs to perform a lookup to find the machine readable IP address so
that it can communicate with the host.This means that the browser cannot communicate with a host if it
has the friendly hostname only.
Without the IP address, no communication can take place. So for the lookup,the browser contacts the DNS server setup by normally by your ISP and through the resolver tries to look
for the IP conversion of the hostname the user wants to contact.
A DNS server is basically a server running DNS software.The server that the browser first looks for a translation is the Primary DNS server, if this primary server doesn't show
any match then this server contacts another DNS server somewhere on the Internet (This becomes the Secondary
DNS Server.)and looks for a match. If a match is found in the secondry server then the Primary server updates it's database so that it doesn't have to contact the Secondry server again for the same match.Each DNS server stores
the hosts it has recently looked for in it's cache. Now if the Server has recently looked for a particular
hostname, then it does not search for it again but just provides the browser with that information from it's
cache. If the cache does not contain a particular entry, then the resolver looks for the desired entry by searching through the entire database.
New techologies are being introduced in the DNS sphere. Now take the case of amazon.com. It is a famous and large E-company with over a million users per day.(My rough estimate.)Such large organizations have multiple IP addresses for the same domain name. Today what happens is that the DNS server returns all IP Addresses and the browser chooses a random IP from it. But this new technolofy
will allow the DNS server to return the IP of the server which has the least trafiic, so as to enhanse surfing. So you can see DNS does make sense.
You can see how time consuming the above process can be and it can really slow down your surfing process, a lot of time is being wasted when the browser contacts the DNS server
and performs a lookup, so how do you fasten this process? How do you eliminate the fact that the browser will contact the DNS server each time you want to visit a site? Well the answer lies in the HOSTS file hidden in the c:\windows directory.
You can map a machine's IP to any hostname by editing the c:\windows\hosts file(It has no extension.)on win 9.x systems, On NT the hosts file is c:\WinNT\system32\drivers\etc\hosts and on Linux it is /etc/hosts.(i think)
A hosts file looks something like the below:
###############################
# Copyright (c) 1998 Micro$oft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP stack for Windows98
#
# 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.xx.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
1. localhost
#####################################
For example, if you know that the IP address of say hotmail.com is 207.xxx.xxx.xxx., then if you add the
following in the Hosts file then the browser will not perform a lookup and
will
starighaway have the IP to
communicate with the host. So add the line:
207.xxx.xxx.xxx
http://www.hotmail.com
Now your browser will connect faster to Hotmail.com. This technique can increase your surfing speed tremendously.(if your a hardcore geek) So now that you know what a DNS is...
heh.