Пример #1
0
 /**
  * Converts an String containing an IP address in dotted quad form into the corresponding domain
  * name. ex. 127.0.0.1 -> 1.0.0.127.IN-ADDR.ARPA.
  *
  * @return A String containing the domain name.
  */
 public static String inaddrString(String s) {
   try {
     return ReverseMap.fromAddress(s).toString();
   } catch (UnknownHostException e) {
     return null;
   }
 }
Пример #2
0
 /**
  * Converts an InetAddress into the corresponding domain name (127.0.0.1 ->
  * 1.0.0.127.IN-ADDR.ARPA.)
  *
  * @return A String containing the domain name.
  */
 public static String inaddrString(InetAddress addr) {
   return ReverseMap.fromAddress(addr).toString();
 }