What is LDAP service in Linux?
LDAP (Lightweight Directory Access Protocol) is a directory service used to store and manage centralized information, such as:
* Users and passwords
* Groups
* Computers
* Email addresses
* Application authentication data
On Linux, LDAP is commonly used for:
* Centralized user login
* Authentication and authorization
* Integration with applications (GitLab, Jenkins, mail servers)
* Active Directory integration
Think of LDAP as a central phonebook for users and systems 📒
==========================
How LDAP works (simple flow)
1. Client asks LDAP server: “Is this user valid?”
2. LDAP server checks directory
3. Server responds with yes/no and user details
Common LDAP service in Linux
* OpenLDAP (slapd) → most widely used LDAP server on Linux
Service name:
slapd
LDAP Port Numbers
Protocol Port Description
LDAP 389/TCP Plain LDAP
LDAPS 636/TCP Secure LDAP (SSL/TLS)
LDAP + STARTTLS 389/TCP Encrypted over standard LDAP
📌 389 = default
📌 636 = secure (legacy LDAPS)
Check LDAP port in Linux
ss -tulnp | grep ldap
or
netstat -tulnp | grep 389
LDAP Configuration files (OpenLDAP)
* Main config:
/etc/ldap/slapd.d/
*
* Old-style config (deprecated):
/etc/ldap/slapd.conf
*
Interview-ready answer
LDAP is a directory service used to centrally manage users, groups, and authentication. In Linux, OpenLDAP provides LDAP services. The default LDAP port is 389, and the secure LDAPS port is 636.
===================
DHCP Service :
Alright 👍 let’s do this step-by-step, clean and exam/real-world friendly.
I’ll show DHCP server installation + configuration on Linux, covering Ubuntu/Debian and RHEL/CentOS.
What is DHCP?
DHCP (Dynamic Host Configuration Protocol) automatically provides:
* IP address
* Subnet mask
* Gateway
* DNS
to client machines.
DHCP Server Installation & Configuration
1. Install DHCP server
Ubuntu / Debian
sudo apt update
sudo apt install isc-dhcp-server -y
RHEL / CentOS / Rocky / Alma
sudo dnf install dhcp-server -y
2. Select network interface
Ubuntu / Debian
Edit:
sudo nano /etc/default/isc-dhcp-server
Set your interface name:
INTERFACESv4="eth0"
(Check interface name using ip a)
RHEL / CentOS
Interface is defined directly in config (next step).
3. Configure DHCP server
Edit DHCP config file:
sudo nano /etc/dhcp/dhcpd.conf
Basic DHCP configuration
option domain-name "example.com";
option domain-name-servers 8.8.8.8, 8.8.4.4;
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
}
📌 Adjust IP range and gateway based on your network.
4. Assign static IP (reservation) – optional
host client1 {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.50;
}
5. Start and enable DHCP service
Ubuntu / Debian
sudo systemctl restart isc-dhcp-server
sudo systemctl enable isc-dhcp-server
RHEL / CentOS
sudo systemctl restart dhcpd
sudo systemctl enable dhcpd
6. Check DHCP service status
systemctl status isc-dhcp-server
or
systemctl status dhcpd
7. Allow DHCP in firewall
Ubuntu (UFW)
sudo ufw allow 67/udp
sudo ufw reload
RHEL / CentOS (firewalld)
sudo firewall-cmd --add-service=dhcp --permanent
sudo firewall-cmd --reload
8. Verify DHCP leases
cat /var/lib/dhcp/dhcpd.leases
9. Test from client machine
On a client:
dhclient
Check IP:
ip a
Common Problems & Fixes
❌ DHCP failed to start
* Wrong interface name
* Subnet mismatch
✔ Fix:
ip a
Ensure subnet matches interface network.
❌ Clients not getting IP
* Firewall blocking port 67
* Wrong gateway IP
Interview-friendly summary
* DHCP package: isc-dhcp-server / dhcp-server
* Config file: /etc/dhcp/dhcpd.conf
* Port: 67/UDP
* Lease file: /var/lib/dhcp/dhcpd.leases
* Command to test: dhclient
If you want next:
* DHCP relay agent
* DHCP failover
* PXE boot using DHCP
* Real-time troubleshooting scenarios
Just tell me 😄
Get smarter responses, upload files and images, and more.
Log in
Sign up for free
==============================
Linux Interview questions:
===============================
On RHEL / CentOS / Rocky / AlmaLinux
yum install bind bind-utils -y
✅ On Ubuntu / Debian
apt update
apt install bind9 bind9utils -y
🔹 Start and enable DNS service
systemctl start named # RHEL/CentOS
systemctl enable named
systemctl start bind9 # Ubuntu
systemctl enable bind9
🔹 Check DNS service status
systemctl status named
or
systemctl status bind9
🔹 Main configuration files
File Purpose
/etc/named.conf Main DNS config (RHEL)
/etc/bind/named.conf Main DNS config (Ubuntu)
/var/named/ Zone files
/etc/resolv.conf DNS resolver config
🔹 Open DNS port (important)
DNS uses port 53 (TCP & UDP)
firewall-cmd --add-service=dns --permanent
firewall-cmd --reload
🔹 Test DNS
nslookup google.com
or
dig google.com
⭐ One-line interview answer
DNS service in Linux is installed using BIND, configured via named.conf, started with systemctl, and listens on port 53.
⭐ Very short interview version
Install BIND, configure named.conf, start the named service, and open port 53.
If you want next, I can explain:
* DNS forward zone & reverse zone
* Sample zone file
* DNS troubleshooting interview questions
* Difference between DNS client vs server
Just tell me 👍
=================================================================
HSBC Bank: Name : Srikanth Patil Mobile : 9513273723 Email Id : Srikanth.patil@hsbc.co.in How to check payslips : Go to the portal: here we can see the link: https://infinite.greyhr.com/login.do Quick links : GreytHR ---------------------------------------------------- Medical and group insurance : Contact : shafi +91 -7022557573 email address: mediclaimhelpdesk@infinite.com For any escalation write to : MYHR@infinite.com Quicklink -BIZX: https://bizx.inifinite.com --------------------------------------------------------- Axis Bank : Name : Ragini sharma Mobile Number: 8088982659 mail address: Ragini.sharma@axisbank.com --------------------------------------------------------- Name : Archishman Mobile number: 7678068570 mail address: Archishman.Deb@axisbank.com -------------------------------------------------------- Hdfc Bank : Name : Pavan katariya Mobile Number: 9986349366 Mail address: pavan.katariya@hdfcbank.com ----------------...
Comments
Post a Comment