For a glibc resolver, wait two seconds per DNS attempt and try three times.
Choose the options line for /etc/resolv.conf.
Which line is appropriate?
glibc-style resolv.conf uses options timeout:2 attempts:3 to set wait time and retry count.
Detailed explanation
timeout 2 attempts 3Incorrect. It lacks the options directive and colon syntax.
Incorrect. It lacks the options directive and colon syntax.
nameserver timeout:2 attempts:3Incorrect. nameserver is for resolver addresses.
Incorrect. nameserver is for resolver addresses.
options timeout:2 attempts:3Correct. It sets the requested timeout and attempts values.
Correct. It sets the requested timeout and attempts values.
search timeout=2 attempts=3Incorrect. search is for domain suffixes and does not use this syntax.
Incorrect. search is for domain suffixes and does not use this syntax.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'options timeout:2 attempts:3' | awk '{print $1, $2, $3}'Expected result
options timeout:2 attempts:3Key points
- Use the options line
- timeout is seconds
- attempts is retry count
Notes
- Environment: POSIX awk / 一時標準入力のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.