Class DnsLookup

java.lang.Object
org.dspace.statistics.util.DnsLookup

public class DnsLookup extends Object
XBill DNS resolver to retrieve host names for client IP addresses. TODO: deal with IPv6 addresses.
Author:
kevinvandevelde at atmire.com, ben at atmire.com
  • Method Details

    • 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.