dns_resolver 0.1.3 copy "dns_resolver: ^0.1.3" to clipboard
dns_resolver: ^0.1.3 copied to clipboard

Dart package that implements DNS over HTTPS client for Google Public DNS and Cloudflare DNS.

example/example.md

Basic Usage #

Resolver will return DnsRecord or null if the domain is not found or error occurred. Take care about null safety.

import 'package:dns_resolver/dns_resolver.dart';

void main() async {
  var resolver = GoogleDnsResolver();
  var record = await resolver.resolve(
    "www.apple.com",
    DnsRecordType.A,
  );
  print(record);
}

Custom Resolver #

You may create a custom resolver by extending the Resolver class by baseUrl. Service must implement the DNS over HTTPS protocol with application/dns-json response type.

import 'package:dns_resolver/dns_resolver.dart';

class MyResolver extends Resolver {
  @override
  String baseUrl = 'https://my.custom.service/dns-query';
}
1
likes
150
points
63
downloads

Publisher

unverified uploader

Weekly Downloads

Dart package that implements DNS over HTTPS client for Google Public DNS and Cloudflare DNS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

http

More

Packages that depend on dns_resolver