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

Dart package that implements DNS over HTTPS client

Dart package that implements DNS over HTTPS client

Features #

This package provides a simple way to resolve DNS queries using DNS over HTTPS (DoH) protocol. At the moment it supports Google Public DNS and Cloudflare Resolvers only. Resolver class implements DnsCache, so subsequent queries for the same domain will be resolved from cache. For simplicity, if the domain resolves to multiple IP addresses, only the last one will be returned.

TODO:

  • [*] add support for Cloudflare 1.1.1.1

Getting started #

With dart

dart pub add dns_resolver

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  dns_resolver: ^0.0.1

Usage #

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);
}
1
likes
0
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

Dart package that implements DNS over HTTPS client

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on dns_resolver