Compact DNS client library intended primary for network utilities and testing applications. It is fully compatible with Android 2.3 and newer and with standalone JRE 7 and newer.
- Initial support for DNS-over-HTTPS protocol
- Support additional records types
- Initial release
dependencies {
compile 'com.kendamasoft:dns-client:1.1.0'
}
<dependency>
<groupId>com.kendamasoft</groupId>
<artifactId>dns-client</artifactId>
<version>1.1.0</version>
</dependency>
import java.io.IOException;
import com.kendamasoft.dns.protocol.*;
public class DnsTest {
static public void main(String... args) throws IOException {
Message request = new MessageBuilder()
.setName("example.com")
.setType(RecordType.ANY)
.build();
Message response = new DnsConnectionAuto().doRequest(request);
for (ResourceRecord record : response.getAllRecords()) {
System.out.println(record);
}
}
}