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 :, 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 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 or ping


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 ( by (6.7.015)
        	id 3E9BA434502780F8 for; Mon, 21 Apr 2003 2:37:49
	Received: from ( by (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.

		Tracing route to []
		over maximum 30 hops:
		  1     2 ms     2 ms     2 ms  homepc []
 		  2    13 ms    15 ms    14 ms []
 		  3    13 ms    13 ms    13 ms 
		  4    13 ms    13 ms    12 ms
 		  5    15 ms    13 ms    14 ms []
 		  6    17 ms    39 ms    16 ms []
		  7    18 ms    17 ms    26 ms 
		  8    18 ms    18 ms    16 ms
 		  9    20 ms    16 ms    17 ms []
 		 10    18 ms    19 ms    17 ms []
 		 11    20 ms    17 ms    18 ms []
 		 12    17 ms    18 ms    17 ms
 		 13    18 ms    18 ms    16 ms

 		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.