inetd.conf File Format for TCP/IP


Defines how the inetd daemon handles Internet service requests.


The /etc/inetd.conf file is the default configuration file for the inetd daemon. This file enables you to specify the daemons to start by default and supply the arguments that correspond to the desired style of functioning for each daemon. This file is part of TCP/IP in Network Support Facilities.

If you change the /etc/inetd.conf file, run the refresh -s inetd or kill -1 InetdPID command to inform the inetd daemon of the changes to its configuration file. The inetd.conf file specifies which daemons start by default and supplies arguments determining the style of functioning for each daemon.

The following daemons are controlled by the inetd daemon:

The ftpd, rlogind, rexecd, rshd, talkd, telnetd, and uucpd daemons are started by default. The tftpd, fingerd, and comsat daemons are not started by default unless they are uncommented in the /etc/inetd.conf file.

Service Requests

The following Internet service requests are supported internally by the inetd daemon and are generally used for debugging:

Item Description
ECHO Returns data packets to a client host.
DISCARD Discards received data packets.
CHARGEN Discards received data packets and sends predefined or random data.
DAYTIME Sends the current date and time in user-readable form.
TIME Sends the current date and time in machine-readable form.

The inetd daemon reads its configuration file only when the inetd daemon starts, when the inetd daemon receives a SIGHUP signal, or when the SRC refresh -s inetd command is entered. Each line in the inetd configuration file defines how to handle one Internet service request only.

Each line is of the form:

ServiceName  SocketType  ProtocolName Wait/NoWait  UserName ServerPath ServerArgs

These fields must be separated by spaces or tabs and have the following meanings:

Item Description
ServiceName Contains the name of an Internet service defined in the etc/services file. For services provided internally by the inetd daemon, this name must be the official name of the service. That is, the name must be identical to the first entry on the line that describes the service in the /etc/services file.
SocketType Contains the name for the type of socket used for the service. Possible values for the SocketType parameter are:
Specifies that a stream socket is used for the service.
Specifies that a datagram socket is used for the service
Specifies that a Sun remote procedure call (RPC) socket is used for the service, over a stream connection.
Specifies that a Sun RPC socket is used for the service, over a datagram connection.
ProtocolName Contains the name of an Internet protocol defined in the /etc/protocols file. For example, use the tcp value for a service that uses TCP/IP and the udp value for a service that uses the User Datagram Protocol (UDP).
Wait/NoWait/SRC Contains either the wait, the nowait, or the SRC instruction for datagram sockets and the nowait instruction for stream sockets. The Wait/NoWait/SRC field determines whether the inetd daemon waits for a datagram server to release the socket before continuing to listen at the socket. The SRC instruction works like wait, but instead of forking and waiting for the child to die, it does a startsrc on the subsystem and stores information about the starting of the service. When the service is removed from the inetd.conf file and inetd is restarted, the service then has a stopsrc issued to the service to stop it. If |DEBUG[=level] is specified after wait or nowait, the SO_DEBUG socket debugging flag will be turned on for this service. If level is specified, the trace level is set to the specified level; otherwise the level is set to normal. Valid values for level are min, normal, or detail.
UserName Specifies the user name that the inetd daemon should use to start the server. This variable allows a server to be given less permission than the root user.
ServerPath Specifies the full path name of the server that the inetd daemon should execute to provide the service. For services that the inetd daemon provides internally, this field should be internal.
ServerArgs Specifies the command line arguments that the inetd daemon should use to execute the server. The maximum number of arguments is five. The first argument specifies the name of the server used. If the SocketType parameter is sunrpc_tcp or sunrpc_udp, the second argument specifies the program name and the third argument specifies the version of the program. For services that the inetd daemon provides internally, this field should be empty.


The following are example entries in the /etc/inetd.conf file for an inetd daemon that:

  • Uses the ftpd daemon for servicing ftp requests
  • Uses the talkd daemon for ntalk requests
  • Uses the telnetd daemon for telnet requests, sets the SO_DEBUG flag for sockets used for this service, and sets the trace level for these sockets to normal.
  • Provides time requests internally.
    ftp;stream tcp nowait root /usr/sbin/ftpd ftpd
    ntalk dgram udp wait root /usr/sbin/talkd talkd
    telnet stream tcp6 nowait|DEBUG root /usr/sbin/telnetd telnetd -a
    time stream tcp nowait root internal
    time dgram udp wait  root internal


Item Description
etc/services Defines the sockets and protocols used for Internet services.
/etc/protocols Defines the Internet protocols used on the local host.