androiddnssrvdnsjava

Retrieving DNS SRV records on Android using service name


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


Solution

  • 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();