dns_client 1.3.1 copy "dns_client: ^1.3.1" to clipboard
dns_client: ^1.3.1 copied to clipboard

Dart DNS-over-HTTPS (DoH) client supporting Google, Cloudflare, AdGuard, and Quad9 providers.

example/dns_client_example.dart

import 'package:dns_client/dns_client.dart';

void main() async {
  final dns = DnsOverHttps.google();
  final response = await dns.lookup('google.com');
  response.forEach((address) {
    print('DnsOverHttps.google::lookup:Address: ${address.toString()}');
  });

  final responseSRV = await dns.lookupDataByRRType(
    '_jmap._tcp.linagora.com',
    RRType.SRV,
  );
  responseSRV.forEach((address) {
    print('DnsOverHttps.google::lookupRRType:Address: ${address.toString()}');
  });

  final dnsCloudflare = DnsOverHttps.cloudflare();
  final responseSRVCloudflare = await dnsCloudflare.lookupDataByRRType(
    '_jmap._tcp.linagora.com',
    RRType.SRV,
  );
  responseSRVCloudflare.forEach((address) {
    print(
      'DnsOverHttps.cloudflare::lookupRRType:Address: ${address.toString()}',
    );
  });
}
14
likes
160
points
357
downloads

Publisher

verified publisheramond.dev

Weekly Downloads

Dart DNS-over-HTTPS (DoH) client supporting Google, Cloudflare, AdGuard, and Quad9 providers.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

equatable, freezed_annotation, http, http2, json_annotation

More

Packages that depend on dns_client