Retrieving DNS SRV records on Android using service name

984 Views Asked by At

On android I want to find list of records just by using service name. I have tried api's like dnsjava and jmdns but all returned empty results. I have come across this similar Question but no one has answered it either:

Lightweight way to resolve DNS SRV records on Android

1

There are 1 best solutions below

0
On BEST ANSWER

You can use dnsjava library and use its Lookup class for that purpose. Like:

String recordName = _name._tcp.domainName.;

Lookup lookup = new Lookup(recordName, Type.SRV);

Records recs[] = lookup.run();