Skip to content

Feature Request: Support alternative DoH request methods (e.g., POST with JSON) #916

@rz467fzs7d

Description

@rz467fzs7d

Description

Currently, mosdns only supports RFC 8484 standard DoH (GET with base64url encoding). However, some major DNS providers like doh.pub (Tencent DNSPod) only support non-standard DoH methods:

  1. doh.pub: Returns 502 when using RFC 8484 GET method, but works with URL parameter format (?name=domain&type=A)
  2. Other providers may have similar issues

Request

Would you consider adding an option to support alternative DoH request methods? For example:

upstreams:
  - addr: \"https://doh.pub/dns-query\"
    doh_method: \"GET\"  # default, RFC 8484
    # or
    doh_method: \"POST\"  # alternative

Or alternatively, auto-detect and fallback?

Test Results

  • RFC 8484 GET: https://doh.pub/dns-query?dns=<base64> → 502 Bad Gateway
  • URL parameter: https://doh.pub/dns-query?name=baidu.com&type=A → Works fine

This issue affects usability with some popular Chinese DNS providers.

Environment

  • mosdns version: v5.3.x
  • Server: Linux/OpenWrt

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions