Try example.test and lab.example.test as suffixes for short names.
Which resolv.conf line is appropriate?
search accepts multiple domain suffixes in order; it is distinct from the single-domain domain directive.
Detailed explanation
domain example.test lab.example.testIncorrect. domain is for one local domain, not a list.
Incorrect. domain is for one local domain, not a list.
search example.test lab.example.testCorrect. search lists the suffixes in order.
Correct. search lists the suffixes in order.
nameserver example.test lab.example.testIncorrect. nameserver expects server IP addresses.
Incorrect. nameserver expects server IP addresses.
options example.test,lab.example.testIncorrect. options controls resolver options, not search domains.
Incorrect. options controls resolver options, not search domains.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'search example.test lab.example.test' | awk '{ print $2; print $3 }'Expected result
example.test
lab.example.testKey points
- search supports multiple domains
- Order matters
- Separate from nameserver
Notes
- Environment: POSIX awkによるsearch list確認
- 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.