Skip to content

Error Codes & Status Mapping

DoHflare relies on standard HTTP status codes combined with custom headers (X-DOHFLARE-Code) for precise debugging without breaking the DNS payload format.

HTTP StatusInternal CodeDescription
200 OKN/ASuccessful resolution (Cache HIT or MISS).
400 Bad RequestN/AMissing dns parameter, invalid Base64URL, or malformed DNS query.
405 Method Not AllowedN/ARequest method is not GET, POST, or OPTIONS.
413 Payload Too LargeN/APOST body exceeds MAX_POST_BODY_BYTES.
415 Unsupported Media TypeN/AMissing or invalid Content-Type header in POST request.
502 Bad GatewayUPSTREAM_ERRUpstream resolvers are unreachable or returned an invalid response.
500 Internal Server ErrorINTERNAL_FATALUnhandled exception during payload parsing or cache writing.

Internal Parsing Errors (Captured in logs):

  • OOB_READ: Attempted to read out-of-bounds memory in the ArrayBuffer.
  • MALFORMED_LOOP: Detected an infinite pointer loop in the DNS name compression scheme.
  • PAYLOAD_TOO_LARGE: Upstream response exceeded MAX_CACHEABLE_BYTES.