published by Mattias Ohlsson on Sat, 2012-01-28 22:14
This guide applies to:
Java
Use this function to get the first txt record from DNS.
Example: String myTxtRecord = getTxtRecord("inprose.com");
public static String getTxtRecord(String hostName) {
// Get the first TXT record
java.util.Hashtable<String, String> env = new java.util.Hashtable<String, String>();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");