Skip to content

DNS error rcode type #785

Open
Open

Description

@sunfishcode

The DNS-error-payload type is currently defined as this:

  /// Defines the case payload type for `DNS-error` above:
  @since(version = 0.2.0)
  record DNS-error-payload {
    rcode: option<string>,
    info-code: option<u16>
  }

This has the rcode value be a string. However, DNS rcodes have standardized values that are defined in terms of u16 values.

With the current type being string, implementations appear to be using ad-hoc error messages which don't correspond to any standardized rcode value.

Activity

  1. pchickey commented on Sep 9, 2025

    @pchickey
    Contributor

    Also worth considering in wasi-sockets, which makes an ad-hoc mapping: https://github.com/WebAssembly/wasi-sockets/blob/main/wit/ip-name-lookup.wit#L42-L47

  2. sunfishcode commented on Oct 17, 2025

    @sunfishcode
    MemberAuthor

    Thinking about this more, I think having the precise u16 value isn't crucial, and at the same time, isn't easy for common implementations to provide. However in that case, the u16 info-code field is also not crucial, and also not easy for those same implementations. So I've now filed WebAssembly/wasi-http#204 to propose just having a simple string.

  3. lann commented on Oct 20, 2025

    @lann
    Contributor

    This kind of detail seems like it might fit better in a more focused wasi:dns interface, which seems like a perfectly sensible thing to have anyway for anything that goes beyond getaddrinfo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-httpProposal: wasi-http

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions