docmirror/dev-sidecar · warning

[DNS-over-${this.dnsType}

Error message

[DNS-over-${this.dnsType} 

What it means

A DNS-over-HTTPS/TLS (DoH/DoT) query for a hostname completed but the response contained no answers for the requested record type, so the lookup returns an empty array. The library logs a warning naming the DNS provider (`dnsName`), `dnsType`, requested family, and query cost. This means the upstream DNS server simply has no record — not a network error.

Source

Thrown at packages/mitmproxy/src/lib/dns/base.js:200

    options.family = Number.parseInt(options.family) === 6 ? 6 : 4
    const type = options.family === 6 ? 'AAAA' : 'A'

    let response
    try {
      // 执行DNS查询
      log.debug(`[DNS-over-${this.dnsType} '${this.dnsName}'] query start: ${hostname}`)
      response = await this._doDnsQuery(hostname, type, start)
    } catch {
      // 异常日志在 _doDnsQuery已经打印过,这里就不再打印了
      return []
    }

    try {
      const cost = Date.now() - start
      log.debug(`[DNS-over-${this.dnsType} '${this.dnsName}'] query end: ${hostname}, cost: ${cost} ms, response:`, response)

      if (response == null || response.answers == null || response.answers.length == null || response.answers.length === 0) {
        log.warn(`[DNS-over-${this.dnsType} '${this.dnsName}'] 没有该域名的IPv${options.family}地址: ${hostname}, cost: ${cost} ms, response:`, response)
        return []
      }

      const ret = response.answers.filter(item => item.type === type).map(item => item.data)
      if (ret.length === 0) {
        log.info(`[DNS-over-${this.dnsType} '${this.dnsName}'] 没有该域名的IPv${options.family}地址: ${hostname}, cost: ${cost} ms`)
      } else {
        log.info(`[DNS-over-${this.dnsType} '${this.dnsName}'] 获取到该域名的IPv${options.family}地址: ${hostname} - ${JSON.stringify(ret)}, cost: ${cost} ms`)
      }

      return ret
    } catch (e) {
      log.error(`[DNS-over-${this.dnsType} '${this.dnsName}'] 解读响应失败,response:`, response, ', error:', e)
      return []
    }
  }

  _doDnsQuery (hostname, type = 'A', start) {

View on GitHub (pinned to 7710cd56cc)

Solutions

  1. Add a fallback DNS provider (e.g. a public UDP/TCP resolver) in dns config so empty answers can be retried elsewhere.
  2. Verify the hostname actually resolves (dig @provider example.com) and that the record type matches options.family.
  3. Point the domain at a different dnsMap entry whose provider holds the record, or remove custom DNS mapping for it to use default DNS.

Example fix

// before
"dnsMap": { "github.com": { "dnsType": "https", "dnsName": "doh.provider-a" } }
// after: add backup provider / fall back to default
"dnsMap": { "github.com": { "dnsType": "https", "dnsName": "1.12.12.12", "backup": ["223.5.5.5"] } }
Defensive patterns

Strategy: fallback

Try / catch

try { const r = await dohLookup(host) } catch (e) { return fallbackDns.lookup(host, options, cb) }
// treat empty result (r.length === 0) same as failure: fall back to default DNS

Prevention

When it happens

Trigger: Calling dns lookup (directly or via request handler) for a hostname that has no A/AAAA record on the configured DoH/DoT provider; querying a family (e.g. AAAA) the domain does not publish; a provider that returns an empty NOERROR response or NXDOMAIN-like empty answers.

Common situations: Accessing brand-new, internal-only, or expired domains through a filtered DNS provider; requesting IPv6-only resolution on IPv4-only domains; misconfigured dnsName pointing at a DNS service with incomplete zone data.

Related errors


AI-assisted analysis of docmirror/dev-sidecar@7710cd56cc (2026-08-31). Data as JSON: /api/errors/2e3523349b44b7ac. Report an issue: GitHub.