Created
June 29, 2012 11:44
-
-
Save md-5/3017513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
String[] split = ip.split("\\."); | |
StringBuilder lookup = new StringBuilder(); | |
for (int i = split.length - 1; i >= 0; i--) { | |
lookup.append(split[i]); | |
lookup.append("."); | |
} | |
lookup.append("xbl.spamhaus.org."); | |
if (java.net.InetAddress.getByName(lookup.toString()) != null) { | |
return "Your IP address is flagged as unsafe by spamhaus.org/xbl"; | |
} | |
} catch (Exception ex) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment