ruby / ruby/resolv

extract_resources filters out GLUE records

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
56
Forks
41
Avg merge
2h 38m
Merged PRs (30d)
7

Description

I would like to parse GLUE records from authoritative servers, but it seems extract_resources always filter out them because they fail the n0 == n check.

I could workaround it like:

Resolv::DNS.new(:nameserver => ["g.gtld-servers.net"]).fetch_resource("google.com", Resolv::DNS::Resource::IN::NS) {|reply, reply_name| reply.each_resource {|n, ttl, data| p (n,data)}
#<Resolv::DNS::Name: google.com.>
#<Resolv::DNS::Resource::IN::NS:0x0000557121f9c558 @name=#<Resolv::DNS::Name: ns2.google.com.>, @ttl=172800>                 
#<Resolv::DNS::Name: google.com.>                                                                                            
#<Resolv::DNS::Resource::IN::NS:0x0000557122016c90 @name=#<Resolv::DNS::Name: ns1.google.com.>, @ttl=172800>
#<Resolv::DNS::Name: google.com.>        
#<Resolv::DNS::Resource::IN::NS:0x0000557122015fe8 @name=#<Resolv::DNS::Name: ns3.google.com.>, @ttl=172800>
#<Resolv::DNS::Name: google.com.>        
#<Resolv::DNS::Resource::IN::NS:0x0000557122015688 @name=#<Resolv::DNS::Name: ns4.google.com.>, @ttl=172800>
#<Resolv::DNS::Name: ns2.google.com.>    
#<Resolv::DNS::Resource::IN::AAAA:0x0000557122014f80 @address=#<Resolv::IPv6 2001:4860:4802:34::a>, @ttl=172800>
#<Resolv::DNS::Name: ns2.google.com.>    
#<Resolv::DNS::Resource::IN::A:0x0000557122014850 @address=#<Resolv::IPv4 216.239.34.10>, @ttl=172800>
#<Resolv::DNS::Name: ns1.google.com.>    
#<Resolv::DNS::Resource::IN::AAAA:0x0000557122014148 @address=#<Resolv::IPv6 2001:4860:4802:32::a>, @ttl=172800>
#<Resolv::DNS::Name: ns1.google.com.>    
#<Resolv::DNS::Resource::IN::A:0x000055712200fa58 @address=#<Resolv::IPv4 216.239.32.10>, @ttl=172800>
#<Resolv::DNS::Name: ns3.google.com.>
#<Resolv::DNS::Resource::IN::AAAA:0x000055712200f3c8 @address=#<Resolv::IPv6 2001:4860:4802:36::a>, @ttl=172800>
#<Resolv::DNS::Name: ns3.google.com.>
#<Resolv::DNS::Resource::IN::A:0x000055712200ece8 @address=#<Resolv::IPv4 216.239.36.10>, @ttl=172800>
#<Resolv::DNS::Name: ns4.google.com.>
#<Resolv::DNS::Resource::IN::AAAA:0x000055712200e608 @address=#<Resolv::IPv6 2001:4860:4802:38::a>, @ttl=172800>
#<Resolv::DNS::Name: ns4.google.com.>
#<Resolv::DNS::Resource::IN::A:0x000055712200dd70 @address=#<Resolv::IPv4 216.239.38.10>, @ttl=172800>

It would still be good if there could be an option to disable the check and return [name, resource] pairs instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the extract_resources entry point and trace the n0 == n filtering check for GLUE records. Reproduce the authoritative-server example from the issue, then verify that the chosen behavior preserves the requested name/resource pairs and that the check can be disabled as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.