Closed svdasein closed 9 months ago
Ok - I figured this out. For anyone who runs into this, here's the right way:
server1 = Dnsruby::Resolver.new({nameserver: opts[:nameserver1], src_address: opts[:sourceaddr], do_caching: false})
server2 = Dnsruby::Resolver.new({nameserver: opts[:nameserver2], src_address: opts[:sourceaddr], do_caching: false})
The important bit being do_caching: false
I'm not sure if I'm doing something wrong here... I'm writing a script to make queries of two separate dns servers at two different IP addresses. I'm setting up for that like this:
And making two calls like this:
The confusing part is this: If I query the first server for a name that only it has, res1 contains an answer that is correct and also shows answerfrom from the appropriate server. res2 however ALSO contains an answer - it looks remarkably like the answer I just got for server1 - the only difference between the two is that res2's answerfrom is nil.
It seems like the server2 result is somehow picking up the answer from the last question that server1 asked.
Do I need to do this differently or is that "as designed" ?
---- addendum:
I've tried executing the one that should fail first - if I do that I get an NXDOMAIN exception. If I do it in the other order I do not.
Is there a work around for this?