Can I have your IP address ?

how to get to know the IP address of a computer


There can be several reasons that you need or want to know the IP address of a computer. Some reasons may be more legitimate than others. Maybe you're a network administrator and need to know the address to run some checks or to do some network configuration. You may also have something else in mind. Toy mau want to ask yourself first : You can ask a girl for her telephone number, so you can call her and ask her out or so. You can also try all kinds of sneaky tricks to find out who she is, where she lives and what her telephone number is. And then when you have her phone number, are you really going to call her - and maybe have to explain just how you got her number ? You may well have spoiled your chances, haven't you ?

local host

Each computer with TCP/IP set up has an IP address : 127.0.0.1, the 'localhost' or 'loopback' address.

this computer's address

When a computer is connected to a network, be it a Local Area Network or the internet, it has an IP address that identifies it on the network. The operating system usually offers a command that shows this IP address :

DOS TCP/IP users may try 'SET' to view environment variables, or look up the configuration files. See DOS TCP/IP.

ping

Ping is a useful command to find if a given IP address is 'online', and it will resolve names (computer names, URL's) to IP addresses when used like this :
ping localhost
ping (computer name), e.g. ping SERVER01
ping a fully qualified domain name, e.g. ping www.playboy.com or ping pop3.africaonline.com

netstat

with 'netstat', you can see the active connections of your computer. netstat has options to show either names or addresses, and you can give an interval to refresh, so that it checks and shows connections every , say, 12 seconds. Like this ;
netstat -a -n 12
'netstat /?' will show more options

So if you're computer has an active connection with another computer, e.g. by communication software or file exchange software such as netmeeting, ICQ, Kazaa and other peer-to-peer applications, ... netstat will show that computer's IP address, and the TCP port it is using to communicate with your computer.

Of course, when the communication passes trough a server (eg MSN chat), you'll only see the IP address of that server.

email message headers

When you receive an email message, a "Received from" line has been added to it by every server it passes. The 'received from' at the bottom of the list indicates the IP address of the computer the message was sent from. Most e-mail programs hide these message headers, but have an option to show them.

	Received: from mailagent0.ientrymail.com (66.28.139.14) by mail.tiscali.be (6.7.015)
        	id 3E9BA434502780F8 for sillyskriptkiddy@tiscali.be; Mon, 21 Apr 2003 2:37:49
	Received: from agent3.ientrymail.com (66.28.139.65) by mailagent0.ientrymail.com (PowerMTA(TM) v1.5)
	

log files

Your operating system, or other software on your computer (a fire wall, ...) may be able to log IP addresses of incoming and outgoing connections, or attempted connections.

tracert - traceroute

the tracert command (on Linux : traceroute) shows the IP addresses of all nodes (routers) between your computer and a remote computer.


		c:\windows>tracert pop3.tiscali.be
		Tracing route to pop3.tiscali.be [62.235.14.101]
		over maximum 30 hops:
		  1     2 ms     2 ms     2 ms  homepc [10.0.0.1]
 		  2    13 ms    15 ms    14 ms  D577G301.kabel.telenet.be [213.118.240.1]
 		  3    13 ms    13 ms    13 ms  10.32.10.193 
		  4    13 ms    13 ms    12 ms  10.31.1.97
 		  5    15 ms    13 ms    14 ms  D5E0FD91.kabel.telenet.be [213.224.253.145]
 		  6    17 ms    39 ms    16 ms  IBASSE02-SRP5-0.telenet-ops.be [213.224.126.10]
		  7    18 ms    17 ms    26 ms  213.224.126.174 
		  8    18 ms    18 ms    16 ms  212.3.238.5
 		  9    20 ms    16 ms    17 ms  unknown.Level3.net [212.3.239.99]
 		 10    18 ms    19 ms    17 ms  tiscali-intl.bnix.net [194.53.172.97]
 		 11    20 ms    17 ms    18 ms  tiscali-be-1.ip.tiscali.net [213.200.69.18]
 		 12    17 ms    18 ms    17 ms  62.235.3.209
 		 13    18 ms    18 ms    16 ms  62.235.14.101

 		Trace completed
	

web sites

Web sites can collect certain information about the computer that is used to visit them. (here's a small example). It is possible to apply a script that reads the IP address of the visiting computer, then use a method to send this information to a given e-mail adress (like when you fill in information on a web form or when using web mail). It is therefore possible to have a web site that collects and informs you about IP addresses of visitors. As explained here . You can also collect them from your web servers logs, hit counters, etc.

The "professional" way of finding IP addresses is by querying "whois" databases. Public IP addresses are registered to companies and this information is accessible in online databases through the unix 'whois' command or with online whois services. A typical starting point is the IP address or the domain name in a website's URL. explained here.