[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2

hosts2ldif Command

Purpose

Creates an LDAP Data Interchange Format (LDIF) file from a hosts file.

Syntax

hosts2ldif [ -i InputFile ] [ -o OutputFile ] [ -s SearchBase ]

Description

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(R) 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.

Flags

-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.

Examples

  1. To create /home/ldifhosts from the /etc/hosts file, type:

    hosts2ldif -o /home/ldifhosts
  2. To create /tmp/hosts.ldif from the /home/hosts.bak file, type:

    hosts2ldif -i /home/hosts.bak
  3. To create /home/ldifhosts from the /etc/hosts file using cn=hosttab as the baseDN, type:

    hosts2ldif -o /home/ldifhosts -s cn=hosttab

Files

/etc/hosts Contains the Internet Protocol (IP) name and addresses of hosts on the local network.

Related Information

TCP/IP Name Resolution in the AIX 5L Version 5.2 System Management Guide: Communications and Networks.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]