docs: public static int doLookup(String hostName, String dnsType)
  			throws DNSLookupException {
  
  		// JNDI cannot take two-byte chars, so we convert the hostname into Punycode
  		hostName = UniPunyCode.toPunycodeIfPossible(hostName);
  
  		Hashtable<String, String> env = new Hashtable<String, String>();
  		env.put("java.naming.factory.initial",
  				"com.sun.jndi.dns.DnsContextFactory");
  
  		DirContext ictx;
  		try {
  			ictx = new InitialDirContext(env);
  		} catch (NamingException e) {
  			throw new DNSInitialContextException(e);
  		}
  
  		Attributes attrs;
  		try {
  			attrs = ictx.getAttributes(hostName, new String[] { dnsType });
  		} catch (NameNotFoundException e) {
  			// The hostname was not found or is invalid
  			return -1;
  		} catch (InvalidAttributeIdentifierException e) {
  			// The DNS type is invalid
  			throw new DNSInvalidTypeException(e);
  		} catch (NamingException e) {
  			// Unknown reason
  			throw new DNSLookupException(e);
  		}
  
  		Attribute attr = attrs.get(dnsType);
  		if (attr == null) {
  			return 0;
  		}
  		return attr.size();
  	}