Package org.dspace.statistics.util
Class DnsLookup
- java.lang.Object
-
- org.dspace.statistics.util.DnsLookup
-
public class DnsLookup extends Object
XBill DNS resolver to retrieve hostnames for client IP addresses. TODO: deal with IPv6 addresses.- Author:
- kevinvandevelde at atmire.com, ben at atmire.com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringforward(String hostname)Resolve a host name to an IPv4 address.static StringreverseDns(String hostIp)Resolve an IP address to a host name.
-
-
-
Method Detail
-
reverseDns
public static String reverseDns(String hostIp) throws IOException
Resolve an IP address to a host name.- Parameters:
hostIp- dotted decimal IPv4 address.- Returns:
- name if resolved, or the address.
- Throws:
IOException- from infrastructure.
-
forward
public static String forward(String hostname) throws IOException
Resolve a host name to an IPv4 address.- Parameters:
hostname- hostname to resolve to IP- Returns:
- IPv4 address
- Throws:
IOException- from infrastructure or no resolution.
-
-