Section: Linux Programmer's Manual (5)
Return to Main Contents
services - Internet network services list
is a plain ASCII file providing a mapping between human-friendly textual
names for internet services, and their underlying assigned port
numbers and protocol types.
Every networking program should look into
this file to get the port number (and protocol) for its service.
The C library routines
support querying this file from programs.
Port numbers are assigned by the IANA (Internet Assigned Numbers
Authority), and their current policy is to assign both TCP and UDP
protocols when assigning a port number.
Therefore, most entries will
have two entries, even for TCP-only services.
Port numbers below 1024 (so-called "low numbered" ports) can only be
bound to by root (see
This is so clients connecting to low numbered ports can trust
that the service running on the port is the standard implementation,
and not a rogue service run by a user of the machine.
Well-known port numbers specified by the IANA are normally
located in this root-only space.
The presence of an entry for a service in the
file does not necessarily mean that the service is currently running
on the machine.
for the configuration of Internet services offered.
Note that not all
networking services are started by
and so won't appear in
In particular, news (NNTP) and mail (SMTP) servers are often
initialized from the system boot scripts.
The location of the
file is defined by
This is usually set to
Each line describes one service, and is of the form:
service-name port/protocol [aliases ...]
is the friendly name the service is known by and looked up under.
It is case sensitive.
Often, the client program is named after the
is the port number (in decimal) to use for this service.
is the type of protocol to be used.
This field should match an entry
Typical values include
is an optional space or tab separated list of other names for this
Again, the names are case
Either spaces or tabs may be used to separate the fields.
Comments are started by the hash sign (#) and continue until the end
of the line.
Blank lines are skipped.
should begin in the first column of the file, since leading spaces are
can be any printable characters excluding space and tab.
However, a conservative choice of characters should be used to minimize
E.g., a-z, 0-9, and hyphen (-) would seem a
Lines not matching this format should not be present in the
(Currently, they are silently skipped by
However, this behavior should not be relied on.)
This file might be distributed over a network using a network-wide
naming service like Yellow Pages/NIS or BIND/Hesiod.
file might look like this:
qotd 17/tcp quote
msp 18/tcp # message send protocol
msp 18/udp # message send protocol
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
# 22 - unassigned
The Internet network services list
Assigned Numbers RFC, most recently RFC 1700, (AKA STD0002)
This page is part of release 3.27 of the Linux
A description of the project,
and information about reporting bugs,
can be found at
- SEE ALSO
This document was created by
using the manual pages.