Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_resources filters out GLUE records #27

Open
felixonmars opened this issue Oct 28, 2022 · 0 comments
Open

extract_resources filters out GLUE records #27

felixonmars opened this issue Oct 28, 2022 · 0 comments

Comments

@felixonmars
Copy link

felixonmars commented Oct 28, 2022

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.

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

No branches or pull requests

1 participant