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
Fix for long wait in dig, when DNS servers are not set. #1319
Conversation
Also, maybe better use As DNS is an external view on the system which is also an external dependency we might want to be careful about depending on it. BTW, why not simply reduce the timeout and retries: |
Hi @schlomo
Good catch! With parameters proposed by you, timeout was reduced as well (surprise, surprise :-) ):
Now the question is, which approach is better to implement... @gdha, @jsmeix what is your opinion on this? V. |
I just updated check for nameserver in /etc/resolv.conf to be a bit simpler. |
@gozora [ $(grep -c '^[[:space:]]*nameserver' /etc/resolv.conf) -gt 0 ] and not what seems simpler grep -q '^[[:space:]]*nameserver' /etc/resolv.conf ? Regarding reducing timeout and retries directly in the 'dig' call: I would perfer that because the 'grep nameserver' |
For the fun of it just another case where the indirect test fails: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even on SLES10 "man dig" shows
the "+time=1 +tries=1" parameters
so that it should "just work" everywhere.
When no DNS server is defined in /etc/resolv.conf, every call to
dig
in 990_sysreqs.sh takes ~18 s to timeout.In summary, this caused on my SLES12 SP1 with two configured IP addresses to idle for 3 minutes:
This fix skips call to
dig
if no DNS server is defined in /etc/resolv.confV.