010-160 010-160 - LPI Linux Essentials Networking Basics Questions and Answers 1 — Questions and Answers
Question 1: Which command displays the IP address and network interface configuration on a Linux system?
- ip addr (Correct answer)
- ifconfig -a
- netstat -i
- route -n
Correct answer: ip addr
The `ip addr` command (from the iproute2 suite) shows all network interfaces and their assigned IP addresses on modern Linux systems.
Question 2: What command is used to test basic network connectivity by sending ICMP echo requests to a host?
- ping (Correct answer)
- traceroute
- netstat
- curl
Correct answer: ping
The `ping` command sends ICMP echo request packets to a target host and reports whether responses are received, testing basic network reachability.
Question 3: Which file on a Linux system maps hostnames to IP addresses locally without using DNS?
- /etc/hosts (Correct answer)
- /etc/hostname
- /etc/resolv.conf
- /etc/networks
Correct answer: /etc/hosts
The `/etc/hosts` file provides static hostname-to-IP mappings that are checked before DNS queries, allowing local name resolution overrides.
Question 4: What does the acronym DHCP stand for in Linux networking?
- Dynamic Host Configuration Protocol (Correct answer)
- Direct Host Control Protocol
- Distributed Host Connection Protocol
- Dynamic Hardware Configuration Program
Correct answer: Dynamic Host Configuration Protocol
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, gateways, and DNS servers to network clients.
Question 5: Which file specifies the DNS nameserver(s) that a Linux system should use for hostname resolution?
- /etc/resolv.conf (Correct answer)
- /etc/hosts
- /etc/nsswitch.conf
- /etc/dns.conf
Correct answer: /etc/resolv.conf
The `/etc/resolv.conf` file contains the IP addresses of DNS nameservers (prefixed with `nameserver`) that the system consults for DNS lookups.
Question 6: What is the loopback IP address in IPv4 that always refers to the local machine?
- 127.0.0.1 (Correct answer)
- 192.168.0.1
- 0.0.0.0
- 255.255.255.255
Correct answer: 127.0.0.1
The IPv4 loopback address 127.0.0.1 (also known as localhost) always refers to the local machine and is used for testing network services locally.
Which command displays the IP address and network interface configuration on a Linux system?