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

Resolv cannot resolve address if resolv.conf first nameserver answers with SERVFAIL #23

Open
BobSilent opened this issue Jul 26, 2022 · 1 comment · May be fixed by #26
Open

Resolv cannot resolve address if resolv.conf first nameserver answers with SERVFAIL #23

BobSilent opened this issue Jul 26, 2022 · 1 comment · May be fixed by #26

Comments

@BobSilent
Copy link

BobSilent commented Jul 26, 2022

in a docker container environment my containers get created with the following resolv.conf

nameserver 172.24.160.1
nameserver 10.81.32.106
nameserver 10.81.32.104

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

#nameserver 172.24.160.1
nameserver 10.81.32.106
nameserver 10.81.32.104
BobSilent added a commit to BobSilent/dependabot-azure-devops that referenced this issue Oct 19, 2022
mburumaxwell pushed a commit to tinglesoftware/dependabot-azure-devops that referenced this issue Nov 9, 2022
@BobSilent
Copy link
Author

@hsbt what can I do here to get this merged?

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

Successfully merging a pull request may close this issue.

1 participant