Skip to content
pubscout

dns_client

1.3.1, released 10 months ago by amond.dev

Dart DNS-over-HTTPS (DoH) client supporting multiple providers and record types

$ flutter pub add dns_client
Source repository

What it does

Provides a Dart implementation of DNS-over-HTTPS (DoH) supporting Google, Cloudflare, AdGuard, NextDNS, Quad9, and OpenDNS. It resolves hostnames to IP addresses, supports 36 DNS record types, and includes wire format and privacy protection features.

AI-written summary of version 1.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to perform DNS lookups via HTTPS in a Dart or Flutter application
  • You want to use specific DNS providers like Cloudflare, Google, AdGuard, or Quad9
  • You need to query specific DNS record types such as MX, TXT, SRV, or HTTPS

Skip it when

  • You rely entirely on the platform's standard built-in DNS resolution without custom DoH requirements

Strengths

  • Supports multiple popular DoH providers
  • Comprehensive coverage of 36 DNS record types
  • Wire format support with HTTP/2
  • Includes privacy features and error handling

Weaknesses

  • Requires Dart SDK 3.7.0 or later

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
5

not documented

import 'package:dns_client/dns_client.dart';

void main() async {
  final dns = DnsOverHttps.google();

  final addresses = await dns.lookup('google.com');
  for (final address in addresses) {
    print(address.address);
  }

  dns.close();
}

Alternatives

Packages that do the same job and could replace dns_client.

  • cronet_http

    An Android Flutter plugin providing access to the Cronet HTTP client.

  • sync_http

    Synchronous HTTP client for Dart using RawSynchronousSockets.

  • talker_http_logger

    Lightweight and customizable HTTP client logger based on Talker for Dart and Flutter.

  • centrifuge

    Dart client for real‑time communication with Centrifuge/Centrifugo over WebSockets.

Works with

Packages commonly used together with dns_client: ones it builds on, ones built on it, and its own family.