Configure the resolver to query DNS server 192.0.2.53 through /etc/resolv.conf.
Which line is appropriate?
resolv.conf uses nameserver followed by an IPv4 or IPv6 DNS server address.
Detailed explanation
nameserver 192.0.2.53Correct. nameserver specifies the DNS resolver address.
Correct. nameserver specifies the DNS resolver address.
server=192.0.2.53Incorrect. server= is not the resolv.conf directive.
Incorrect. server= is not the resolv.conf directive.
search 192.0.2.53Incorrect. search lists domain suffixes.
Incorrect. search lists domain suffixes.
hosts 192.0.2.53Incorrect. hosts is not a resolver-server directive.
Incorrect. hosts is not a resolver-server directive.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'nameserver 192.0.2.53' | cut -d' ' -f1,2Expected result
nameserver 192.0.2.53Key points
- nameserver directive
- IP address
- Different from search
Notes
- Environment: POSIX awkによるdirective確認
- 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.