Try this:
InetAddress address = InetAddress.getByName(new URL(urlString).getHost());
To get the raw IP:
String ip = address.getHostAddress();
More Related Contents:
- Getting the IP address of the current machine using Java
- Why does InetAddress.isReachable return false, when I can ping the IP address?
- Getting the ‘external’ IP address in Java
- Getting IP address of client [duplicate]
- Validate IPv4 address in Java
- How to enumerate IP addresses of all enabled NIC cards from Java?
- How can I determine the IP of my router/gateway in Java?
- what is the right way to get request’s ip [duplicate]
- Java getting my IP address
- How to extract IP Address in Spring MVC Controller get call?
- How can I convert IPV6 address to IPV4 address?
- Converting CIDR address to subnet mask and network address
- Fastest way to scan ports with Java
- How to check if an IP address is from a particular network/netmask in Java?
- Validating IPv4 string in Java
- Going from 127.0.0.1 to 2130706433, and back again
- Creating InetAddress object in Java
- Get real client IP in a Servlet [duplicate]
- How can I specify the local address on a java.net.URLConnection?
- How to use an HTTP proxy in java
- Find number of active sessions created from a given client IP
- Single role multiple IP addresses in Spring Security configuration
- Extract ip addresses from Strings using regex
- Getting value of public static final field/property of a class in Java via reflection
- Equivalent of C# anonymous methods in Java?
- How would I add an annotation to exclude a method from a jacoco code coverage report?
- Is it good to set the max and min JVM heap size the same?
- org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
- If-else working, switch not [duplicate]
- myLocationOverlay change the marker