How can I trace the IP address of person in chat?

Set up a web server and send them a link to something on it. Once they click the link, their IP address will be logged in your web server's access logs.

You could also host an image on said web server and trick a user into loading it through a third party's website. Some social networking sites allow you to upload snippets of HTML including image tags.

Note, when I say "their IP address" I am referring to whatever the address is after any NAT and proxying.


It depends on the protocol. If its ICQ/AIM style instant messaging, communication is done through a direct TCP connection to the other server [1]. Hence, you can turn on wireshark or another packet sniffer on your local machine and observe the IP address of everyone you are chatting with easily in ICQ/AIM.

If its Gchat style instant messaging (based on Jabber/XMPP protocol), when you send an instant message to someone the message first gets sent to one of google's servers, and then that server sends the message to the other computer [2] [3]. Their IP address does not seem to be recorded in any way in the logs google provides to the user. Thus, unless you work at google and have access to their internal logs you can't observe their IP address from chatting with them.

Granted as chao-mu mentioned, you can try asking them to directly connect to a server you control or have access to the logs (and then you can find their IP address). Also, that the IP address could be through a proxy (e.g., they sit at computer 1.2.3.4 but route all outgoing traffic through a proxy server 123.124.125.126) or could be be NAT, e.g., their cable modem has IP 1.2.3.4 is connected to a router that assigned their machine 192.168.1.100 (and the router can assign several other IP addresses 192.168.1.101 to other computers), but will look to the outside world as 1.2.3.4.


If the protocol uses P2P communication (directly from you to him) then you can see each other's IP address. Otherwise, you'll see the address of the server that is acting as the intermediary. You can view the addresses of all your current connections with the netstat command.