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.