LX0-104 · Question #277
Which of the following statements is true regarding the below /etc/resolv.conf file? search example.com 127.0.0.1 208.77.188.166
The correct answer is A. There is a syntax error.. The provided /etc/resolv.conf entry contains a syntax error because IP addresses are incorrectly listed on the search directive line instead of using the nameserver directive.
Question
Options
- AThere is a syntax error.
- BIf DNS queries to the localhost fail, the server 208.77.188.166 will be queried.
- Cexample.com will be appended to all host lookups.
- DThe DNS servers at 127.0.0.1 and 208.77.188.166 will be queried in a round robin fashion.
- EThe DNS server with the shortest ping time will be queried first. If the lookup fails, the second server
How the community answered
(32 responses)- A78% (25)
- C3% (1)
- D6% (2)
- E13% (4)
Why each option
The provided /etc/resolv.conf entry contains a syntax error because IP addresses are incorrectly listed on the `search` directive line instead of using the `nameserver` directive.
The `search` directive in /etc/resolv.conf is used to specify a list of domain suffixes to append to hostnames that are not fully qualified. IP addresses like 127.0.0.1 and 208.77.188.166 are only valid arguments for the `nameserver` directive, making the given line syntactically incorrect.
The entry is syntactically incorrect, so its behavior for failover cannot be reliably predicted as described.
While `example.com` would typically be appended to host lookups if correctly configured as a `search` domain, the line's inclusion of IP addresses on the `search` line makes the entire entry a syntax error.
DNS servers are queried in the order they appear with the `nameserver` directive, not round-robin, and these IPs are not correctly specified as nameservers.
DNS server selection is based on the order in the `nameserver` directives, not ping time, and these IPs are not correctly specified as nameservers.
Concept tested: /etc/resolv.conf syntax and directives
Source: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.