IP addresses on the Internet

IP addresses are essential on the Internet as the TCP/IP protocol is the main protocol used to connect to the Internet. To connect to the Internet and for your computer to be seen on the Internet you need an IP address. If you use a modem and a dial-up connection to get online, your ISP assigns you a dynamic IP address for the time you’re online. If you have a DSL connection or cable modem, you most likely have a static IP address (though there are exceptions depending on the provider).

In addition, every web site on the Internet has its own IP address. This IP is static so that the site is always found on the same spot on the web. Otherwise it would be difficult to find the site. Imagine your friend randomly changing phone numbers. It would make it hard for you to call if you didn’t know the number and had to look it up every time. This IP address is assigned to the site by the web host or the web administrator since web sites are hosted on computers that are connected to the network of the Internet. You can assign multiple IP addresses to one computer which allows web hosts to host multiple sites on one and the same computer.

For example, Yahoo’s site has the IP address which identifies it uniquely on the Internet. If you open your browser and type in the IP and hit Enter, Yahoo will show up. Wait a second, you are probably saying right now, I never use that number to go to Yahoo. That’s true, you most likely just type in www.yahoo.com and your browser brings up the correct site. Yahoo is a lot easier to remember than This is where domain names come into play.

Think about our example with phone numbers again. In order to call your friend, you have to dial a phone number which can be hard to remember. To make this easier, you keep address books that have your friend’s names and phone numbers listed. Same reason phone books exist. You look up the name, find the right number, then dial it. In a simplified manner, this is exactly like your browser works. When you type in www.yahoo.com, your browser has no clue what to do. So it first talks to another computer called a Domain Name System server, or DNS server for short. This DNS server is maintained by your ISP and updated on a frequent basis. Your browser asks now the DNS server what www.yahoo.com means. The DNS server will look it up in its list of web sites and, if it finds a listing that matches, pull up the correct IP address for that site, in our example, so that now your computer knows what computer to connect to and request retrieval of the desired web page.

You can easily find out what IP address a site has by using one of several commands. You can either do a WhoIs lookup at one of many sites that offer this service for free, such as WhoIs.Net, or you can open a DOS window and type ping www.yahoo.com. This actually sends a small packet of data to the site and measures in milliseconds how fast the reply comes back, but it also displays the IP address of the site at the top. On NT and UNIX machines you can use the NSLOOKUP command to get this information.

How does a new web site get an IP address?

When you set up a web site, the first thing you usually do is register a domain name with a registrar. These organizations keep track of domain names in a database. When you register your new domain name, they will ask you where your site is hosted and what DNS server your site is listed on. If you use a web host for example, you would tell them the name and IP address of your web host’s DNS server (usually web hosts do this for you). Your web host will make an entry in its DNS server with your site’s domain name and the IP address they assigned to it which then points to whatever computer the site resides on. As soon as your ISP has added the name and IP address for your site to its DNS server’s database, it will know where to go to retrieve the web page you asked for when you typed in the domain name.

Another thing that could happen is that a site changes its IP address, either because the web administrator moves it to a different computer, or maybe because the site was moved to a different web host. This requires the domain name being removed from the old DNS server and added to the new DNS server as well as informing the registrar’s database about the change. In addition, every ISP has to update their DNS server to know what the new IP for that site is. But in contrast to phone books that get updated only once a year, DNS servers are being updated from every few hours (major ISPs update their DNS servers constantly) up to every week or two (usually only small ISPs are that slow).

In the short time period it takes to update DNS servers around the world, it can happen that your ISP still directs you to the old web server. If you know the new IP address for the site, you can beat the system by typing in the IP in your browser instead of the domain name. This will save your ISP the trouble of looking it up, it will assume that you want to go to that computer and take you there directly, bypassing the DNS server lookup procedure.

Stale Information

Some ISPs are trying to limit the amount of work they have to do in order to relieve the load on their systems and work more efficiently. For that reason, they cache DNS information. This means that they keep information that is requested frequently in a temporary storage location that is easier and faster to access than looking up the same information over and over again. This means that when you request to go to www.yahoo.com, the ISP might look in the cache first, see that somebody else requested earlier to go to www.yahoo.com and that they already looked up that IP address, so they will just give you the IP address that they have stored in their cache instead of looking it up again, assuming that the information is still the same. This works most of the time and can be more efficient, but if the IP address has changed, you of course have a problem since you will be directed to the wrong web server. Your ISP will empty the cache on a regular basis and eventually look up the information again so that you then get directed to the correct web server.

Another thing that can happen is that an ISP keeps a file called HOSTS on your computer. In this small text file they will store a list of domain names for sites you go to frequently with the corresponding IP addresses. When you type in the web site address, the browser actually checks first if such a HOSTS file exists before it talks to your ISP’s domain name server. If it finds the information it needs in there, it will take the IP address from this file and use it to go to the site. This eliminates again the need to check with the ISP’s DNS server first and shaves off valuable milliseconds of your browsing time. Again, this works most of the time and can be more efficient, but if the IP address for the site has changed, you of course have a problem since you will be directed to the wrong web server. The only way to remedy this problem is by editing the HOSTS file and replacing the old IP with the new one, or removing the entry for that site completely, or by renaming or removing the HOSTS file so that the browser now is forced to inquire with the DNS server to find out the correct IP address.

Some of these explanations here are simplified for the purpose of keeping this article to a manageable size. The purpose of this article is to make you a little more familiar with IP addresses, what they’re good for and what goes on behind the scenes. If you are interested in knowing a lot more about IP addresses, check out 3com’s excellent article on the topic at http://www.3com.com/nsc/501302.html


– Alex –

Download this article as a self-extracting text file
View this article in printer-friendly plain-text format
E-mail this article to a friend

Leave a Comment:

skhan says

this is so usefull thanks for sharing..:)

Add Your Reply