Hi all,
I need to retrieve all subdomain from a domain, a friend provided a JAVA function, I need this function to return a list of domain names.
Can someone help me to implement the function in a #IF JAVA that return a list or array with domain names.
TIA Peter
I need to retrieve all subdomain from a domain, a friend provided a JAVA function, I need this function to return a list of domain names.
Can someone help me to implement the function in a #IF JAVA that return a list or array with domain names.
TIA Peter
Java:
void updateDnsList(){
// start a thread and do the DNS request
final AsyncTask<Void, Void, String[]> xxx = new AsyncTask<Void, Void, String[]>() {
@Override
protected String[] doInBackground(Void... params) {
Vector<String> listResult = new Vector<String>();
try {
// add all round robin servers one by one to select them separately
InetAddress[] list = InetAddress.getAllByName("some.domain.com");
for (InetAddress item : list) {
listResult.add(item.getCanonicalHostName());
}
} catch (UnknownHostException e) {
e.printStackTrace();
}
return listResult.toArray(new String[0]);
}
@Override
protected void onPostExecute(String[] result) {
// do something with the result
super.onPostExecute(result);
}
}.execute();
}
Last edited: