LFCS Certification Network Service Configuration 5 — Questions and Answers
Question 1: Which command tests DNS resolution for the hostname 'example.com' using a specific nameserver at 8.8.8.8?
- nslookup example.com
- dig @8.8.8.8 example.com (Correct answer)
- host example.com 8.8.8.8
- resolveconf example.com 8.8.8.8
Correct answer: dig @8.8.8.8 example.com
dig's @ syntax directs the query to a specific nameserver, overriding /etc/resolv.conf.
Question 2: What does the 'Listen' directive in /etc/apache2/ports.conf or httpd.conf control?
- Which virtual hosts are active
- Which IP addresses and ports Apache binds to (Correct answer)
- The maximum number of simultaneous connections
- Which modules are loaded
Correct answer: Which IP addresses and ports Apache binds to
The Listen directive tells Apache which IP:port combinations to accept incoming connections on.
Question 3: Which command starts and enables a service to start at boot using systemd in a single step?
- systemctl start && systemctl enable sshd
- systemctl enable --now sshd (Correct answer)
- systemctl activate sshd
- service sshd enable-start
Correct answer: systemctl enable --now sshd
systemctl enable --now combines enabling at boot and immediately starting the service in one command.
Question 4: A web server needs to serve content over HTTPS. Which port must be open in the firewall by default?
- 80
- 8080
- 443 (Correct answer)
- 8443
Correct answer: 443
HTTPS uses TCP port 443 by default as defined in IANA port assignments.
Question 5: Which iptables command allows established and related traffic to pass through, supporting stateful inspection?
- iptables -A INPUT -m state --state NEW -j ACCEPT
- iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT (Correct answer)
- iptables -A INPUT -p tcp --syn -j ACCEPT
- iptables -A INPUT -j LOG
Correct answer: iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
The conntrack module with ESTABLISHED,RELATED states permits return traffic for existing connections.
Question 6: Which file in a BIND DNS server configuration defines the zone records for a domain?
- /etc/bind/named.conf.options
- /etc/resolv.conf
- The zone file referenced in named.conf.local (Correct answer)
- /etc/hosts
Correct answer: The zone file referenced in named.conf.local
Zone files (db.example.com) referenced by named.conf.local contain the actual DNS resource records.
Question 7: Which NetworkManager command brings up a previously configured connection named 'eth0'?
- ifup eth0
- nmcli con up eth0 (Correct answer)
- ip link set eth0 up
- network start eth0
Correct answer: nmcli con up eth0
nmcli con up activates a NetworkManager connection profile by name, applying all its settings.
Which command tests DNS resolution for the hostname 'example.com' using a specific nameserver at 8.8.8.8?