dns_resolver 0.0.1 dns_resolver: ^0.0.1 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 Resolver 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 = GoogleResolver();
var record = await resolver.resolve(
"www.apple.com",
DnsRecordType.A,
);
print(record);
}