super_dns_client 0.2.1
super_dns_client: ^0.2.1 copied to clipboard
A modern and lightweight Dart library for performing DNS-over-HTTPS (DoH) lookups. Supports multiple resolvers and easy integration for Flutter and server-side apps.
super_dns_client #
A modern and lightweight Dart library for performing DNS-over-HTTPS (DoH) lookups.
Supports multiple resolvers and can be easily integrated in Flutter or Dart server apps.
๐ Features #
- ๐ Query A, AAAA, CNAME, SRV, TXT records via DoH
- ๐ Support for multiple resolvers (Google, Cloudflare, Quad9, OpenDNS, etc.)
- ๐ง Simple high-level API for easy DNS lookups
- ๐งฑ Built with
http,freezed, andjson_serializable - โ Null-safe and fully tested
๐ฆ Installation #
Add this to your pubspec.yaml:
dependencies:
super_dns_client: ^0.1.0
Then run:
dart pub get
๐ก Usage #
import 'package:super_dns_client/super_dns_client.dart';
void main() async {
final client = DoHClient.resolver(DoHResolver.google);
final response = await client.lookup('example.com', DnsRecordType.A);
print('IPv4 addresses for example.com:');
for (final record in response.records) {
print('โ ${record.data}');
}
}
โ๏ธ Supported DoH Resolvers #
| Provider | Endpoint URL |
|---|---|
https://dns.google/dns-query |
|
| Cloudflare | https://cloudflare-dns.com/dns-query |
| Quad9 | https://dns.quad9.net/dns-query |
| OpenDNS | https://doh.opendns.com/dns-query |
๐งช Run Tests #
dart test
๐ชช License #
Licensed under the MIT License.
See the LICENSE file for more details.
โค๏ธ Contributing #
Pull requests and feature suggestions are welcome.
Open an issue at GitHub Issues if you find bugs or want to propose improvements.