public static boolean isValidName(String name){
    	if(name.length()==0) return false;
    	String dname = name.toLowerCase();
    	for(int i=0; i<dname.length(); i++){
    		char c = dname.charAt(i);
    		if(!((c>='0' && c<='9') || (c>='a' && c<='z') || c=='-'  || c=='.')) return false;
    	}
    	return (DNS.toInAddrArpa(dname)==null); // name is not valid IP-address
    }