nerdexam
LPI

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.

The Linux Operating System

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)
  • A
    8% (3)
  • B
    3% (1)
  • C
    15% (6)
  • D
    72% (28)
  • E
    3% (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.

Acat /etc/net/dns.conf

/etc/net/dns.conf is not a real or standard path on any Linux distribution; no such file or directory structure exists by default.

Bifconfig -v dns

'ifconfig -v dns' is not a valid ifconfig syntax; ifconfig is used for network interface configuration and does not have a DNS query mode.

Cshow net dns

'show net dns' is a Cisco IOS-style command and is not valid in a Linux shell environment.

Dcat /etc/resolv.confCorrect

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.

Ecat /etc/net/nameserver.conf

/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

#DNS#resolv.conf#network configuration#nameserver

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice