LPIC-2 Network Client Management Practice Question
A Linux client is configured with the following in /etc/nslcd.conf: 'uri ldap://10.0.0.1/', 'base dc=example,dc=com'. Which command can be used to test connectivity to the LDAP server and verify the base DN?
⚠ Common exam trap
Test-takers frequently confuse local authentication testing tools (authconfig, getent) or daemon debugging (nslcd -d) with a direct, protocol-level LDAP query, which is the only reliable method to independently verify server connectivity and base DN validity.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ldapsearch -x -H ldap://10.0.0.1 -b dc=example,dc=com
The `ldapsearch` command with `-x` (simple authentication), `-H ldap://10.0.0.1` (specifying the LDAP URI), and `-b dc=example,dc=com` (setting the search base DN) directly performs an anonymous LDAP search against the server. If the server is reachable and the base DN exists, it returns entries, confirming both connectivity and the validity of the base DN. This matches the configuration in `/etc/nslcd.conf` and is the standard tool for testing LDAP server responses.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
authconfig --test
Why it's wrong here
Tests auth configuration, not basic connectivity.
- ✓
ldapsearch -x -H ldap://10.0.0.1 -b dc=example,dc=com
Why this is correct
Directly tests LDAP query.
- ✗
getent passwd
Why it's wrong here
Tests nss but not directly LDAP connectivity.
- ✗
nslcd -d
Why it's wrong here
Runs nslcd in debug mode, not a query.
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.