super_dns_client 0.3.8
super_dns_client: ^0.3.8 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.
Changelog #
0.3.8 #
Fixed #
- Fixed InternetAddress type mismatch when building for Web by unifying imports through
package:universal_io/io.dart. - Ensured consistent
Future<List<InternetAddress>>return type across all platforms.
0.3.7 #
β¨ New Features #
- Native system DNS integration for Android and iOS:
- Android now retrieves DNS servers directly from
ConnectivityManager.getLinkProperties(). - iOS uses BSD resolver API (
res_ninit) to enumerate system DNS servers. - This provides more accurate results than previous fallback-based detection.
- Android now retrieves DNS servers directly from
π§ Refactor #
- Updated
SystemUdpSrvClientto use unifiedPlatformSystemDnsbridge (via MethodChannel). - Removed old
getpropandInternetAddress.lookup()fallback logic. - Restricted debug logs to debug mode (
assert()only). - Retained
/etc/resolv.confparsing for macOS and Linux.
π§© Example #
- Added a full example app for testing DNS resolution across Android, iOS, and Web.
- Example includes native verification of system DNS.
π Documentation #
- Updated
README.mdwith detailed explanation of native system DNS detection:- Android β
ConnectivityManager - iOS β
res_ninit - Linux/macOS β
/etc/resolv.conf - Web β not supported (use DoH)
- Android β
- Added platform-specific behavior table for clarity.
π§ͺ Tests #
- Stabilized
SystemUdpSrvClienttests to be cross-platform safe. - Ensured CI-friendly fallback for headless environments.
0.3.6 #
π οΈ Changed #
Set a default timeout value for the DNS client to improve request reliability.
0.3.5 #
π Fixed #
- Fixed System DNS resolution behavior on Android and iOS.
Since mobile platforms do not expose system DNS servers (getpropor/etc/resolv.confinaccessible in sandbox),
the resolver now falls back to the platformβs default DNS resolver automatically. - Updated
SystemUdpSrvClientto:- Remove unsupported system calls on Android/iOS.
- Use platform-resolved
InternetAddress.lookup()instead. - Keep
/etc/resolv.confparsing for Linux/macOS environments.
βοΈ Internal #
- Improved debug logs to clearly indicate when the client uses automatic platform DNS fallback.
- Ensured consistent behavior across Android, iOS, Linux, and macOS.
0.3.4 #
Changed #
- Replaced parallel SRV lookup with sequential lookup in DnsOverHttps to improve stability and resolver consistency.
- Ensured predictable fallback order between Google and Cloudflare resolvers.
- Minor code refactor for clarity and better logging around sequential resolution.
0.3.3 #
Changed #
- Updated dependency to
super_dns >=0.1.1to support Flutter Web builds. - Synchronized internal client implementation with stubbed DnsServer logic for web environments.
0.3.2 #
Fixed #
- Replaced all
dart:ioimports withuniversal_ioto support Flutter Web builds. - Fixed type mismatch error between
dart:ioanduniversal_ioInternetAddressclasses. - Ensured
DnsClientand related classes compile correctly on both mobile and web platforms.
0.3.1 #
π§ Public Exports #
- Exported all new SRV-related classes and clients in
super_dns_client.dart:BaseUdpSrvClientSystemUdpSrvClientPublicUdpSrvClientSrvRecordDnsResolverDnsClient
π§© Improvements #
- Ensured all new resolvers and models are available for external import.
- Minor cleanup and final formatting before release.
0.3.0 #
β¨ New Features #
- Added
BaseUdpSrvClientabstract class for shared SRV lookup logic. - Implemented:
SystemUdpSrvClient: queries SRV records via system-configured DNS (UDP β TCP fallback).PublicUdpSrvClient: queries SRV records via public resolvers (Quad9, AdGuard, Yandex, OpenDNS, etc.).DnsOverHttps.lookupSrvMulti(): sequential SRV lookup (Google β Cloudflare fallback).DnsOverHttps.lookupSrvParallel(): parallel SRV lookup (runs both resolvers simultaneously).
- Added
SrvRecordmodel for typed SRV response handling instead of generic Map. - Improved example
dns_client_example.dartto demonstrate all client types:- System resolver
- Public resolver
- DoH (Google, Cloudflare, Mullvad)
- Added complete test coverage for:
- UDP/TCP SRV clients
- DoH SRV (multi + parallel)
- System and public resolver detection
- Error fallback (UDP timeout β TCP)
- Refactored project structure:
lib/src/doh/ lib/src/udp_tcp/ lib/src/models/ example/dns_client_example.dart
βοΈ Improvements #
- Enhanced fallback logic between Google and Cloudflare DoH resolvers.
- Added English-only documentation comments for consistency.
- Improved debug logging for all SRV clients.
π§© Fixes #
- Better error handling for IPv6 and system DNS detection.
- Tests now handle dynamic DNS environments safely (no hardcoded IPs).
- Fixed internal method visibility and export paths.
π§ͺ Tests #
- Added new unit tests for:
DnsOverHttps.lookupSrvMulti()DnsOverHttps.lookupSrvParallel()
- Ensured 100% test coverage across DoH, UDP, and TCP clients.
π§ Misc #
- Updated GitHub workflows (
analyze.yml,test.yml). - Cleaned up comments and improved readability throughout the codebase.
0.2.1 #
0.2.0 #
β¨ New Features #
- Added DnsOverHttpsBinaryClient for binary DNS-over-HTTPS lookups (RFC 8484).
- Support for SRV record resolution over DoH.
- Added DnsResolver object model (
name,url,supportsGet,isTrusted). - Built-in non-GAFAM resolvers:
- Quad9
- AdGuard
- Yandex
- OpenDNS
- Mullvad (GET only)
βοΈ Improvements #
- Automatic GET/POST selection depending on resolver capability.
- Unified
lookup()andlookupDataByRRType()API with optionalresolverName. - Enhanced error handling for invalid resolvers and DoH failures.
π§ͺ Tests & Examples #
- Added unit tests for SRV and A record lookups via Quad9.
- Updated example to demonstrate both
DnsOverHttpsandDnsOverHttpsBinaryClientusage.
0.1.0 #
π Initial release of super_dns_client
- Added DNS-over-HTTPS client implementation
- Supported Google, Cloudflare, Quad9, and OpenDNS resolvers
- Supported record types:
A,AAAA,CNAME,SRV,TXT - Added base response model with
freezedandjson_serializable - Unit tests and CI configuration ready