the first one is the gateway machine which cannot resolve any internet names.
nslookup and ping are able to resolve address:
# nslookup google.com
;; Got SERVFAIL reply from 172.24.160.1, trying next server
Server: 10.81.32.106
Address: 10.81.32.106#53
Non-authoritative answer:
Name: google.com
Address: 142.250.185.206
;; Got SERVFAIL reply from 172.24.160.1, trying next server
Name: google.com
Address: 2607:f8b0:4006:80e::200e
# ping google.com
PING google.com (142.250.65.174) 56(84) bytes of data.
but resolv fails:
irb(main):001:0> require 'resolv'
=> true
irb(main):002:0> Resolv.getaddresses "google.com"
=> []
irb(main):003:0> Resolv.getaddress "google.com"
Traceback (most recent call last):
21: from ./.bundle/bin/irb:27:in `<main>'
20: from ./.bundle/bin/irb:27:in `load'
19: from /home/dependabot/dependabot-script/vendor/ruby/2.7.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
2: from (irb):3:in `<main>'
1: from /usr/local/lib/ruby/2.7.0/resolv.rb:44:in `getaddress'
/usr/local/lib/ruby/2.7.0/resolv.rb:94:in `getaddress': no address for google.com (Resolv::ResolvError)
irb(main):002:0> Resolv::DNS.new(:nameserver => ['10.81.32.104', '10.81.32.106'] ).getaddress "google.com"
=> #<Resolv::IPv4 142.250.65.174>
irb(main):003:0> Resolv::DNS.new(:nameserver => ['172.24.160.1', '10.81.32.104', '10.81.32.106'] ).getaddress "google.com"
Traceback (most recent call last):
20: from ./.bundle/bin/irb:27:in `<main>'
19: from ./.bundle/bin/irb:27:in `load'
18: from /home/dependabot/dependabot-script/vendor/ruby/2.7.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
1: from (irb):3:in `<main>'
/usr/local/lib/ruby/2.7.0/resolv.rb:379:in `getaddress': DNS result has no information for google.com (Resolv::ResolvError)
and it is also working if i remove the first nameserver in resolv.conf
in a docker container environment my containers get created with the following
resolv.conf
the first one is the gateway machine which cannot resolve any internet names.
nslookup and ping are able to resolve address:
but
resolv
fails:and it is also working if i remove the first
nameserver
inresolv.conf