Creates an LDAP Data Interchange Format (LDIF) file from a hosts file.
The /usr/sbin/hosts2ldif command creates a LDAP Data Interchange Format (LDIF) file from /etc/hosts or another file that looks like /etc/hosts. With no flags, the /etc/hosts file is used to create the /tmp/hosts.ldif LDIF file using cn=hosts as the baseDN.
The LDIF file created by this command is compliant with SecureWay Directory Schema and is used for setting up the ldap mechanism. The ldap mechanism is supported, but the use of the nis_ldap mechanism rather than the ldap mechanism is recommended.
Item | Description |
---|---|
-i InputFile | Specifies the hosts file used for input. |
-o OutputFile | Specifies the LDIF file used for output. |
-s SearchBase | Specifies the baseDN of the host table on the LDAP server. |
hosts2ldif -o /home/ldifhosts
hosts2ldif -i /home/hosts.bak
hosts2ldif -o /home/ldifhosts -s cn=hosttab
Item | Description |
---|---|
/etc/hosts | Contains the Internet Protocol (IP) name and addresses of hosts on the local network. |