Skip to content

Commit

Permalink
each_address should now resolve for AAAA first
Browse files Browse the repository at this point in the history
AAAA over A is standards track behaviour as per RFC 6724.
  • Loading branch information
Sadiq Saif authored and hsbt committed Oct 3, 2024
1 parent 366654e commit a8d1d94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resolv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,10 @@ def getaddresses(name)
# be a Resolv::IPv4 or Resolv::IPv6

def each_address(name)
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
if use_ipv6?
each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
end
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
end

def use_ipv6? # :nodoc:
Expand Down

0 comments on commit a8d1d94

Please sign in to comment.