how to find the ip address code example

Example 1: get your ip address from terminal

for local ip :

hostname -I

for Public ip :

curl icanhazip.com

Example 2: how to find ip address

import java.net.InetAddress;
import java.net.UnknownHostException;
public class FindIPaddress {
	public static void main(String[] args) throws UnknownHostException {
		InetAddress a = InetAddress.getLocalHost();
		System.out.println(a.getHostAddress());	
	}
}

Example 3: how to find someone's ip address

Using the Command Prompt. On Windows devices, you can find an IP address for a website with the command prompt. ...
Examine the Header of an Incoming Email. When you want to find someone's IP address, an email from them is one of the best places to check. ...
Use an Online IP Lookup Tool.

Tags:

Html Example