Open Supermathie opened 1 year ago
Dnsruby::Resolver.new(:nameserver => 'fe80::feed:face:c0ff:ee00%en0')
That only makes dnsruby not throw an exception immediately.
It still doesn't work, nor does it fix the problem when these LLAs are in the resolv.conf file
e.g.:
pry(main)> dns = Dnsruby::Resolver.new(nameserver: '192.168.1.51'); dns.query('www.google.ca').answer
=> [#<Dnsruby::RR::IN::A:0x000055a690c0f120
@address=#<Dnsruby::IPv4 142.251.41.67>,
@klass=IN,
@name=#<Dnsruby::Name: www.google.ca.>,
@rdata=#<Dnsruby::IPv4 142.251.41.67>,
@ttl=245,
@type=A>]
pry(main)> dns = Dnsruby::Resolver.new(:nameserver => 'fe80::5054:ff:fe8b:6576%br0'); dns.query('www.google.ca').answer
Dnsruby::ResolvTimeout: Query timed out - no nameservers configured
from /home/michael/.rvm/gems/ruby-2.6.6/gems/dnsruby-1.61.5/lib/dnsruby/resolver.rb:257:in `send_message'
# from shell, it works:
○ → host www.gooogle.ca fe80::5054:ff:fe8b:6576%br0
Using domain server:
Name: fe80::5054:ff:fe8b:6576%br0
Address: fe80::5054:ff:fe8b:6576%4#53
Aliases:
www.gooogle.ca has address 78.41.204.26
Yes, I'm sorry for my previous response - I shouldn't have attempted to do anything whilst suffering from Covid! Dnsruby does not currently support IPv6 link local addresses. It doesn't look like Ruby itself has support for them yet, in the IPAddr class. If you'd like to provide a patch for support for these addresses, I'd be very pleased to accept it! Otherwise, I think I will wait until the Ruby IPAddr class has support for them. It doesn't seem useful to provide a separate implementation in Dnsruby. Once IPAddr does have support, then I can move the resolver name servers to be IPAddr instances, rather than the DNS IPv6 and IPv6 classes. In the meantime, I think the answer is simply not to use Dnsruby with those addresses for name servers.
This is affecting one of our MacOS users who is using ruby 2.7.5 and dnsruby 1.61.5.
(separate bug, but interacts with #179 to cause an infinite loop for him)
His resolv.conf is:
which is valid since that's an interface-specific LLA, but
Dnsruby::Resolver.new.query(…)
hangs indefinitely, probably because of #179I can replicate this with:
though it returns after ~5s in my case, not creating an infinite loop.