Linux Networking 4 — Questions and Answers
Question 1: Which command queries a DNS server for information about a domain?
- dig (Correct answer)
- ping
- traceroute
- netstat
Correct answer: dig
`dig` (Domain Information Groper) queries DNS servers and displays detailed DNS records and responses.
Question 2: What does the `iptables -L` command do?
- Lists all current firewall rules (Correct answer)
- Loads a new ruleset from a file
- Links two network interfaces
- Logs dropped packets to syslog
Correct answer: Lists all current firewall rules
`iptables -L` lists all rules in all chains of the filter table, showing the current firewall policy.
Question 3: Which file configures systemd-networkd or NetworkManager for a network interface on modern systems?
- /etc/network/interfaces on Debian or /etc/sysconfig/network-scripts/ on RHEL (Correct answer)
- /etc/hosts
- /etc/resolv.conf
- /proc/net/dev
Correct answer: /etc/network/interfaces on Debian or /etc/sysconfig/network-scripts/ on RHEL
Interface configuration lives in `/etc/network/interfaces` on Debian-based systems or `/etc/sysconfig/network-scripts/` on RHEL-based systems.
Question 4: What does setting `net.ipv4.ip_forward=1` in `/etc/sysctl.conf` enable?
- IP packet forwarding between interfaces, enabling routing (Correct answer)
- Faster IPv4 DNS resolution
- IP address forwarding to a proxy server
- Faster TCP ACK forwarding
Correct answer: IP packet forwarding between interfaces, enabling routing
Enabling `ip_forward` allows the Linux kernel to forward packets between network interfaces, making the host act as a router.
Question 5: Which protocol does DHCP use at the transport layer?
- UDP (Correct answer)
- TCP
- ICMP
- SCTP
Correct answer: UDP
DHCP uses UDP (ports 67 for server, 68 for client) because clients need to broadcast before they have an IP address.
Question 6: What does the `mtr` command combine?
- ping and traceroute functionality (Correct answer)
- netstat and ss output
- dig and nslookup queries
- arp and ip neigh results
Correct answer: ping and traceroute functionality
`mtr` (Matt's Traceroute) combines continuous ping and traceroute into a real-time, interactive network diagnostic tool.
Question 7: What is the purpose of the `tc` command in Linux?
- Traffic control — shaping and scheduling network traffic (Correct answer)
- Testing connectivity to a remote host
- Tracing certificate chains for TLS
- Managing TCP connection timeouts
Correct answer: Traffic control — shaping and scheduling network traffic
`tc` (traffic control) configures Linux's built-in QoS features, allowing bandwidth limiting, traffic shaping, and packet scheduling.
Which command queries a DNS server for information about a domain?