import javax.naming.*;
import javax.naming.directory.*;
+
+// FEATURE: use DNSJava for reverse lookups?
+// FEATURE: investigate other cool stuff in DNSJava we can use
public class DNSUtil {
public static String reverseLookup(InetAddress ip) throws IOException {
// FIXME we should be sorting here
mx = mx.substring(mx.indexOf(" ") + 1);
if (mx.charAt(mx.length() - 1) == '.') mx = mx.substring(0, mx.length() - 1);
- InetAddress ia = InetAddress.getByName(mx);
- if (ia.equals(IP.getIP(127,0,0,1)) || ia.isLoopbackAddress()) continue;
- ret[i++] = ia;
+ try {
+ InetAddress ia = InetAddress.getByName(mx);
+ if (ia.equals(IP.getIP(127,0,0,1)) || ia.isLoopbackAddress()) continue;
+ ret[i++] = ia;
+ } catch (Exception e) {
+ Log.info("safe to ignore", e);
+ }
}
}
} catch (Exception e) {