Hi,

I am running the below mentioned openldap server version on CentOS Linux release 7.9.2009 (Core). The details are as follows. 

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
#

# rpm -qa | grep openldap
openldap-clients-2.4.44-25.el7_9.x86_64
openldap-servers-2.4.44-25.el7_9.x86_64
openldap-2.4.44-25.el7_9.x86_64
#

# slapd -VV
@(#) $OpenLDAP: slapd 2.4.44 (Feb 23 2022 17:11:27) $
mockbuild@x86-01.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd

# systemctl status slapd
● slapd.service - OpenLDAP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/slapd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2023-08-17 05:57:50 IST; 5min ago
     Docs: man:slapd
           man:slapd-config
           man:slapd-hdb
           man:slapd-mdb
           file:///usr/share/doc/openldap-servers/guide.html
  Process: 6448 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=0/SUCCESS)
  Process: 6410 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)
 Main PID: 6450 (slapd)
   CGroup: /system.slice/slapd.service
           └─6450 /usr/sbin/slapd -u ldap -h ldapi:/// ldap:///

Aug 17 05:59:50 cbopenldap slapd[6450]: conn=1001 op=1 RESULT tag=105 err=64 text=value of single-valued naming attribute 'dc' conflicts with value present in entry
Aug 17 05:59:50 cbopenldap slapd[6450]: conn=1001 op=2 UNBIND
Aug 17 05:59:50 cbopenldap slapd[6450]: conn=1001 fd=11 closed
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 fd=11 ACCEPT from IP=[::1]:42840 (IP=[::]:389)
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 op=0 BIND dn="" method=128
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 op=0 RESULT tag=97 err=0 text=
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 op=1 SRCH base="dc=corporate,dc=mydomain,dc=in" scope=2 deref=0 filter="(objectClass=*)"
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 op=2 UNBIND
Aug 17 06:00:01 cbopenldap slapd[6450]: conn=1002 fd=11 closed
#

# netstat -antup | grep -i 389
tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      6450/slapd
tcp6       0      0 :::389                  :::*                    LISTEN      6450/slapd
#

The distinguished name is dc=corporate,dc=mydomain,dc=in 

# cat mydomain_config.ldif
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=corporate,dc=mydomain,dc=in

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=admin,dc=corporate,dc=mydomain,dc=in

#ldapmodify -Y EXTERNAL -H ldapi:/// -f mydomain_config.ldif

# cat mydomain_config2.ldif
dn: olcDatabase={2}hdb,cn=config
changeType: modify
replace: olcRootPW
olcRootPW: {SSHA}m2NMC1NMrp5BavWVSHm2Becq7J2fHDNa

#ldapmodify -Y EXTERNAL -H ldapi:/// -f mydomain_config2.ldif

# cat mydomain_config3.ldif
dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external, cn=auth" read by dn.base="cn=admin,dc=corporate,dc=mydomain,dc=in" read by * none

#ldapmodify -Y EXTERNAL -H ldapi:/// -f mydomain_config3.ldif

The distinguished name is dc=corporate,dc=mydomain,dc=in 

# cat mydomain.ldif
dn: dc=corporate,dc=mydomain,dc=in
objectClass: dcObject
objectClass: organization
dc: mydomain
o: mydomain

# ldapadd -f mydomain.ldif -D cn=admin,dc=corporate,dc=mydomain,dc=in -W 
adding new entry "dc=corporate,dc=mydomain,dc=in"
ldap_add: Naming violation (64)
  additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry

# ldapsearch -x -b dc=corporate,dc=mydomain,dc=in

Output of ldapsearch -x -b dc=corporate,dc=mydomain,dc=in command
# extended LDIF
#
# LDAPv3
# base <dc=corporate,dc=mydomain,dc=in> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1
#

I am encountering the below issue as explained with the steps mentioned above

ldap_add: Naming violation (64)
  additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry

Am I missing anything? Please guide me. Thanks in advance.

Best Regards,

Kaushal