LX0-104 · Question #670
Which of the following statements is valid in the file /etc/resolv.conf?
The correct answer is D. domain example.com. The /etc/resolv.conf file is used to configure DNS name resolution settings, where domain specifies the local domain name to be used for unqualified hostnames.
Question
Options
- Aorder hosts, bind
- B192.168.168.4 dns server
- Chosts: files, dns
- Ddomain example.com
How the community answered
(28 responses)- B4% (1)
- C4% (1)
- D93% (26)
Why each option
The `/etc/resolv.conf` file is used to configure DNS name resolution settings, where `domain` specifies the local domain name to be used for unqualified hostnames.
`order hosts, bind` is a directive typically found in `/etc/host.conf`, not `/etc/resolv.conf`, for configuring host lookup order.
`192.168.168.4 dns server` is an invalid syntax for specifying a nameserver; the correct syntax is `nameserver 192.168.168.4`.
`hosts: files, dns` is a configuration line for `/etc/nsswitch.conf`, which determines the order of name service lookups, and is not valid in `/etc/resolv.conf`.
The `domain example.com` statement is a valid entry in `/etc/resolv.conf` that defines the default domain name to append to unqualified hostnames when performing DNS lookups, allowing for simpler hostname resolution within a local domain.
Concept tested: /etc/resolv.conf syntax
Source: https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.