Skip to content

Conversation

@themichaelyang
Copy link

@themichaelyang themichaelyang commented Dec 20, 2025

Hi! I noticed that the documentation for getresource was missing a number of supported DNS resource types.

I also added a test to check every supported resource type.

Here's the irb snippet I wrote to get the typeclasses missing from the docs:

require "resolv"

documented = <<EOF
    # * Resolv::DNS::Resource::IN::A
    # * Resolv::DNS::Resource::IN::AAAA
    # * Resolv::DNS::Resource::IN::ANY
    # * Resolv::DNS::Resource::IN::CNAME
    # * Resolv::DNS::Resource::IN::HINFO
    # * Resolv::DNS::Resource::IN::MINFO
    # * Resolv::DNS::Resource::IN::MX
    # * Resolv::DNS::Resource::IN::NS
    # * Resolv::DNS::Resource::IN::PTR
    # * Resolv::DNS::Resource::IN::SOA
    # * Resolv::DNS::Resource::IN::TXT
    # * Resolv::DNS::Resource::IN::WKS
EOF
.split("\n").map { _1.split("::").last }

actual = Resolv::DNS::Resource::IN.constants.map(&:to_s)

p documented - actual # => []
p actual - documented # => ["CAA", "SRV", "ClassValue", "ServiceBinding", "LOC", "SVCB", "HTTPS"]

# `ClassValue` and `ServiceBinding` are constants but not valid resource types

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant