LFCS · 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. The search directive in /etc/resolv.conf specifies domain names to append to unqualified hostnames (those without 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
(57 responses)- A2% (1)
- B2% (1)
- C2% (1)
- D88% (50)
- E7% (4)
Why each option
The `search` directive in `/etc/resolv.conf` specifies domain names to append to unqualified hostnames (those without dots) during DNS lookups.
The provided `/etc/resolv.conf` file has correct syntax for both `search` and `nameserver` directives.
The `/etc/resolv.conf` file does not specify localhost (127.0.0.1) as a nameserver; DNS queries would go directly to the listed nameservers in order.
`example.com` is appended only to unqualified hostnames (those without dots), not to all host lookups, as fully qualified domain names are resolved as-is.
The `search` directive in `/etc/resolv.conf` defines a list of domain names that the resolver will automatically append to hostnames that do not contain any dots. This means if you query for `webserver`, the resolver will first try `webserver.example.com`.
DNS resolvers typically query nameservers in the order they are listed in `/etc/resolv.conf` (208.77.188.166 then 208.77.188.167), not based on ping time or network latency.
Concept tested: DNS resolver configuration (`/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.