LX0-104 · Question #527
Which of the following statements is true regarding the following /etc/resolv.conf file? search example.com nameserver 208.77.188.166 nameserver 208.77.188.167
The correct answer is D. example.com will be appended to host names when they do not contain dots.. In the provided /etc/resolv.conf file, the search example.com directive ensures that example.com will be appended to hostnames that do not contain any dots during DNS lookups.
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.
- Dexample.com will be appended to host names when they do not contain dots.
- EThe DNS server with the shortest ping time will be queried first. If the lookup fails, the second
How the community answered
(35 responses)- A3% (1)
- C6% (2)
- D89% (31)
- E3% (1)
Why each option
In the provided `/etc/resolv.conf` file, the `search example.com` directive ensures that `example.com` will be appended to hostnames that do not contain any dots during DNS lookups.
The provided `/etc/resolv.conf` file snippet `search example.com` and `nameserver 208.77.188.166 nameserver 208.77.188.167` uses correct syntax for configuring DNS resolution.
DNS queries to localhost are typically handled locally or fail if no local resolver is configured, and the `nameserver` entries are for querying external DNS servers, not for fallback from localhost failures.
`example.com` is not appended to *all* host lookups; it's specifically applied to unqualified hostnames (those without dots) or in some cases, partially qualified names where the initial lookup fails.
The `search` directive in `/etc/resolv.conf` specifies a domain suffix list. When the resolver attempts to resolve a hostname that is a single label (i.e., contains no dots), it appends each domain in the search list, in order, until a match is found or the list is exhausted.
The `nameserver` entries in `/etc/resolv.conf` are queried sequentially in the order they appear, with subsequent servers acting as fallbacks; there is no mechanism for querying based on shortest ping time.
Concept tested: DNS resolution with /etc/resolv.conf search directive
Source: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.