{"record":{"id":"2e3523349b44b7ac","repo":"docmirror/dev-sidecar","slug":"dns-over-this-dnstype","errorCode":null,"errorMessage":"[DNS-over-${this.dnsType} ","messagePattern":"\\[DNS-over-(.+?) ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mitmproxy/src/lib/dns/base.js","lineNumber":200,"sourceCode":"    options.family = Number.parseInt(options.family) === 6 ? 6 : 4\n    const type = options.family === 6 ? 'AAAA' : 'A'\n\n    let response\n    try {\n      // 执行DNS查询\n      log.debug(`[DNS-over-${this.dnsType} '${this.dnsName}'] query start: ${hostname}`)\n      response = await this._doDnsQuery(hostname, type, start)\n    } catch {\n      // 异常日志在 _doDnsQuery已经打印过，这里就不再打印了\n      return []\n    }\n\n    try {\n      const cost = Date.now() - start\n      log.debug(`[DNS-over-${this.dnsType} '${this.dnsName}'] query end: ${hostname}, cost: ${cost} ms, response:`, response)\n\n      if (response == null || response.answers == null || response.answers.length == null || response.answers.length === 0) {\n        log.warn(`[DNS-over-${this.dnsType} '${this.dnsName}'] 没有该域名的IPv${options.family}地址: ${hostname}, cost: ${cost} ms, response:`, response)\n        return []\n      }\n\n      const ret = response.answers.filter(item => item.type === type).map(item => item.data)\n      if (ret.length === 0) {\n        log.info(`[DNS-over-${this.dnsType} '${this.dnsName}'] 没有该域名的IPv${options.family}地址: ${hostname}, cost: ${cost} ms`)\n      } else {\n        log.info(`[DNS-over-${this.dnsType} '${this.dnsName}'] 获取到该域名的IPv${options.family}地址： ${hostname} - ${JSON.stringify(ret)}, cost: ${cost} ms`)\n      }\n\n      return ret\n    } catch (e) {\n      log.error(`[DNS-over-${this.dnsType} '${this.dnsName}'] 解读响应失败，response:`, response, ', error:', e)\n      return []\n    }\n  }\n\n  _doDnsQuery (hostname, type = 'A', start) {","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/mitmproxy/src/lib/dns/base.js#L182-L218","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a fallback DNS provider (e.g. a public UDP/TCP resolver) in dns config so empty answers can be retried elsewhere.","Verify the hostname actually resolves (dig @provider example.com) and that the record type matches options.family.","Point the domain at a different dnsMap entry whose provider holds the record, or remove custom DNS mapping for it to use default DNS."],"exampleFix":"// before\n\"dnsMap\": { \"github.com\": { \"dnsType\": \"https\", \"dnsName\": \"doh.provider-a\" } }\n// after: add backup provider / fall back to default\n\"dnsMap\": { \"github.com\": { \"dnsType\": \"https\", \"dnsName\": \"1.12.12.12\", \"backup\": [\"223.5.5.5\"] } }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const r = await dohLookup(host) } catch (e) { return fallbackDns.lookup(host, options, cb) }\n// treat empty result (r.length === 0) same as failure: fall back to default DNS","preventionTips":["Configure multiple DNS providers so empty answers can be retried","Verify hostnames exist with dig against the configured provider before mapping them","Match requested address family (options.family) to records the domain actually publishes"],"tags":["dns","doh","dot","empty-answer","resolution"],"backgroundTag":"dns-empty-answer","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}