010-100 · Question #85
Which command shows, amongst other information, the IP address of the current DNS server for a Linux system?
The correct answer is D. cat /etc/resolv.conf. The /etc/resolv.conf file is the standard Linux configuration file that stores DNS resolver settings, including the IP address of the DNS nameserver(s) in use.
Question
Which command shows, amongst other information, the IP address of the current DNS server for a Linux system?
Options
- Acat /etc/net/dns.conf
- Bifconfig -v dns
- Cshow net dns
- Dcat /etc/resolv.conf
- Ecat /etc/net/nameserver.conf
How the community answered
(39 responses)- A8% (3)
- B3% (1)
- C15% (6)
- D72% (28)
- E3% (1)
Why each option
The /etc/resolv.conf file is the standard Linux configuration file that stores DNS resolver settings, including the IP address of the DNS nameserver(s) in use.
/etc/net/dns.conf is not a real or standard path on any Linux distribution; no such file or directory structure exists by default.
'ifconfig -v dns' is not a valid ifconfig syntax; ifconfig is used for network interface configuration and does not have a DNS query mode.
'show net dns' is a Cisco IOS-style command and is not valid in a Linux shell environment.
On Linux systems, /etc/resolv.conf is the resolver configuration file that contains the 'nameserver' directive followed by the IP address of the DNS server(s) configured for the system. Reading this file with 'cat' displays the current DNS server IP along with other resolver options such as search domains. This is a well-established POSIX standard location for DNS configuration.
/etc/net/nameserver.conf is not a standard Linux file path; DNS nameserver configuration belongs in /etc/resolv.conf, not this location.
Concept tested: Linux DNS resolver configuration file location
Source: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.