I'm new to LDAP and I already configured accounts with LDAP so I can login on few computers with LDAP.
Now I would like to add some host names to LDAP. In /etc/nsswitch.conf I changed:
hosts: files dns ldap
But I have no idea how to add anything to LDAP database so it could resolve some names. I tried google but I couldn't find anything helpful.
On example, how to add this:
192.168.1.1 node1
From serverfault
klew
-
I already figured it out with help of
migrationtools(ubuntu package).First, create file
add_hosts.ldif:dn: ou=Hosts,dc=example,dc=net objectClass: organizationalUnit ou: HostsLoad it with:
ldapadd -D cn=admin,dc=example,dc=net -W -f add_hosts.ldifAbove steps should be done only once.
Then create file
node1_host.ldif:dn: cn=node1,ou=Hosts,dc=example,dc=net objectClass: top objectClass: ipHost objectClass: device ipHostNumber: 192.168.1.1 cn: node1 cn: n1I added second
cnso it can resolve bothnode1andn1. If you want to add another host, just create another filenode2_host.ldifand load it into LDAP.From klew
0 comments:
Post a Comment