LPIC 1 102-500 Practice Questions with Explanations
Free LPIC 1 102-500 practice questions. 20 of them, each with the correct answer, a full explanation, and the reason every other option is wrong. These are real questions from the 102-500 exam, not paraphrases, and every explanation is written out rather than just marking the right letter.
They are drawn from the same bank as the full 102-500 pack, which has 120 questions in total.
Get the full 102-500 question bank (120 questions) →
102-500 practice questions
Question 1
Which of the following is a valid IPv6 address?
- A. 2001:db8:0g21::1
- B. 2001::db8:4581::1
- C. 2001:db8:3241::1
- D. 2001%db8%9990%%1
- E. 2001.db8.819f..1
Show answer and explanation ▾
Correct answer: C
2001:db8:3241::1 is a valid IPv6 address using proper hexadecimal notation (0-9, a-f) and the :: compression for consecutive zero groups. Option A contains 'g' which is not a valid hexadecimal character. Option B uses :: twice which violates IPv6 compression rules. Option D uses % delimiters instead of colons. Option E uses dots and contains consecutive dots instead of proper IPv6 notation.
Why the other options are wrong:
- A. Contains the character 'g' which is not valid in hexadecimal notation.
- B. Uses the :: compression twice, which is not permitted in IPv6 addresses.
- D. Uses percent signs (%) instead of colons as separators.
- E. Uses dots instead of colons and has malformed consecutive dots.
Question 2
Which if the following tools, used for DNS debugging, reports not only the response from the name sever but also details about the query?
- A. dnsq
- B. hostname
- C. dig
- D. dnslookup
- E. zoneinfo
Show answer and explanation ▾
Correct answer: C
dig (Domain Information Groper) is the standard DNS debugging tool that provides detailed information about both the query sent and the response received from the name server, including query flags, response codes, and authoritative answers. hostname is a simple utility for displaying the system hostname. dnslookup is an older, less detailed tool. dnsq and zoneinfo are not standard DNS debugging utilities.
Why the other options are wrong:
- A. dnsq is not a standard DNS debugging tool.
- B. hostname only displays the system hostname, not DNS query details.
- D. nslookup is older and less detailed than dig for DNS debugging.
- E. zoneinfo is not a recognized DNS debugging utility.
Question 3
Which of the following statements is valid in the file /etc/nsswitch.conf?
- A. multi on
- B. 192.168.168.4 dns-server
- C. namespaces: net mount procs
- D. include /etc/nsswitch.d/
- E. hosts: files dns
Show answer and explanation ▾
Correct answer: E
The line 'hosts: files dns' is a valid nsswitch.conf statement that specifies the order in which name resolution sources are consulted for hostname lookups (first files, then DNS). Option A uses invalid syntax. Option B mixes IP addresses with DNS configuration incorrectly. Option C uses invalid namespace declaration. Option D attempts to include a directory which is not a valid nsswitch.conf feature.
Why the other options are wrong:
- A. "multi on" is not valid syntax in nsswitch.conf.
- B. IP addresses cannot be specified this way in nsswitch.conf for DNS servers.
- C. The "namespaces:" statement with this syntax is not valid in nsswitch.conf.
- D. nsswitch.conf does not support directory inclusion via the include directive.
Question 4
On a Linux workstation, the route command takes a long time before printing out the routing table. Which of the following errors does that indicate?
- A. The local routing information may be corrupted and must be re-validated using a routing protocol.
- B. One of the routers in the routing table is not available which causes the automatic router failure detection mechanism (ARFD) to wait for a timeout.
- C. There may accidentally be more than one default router in which case a default router election has to be done on the network in order to choose one router as the default.
- D. The Linux Kernel Routing Daemon (LKRD) is not running and should be started using its init script or systemd unit.
- E. DNS resolution may not be working as route by default tries to resolve names of routers and destinations and may run into a timeout.
Show answer and explanation ▾
Correct answer: E
The route command displays a delay when DNS resolution is not working properly because it attempts to resolve hostnames of routers and destinations by default, causing timeouts when DNS queries fail. The other options describe non-existent mechanisms or incorrect troubleshooting approaches for this symptom.
Why the other options are wrong:
- A. Automatic route re-validation is not a standard Linux feature that would cause this delay.
- B. ARFD (Automatic Router Failure Detection) is not a standard Linux kernel mechanism.
- C. Default router election is not an automatic workstation-level feature in this manner.
- D. The Linux Kernel Routing Daemon (LKRD) is not a real daemon; delay is not caused by missing routing daemons.
Question 5
What is true about the Hop Limit field in the IPv6 header?
- A. The field is not changed during the transport of a package.
- B. The field is transmitted within a hop-by-hop extension header.
- C. Each router forwarding the packet increases the field's value.
- D. Each router forwarding the packet decreases the field's value.
- E. For multicast packages, the field's value is always 1.
Show answer and explanation ▾
Correct answer: D
The Hop Limit field in the IPv6 header is decremented by one at each router that forwards the packet, similar to the TTL field in IPv4. This prevents packets from circulating indefinitely in the network. The field is a regular part of the main IPv6 header, not an extension header, and is changed during transport.
Why the other options are wrong:
- A. The Hop Limit field is actively modified (decremented) during packet transport.
- B. The Hop Limit is part of the main IPv6 header, not a hop-by-hop extension header.
- C. Each router decreases the field, not increases it.
- E. Multicast packets do not have special Hop Limit restrictions; the field can have various values.
Question 6
How many IP addresses can be used for unique hosts inside the IPv4 subnet 192.168.2.128/26?
- A. 6
- B. 14
- C. 30
- D. 62
- E. 126
Show answer and explanation ▾
Correct answer: D
A /26 subnet has 26 bits for the network and 32-26=6 bits for hosts. With 6 host bits, there are 2^6=64 total addresses. Subtracting 2 addresses (network and broadcast), 64-2=62 usable host addresses remain.
Why the other options are wrong:
- A. 6 is the number of host bits, not usable addresses.
- B. 14 would result from a /28 subnet, not /26.
- C. 30 is the usable count for a /27 subnet.
- E. 126 is the usable count for a /25 subnet.
Question 7
Which of the following statements is true if the UID of a regular user is identical to the GID of a group?
- A. UID have precedence over GIDs, therefore the user is available while the group doesn't.
- B. The user as well as the group are not available to avoid ambiguity due to the ID conflict.
- C. UIDs and GIDs are independent of each other, therefore the user as well as the group are still available.
- D. The user is the only member of the group, even if the group configuration contains other members.
- E. GIDs have precedence over UIDs, therefore the group is available while the user isn't.
Show answer and explanation ▾
Correct answer: C
UIDs and GIDs operate in separate namespaces within Linux systems. A user can have the same numeric ID as a group because the system treats them independently-the kernel uses the context (user vs. group) to determine which namespace to reference, so both can coexist without conflict.
Why the other options are wrong:
- A. UIDs do not have precedence over GIDs; they operate in separate namespaces.
- B. Neither the user nor the group is made unavailable; both remain usable.
- D. A matching UID and GID does not imply group membership.
- E. GIDs do not have precedence over UIDs; they are independent.
Question 8
Which of the following information is stored in /etc/shadow for each user?
- A. The timestamp of the user's last login
- B. The user's private SSH keys
- C. The hashed password of the user
- D. The numerical user ID (UID)
- E. The path to the user's home directory
Show answer and explanation ▾
Correct answer: C
/etc/shadow contains hashed passwords for user accounts, along with password aging information like expiration dates and change history. This file is readable only by root to protect password hashes from unauthorized access.
Why the other options are wrong:
- A. Last login timestamps are stored in /var/log/lastlog or wtmp, not /etc/shadow.
- B. Private SSH keys are stored in the user's ~/.ssh directory, not /etc/shadow.
- D. The UID is stored in /etc/passwd, not /etc/shadow.
- E. The home directory path is stored in /etc/passwd, not /etc/shadow.
Question 9
Which of the following commands shows all active systemd timers?
- A. systemctl-timer show
- B. timectl list
- C. systemctl -t
- D. systemctl list-timers
- E. timeq
Show answer and explanation ▾
Correct answer: D
The command systemctl list-timers displays all active and inactive systemd timer units with their next scheduled execution times and last trigger information.
Why the other options are wrong:
- A. systemctl-timer show is not a valid command syntax.
- B. timectl list is not a standard systemd command for listing timers.
- C. systemctl -t is incomplete; the full command requires 'timer' as an argument.
- E. timeq is not a real command.
Question 10
What is true about the file /etc/localtime?
- A. It is a plain text file containing a string such as Europe/Berlin
- B. It is created and maintained by the NTP service based on the location of the system's IP address.
- C. It is a symlink to /sys/device/clock/ltime and always contains the current local time.
- D. After changing this file, newtzconfig has to be run to make the changes effective.
- E. It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/Europe/Berlin.
Show answer and explanation ▾
Correct answer: E
/etc/localtime is the system's timezone configuration file and is either a symlink pointing to or a copy of a timezone information file located in /usr/share/zoneinfo/ (such as /usr/share/zoneinfo/Europe/Berlin). This is the standard mechanism Linux uses to configure the system's local timezone.
Why the other options are wrong:
- A. It is not a plain text file containing a string; it is a binary timezone database file or symlink.
- B. NTP services do not create or maintain /etc/localtime based on IP geolocation; timezone is configured independently.
- C. It is not a symlink to /sys/device/clock/ltime, and it does not contain the current time but rather timezone definition data.
- D. There is no command called newtzconfig; timezone changes take effect immediately without running additional commands.
Question 11
Which of the following statements is true regarding systemd timer units?
- A. Timer units can only be defined within a service unit's file.
- B. The command executed by the timer is specified in the timer unit's [Cmd] section.
- C. A dedicated system service, systemd-cron, handles the execution of timer units.
- D. Timer units only exist in the system scope and are not available for users.
- E. Each systemd timer unit controls a specific systemd service unit.
Show answer and explanation ▾
Correct answer: E
Each systemd timer unit is paired with and controls a corresponding systemd service unit that performs the actual work. Timer units define when actions should occur, while service units define what actions to perform. The timer unit's Unit= directive specifies which service unit it activates.
Why the other options are wrong:
- A. Timer units are defined in separate .timer files, not within service unit files.
- B. Commands are specified in the associated service unit file, not in the timer unit's [Cmd] section.
- C. There is no systemd-cron service; systemd-run and the timer mechanism are built into systemd itself.
- D. Timer units are available in both system and user scopes via --user flag.
Question 12
Which of the following commands should be executed when starting a login shell in order to change the language of messages for an internationalized program to Portuguese (pt)?
- A. export LANGUAGE="pt"
- B. export LC_MESSAGES="pt"
- C. export UI_MESSAGES="pt"
- D. export MESSAGE="pt"
- E. export ALL_MESSAGES="pt"
Show answer and explanation ▾
Correct answer: B
LC_MESSAGES is the correct locale environment variable that controls the language of messages displayed by internationalized programs. Setting export LC_MESSAGES="pt" configures Portuguese language for program messages. This is part of the standard POSIX locale mechanism.
Why the other options are wrong:
- A. LANGUAGE is not the standard locale variable for message translation; LC_MESSAGES is the proper variable.
- C. UI_MESSAGES is not a recognized locale variable.
- D. MESSAGE is not a valid locale environment variable.
- E. ALL_MESSAGES is not a standard locale variable.
Question 13
Which of the following files assigns a user to its primary group?
- A. /etc/pgroup
- B. /etc/shadow
- C. /etc/passwd
- D. /etc/group
- E. /etc/gshadow
Show answer and explanation ▾
Correct answer: C
/etc/passwd assigns each user to their primary group via the GID field (the 4th colon- separated field in each user entry). This file contains the definitive mapping of users to their primary group IDs.
Why the other options are wrong:
- A. /etc/pgroup does not exist as a standard Linux file.
- B. /etc/shadow contains password information, not group assignments.
- D. /etc/group defines groups and their secondary members, not primary group assignments.
- E. /etc/gshadow contains group password information, not primary group assignments.
Question 14
Which of the following steps prevents a user from obtaining an interactive login session?
- A. Setting the UID for the user to 0.
- B. Running the command chsh -s /bin/false with the user name.
- C. Removing the user from the group staff.
- D. Adding the user to /etc/noaccess.
- E. Creating a .nologin file in the user's home directory.
Show answer and explanation ▾
Correct answer: B
Running chsh -s /bin/false sets the user's login shell to /bin/false, which is a non-functional shell that prevents the user from obtaining an interactive login session. This is the standard method to disable login access while keeping the account active.
Why the other options are wrong:
- A. Setting UID to 0 makes the user a root-equivalent account, granting access rather than preventing it.
- C. Removing a user from the staff group does not prevent login; it only affects group permissions.
- D. /etc/noaccess is not a standard Linux file for controlling access.
- E. .nologin in the home directory is not a standard mechanism; it is typically checked only at the system level (/etc/nologin), and user-level .nologin files are not enforced by default.
Question 15
Which option in the chrony configuration file changes the initial interval of polls to a NTP server in order to speed up the initial synchronization?
- A. iburst
- B. quickstart
- C. fast
- D. fsync
- E. flood
Show answer and explanation ▾
Correct answer: A
The iburst option in the chrony configuration file speeds up the initial synchronization by sending a burst of eight packets instead of the standard single packet during the initial connection phase. This allows faster convergence to the correct time.
Why the other options are wrong:
- B. quickstart is not a standard chrony configuration option.
- C. fast is not a standard chrony option for initial synchronization.
- D. fsync is not a chrony configuration option.
- E. flood is not a standard chrony option; iburst is the correct option for burst polling.
Question 16
Which of the following commands is used to rotate, compress, and mail system logs?
- A. logrotate
- B. striplog
- C. syslogd --rotate
- D. rotatelog
- E. logger
Show answer and explanation ▾
Correct answer: A
logrotate is the standard Linux utility designed to rotate, compress, and mail system logs. It automates log management by archiving old logs and optionally compressing or emailing them to prevent disk space issues.
Why the other options are wrong:
- B. striplog is not a standard Linux command for log rotation.
- C. syslogd is the syslog daemon, and --rotate is not a valid option for log rotation management.
- D. rotatelog is not a standard Linux utility; logrotate is the correct command.
- E. logger is used to send messages to the system log, not to rotate or manage logs.
Question 17
Why is the correct configuration of a system's time zone important?
- A. Because the timezone is included in checksum calculations and timezone changes invalidate existing checksums.
- B. Because the time zone is saved as part of the modification times of files and cannot be changed after a file is created.
- C. Because the environment variables LANG and LC_MESSAGES are, by default, set according to the time zone.
- D. Because NTP chooses servers nearby based on the configured time zone.
- E. Because the conversion of Unix timestamps to local time relies on the time zone configuration.
Show answer and explanation ▾
Correct answer: E
Correct timezone configuration is essential because Unix timestamps (which store absolute time as seconds since epoch) must be converted to local time for display and interpretation. Without proper timezone configuration, the conversion from Unix timestamp to local time would be incorrect.
Why the other options are wrong:
- A. Timezone is not included in checksum calculations, and changing timezone does not invalidate checksums.
- B. File modification times are typically stored as Unix timestamps (timezone- independent), not in timezone-dependent format.
- C. LANG and LC_MESSAGES environment variables are related to locale and language, not timezone.
- D. NTP server selection is typically based on network topology and geographic proximity, not the configured timezone.
Question 18
Which of the following commands lists all queued print jobs?
- A. lpd
- B. lpr
- C. lp
- D. lsq
- E. lpq
Show answer and explanation ▾
Correct answer: E
lpq is the standard command to list all queued print jobs in Linux/Unix systems. It displays information about jobs waiting in the print queue.
Why the other options are wrong:
- A. lpd is the line printer daemon (background service), not a command to list jobs.
- B. lpr is used to submit print jobs to the queue, not to list them.
- C. lp is an alternative print command for submitting jobs, not for listing them.
- D. lsq is not a standard Linux command for print queue management.
Question 19
Which of the following entries in /etc/syslog.conf writes all mail related events to the file /var/log/maillog and sends all critical events to the remote server logger.example.com?
- A. mail.* /var/log/maillog mail,crit @logger.example.org
- B. mail.* /var/log/maillog mail.crit syslog://logger.example.org
- C. mail /var/log/maillog mail.crit @logger.example.org
- D. mail.* /var/log/maillog mail.crit @logger.example.org
- E. mail * /var/log/maillog mail crit @logger.example.org
Show answer and explanation ▾
Correct answer: D
The correct syntax for /etc/syslog.conf requires 'mail.*' to match all mail facility messages, the file path '/var/log/maillog' as the destination, then a separate selector 'mail.crit' for critical mail events, followed by '@logger.example.org' for remote logging (the @ symbol indicates a remote host).
Why the other options are wrong:
- A. The syntax is incorrect; facilities and priorities cannot be comma-separated in a single selector on the same line.
- B. syslog:// is not valid syslog.conf syntax; the @ symbol is used for remote hosts.
- C. The facility selector should be 'mail.*' not just 'mail' to capture all priority levels.
- E. The syntax 'mail *' is incorrect; selectors use dot notation (mail.*), and multiple actions cannot be space-separated like this.
Question 20
Which of the following protocols is related to the term open relay?
- A. SMTP
- B. POP3
- C. NTP
- D. IMAP
- E. LDAP
Show answer and explanation ▾
Correct answer: A
SMTP (Simple Mail Transfer Protocol) is the protocol most associated with open relay issues. An open relay is an SMTP server that allows unauthenticated users to send mail through it, which is commonly exploited for spam distribution.
Why the other options are wrong:
- B. POP3 is for receiving mail, not for relaying messages.
- C. NTP is the Network Time Protocol, unrelated to mail relay.
- D. IMAP is for receiving and managing mail, not for relaying messages.
- E. LDAP is a directory protocol, not related to mail relay.
Get the complete 102-500 bank
These 20 questions are roughly 29% of the bank. The full pack has 120 real 102-500 questions, each with the same depth of explanation, plus a questions-only PDF for timed practice and free updates forever.
View the full LPIC 1 102-500 question bank →