1 .\" This manpage is Copyright (C) 1996 Austin Donnelly <and1000@cam.ac.uk>,
2 .\" with additional material Copyright (c) 1995 Martin Schulze
3 .\" <joey@infodrom.north.de>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" This manpage was made by merging two independently written manpages,
8 .\" one written by Martin Schulze (18 Oct 95), the other written by
9 .\" Austin Donnelly, (9 Jan 96).
11 .\" Thu Jan 11 12:14:41 1996 Austin Donnelly <and1000@cam.ac.uk>
12 .\" * Merged two services(5) manpages
14 .TH services 5 (date) "Linux man-pages (unreleased)"
16 services \- Internet network services list
19 is a plain ASCII file providing a mapping between human-friendly textual
20 names for internet services, and their underlying assigned port
21 numbers and protocol types.
22 Every networking program should look into
23 this file to get the port number (and protocol) for its service.
24 The C library routines
26 .BR getservbyname (3),
27 .BR getservbyport (3),
31 support querying this file from programs.
33 Port numbers are assigned by the IANA (Internet Assigned Numbers
34 Authority), and their current policy is to assign both TCP and UDP
35 protocols when assigning a port number.
36 Therefore, most entries will
37 have two entries, even for TCP-only services.
39 Port numbers below 1024 (so-called "low numbered" ports) can be
40 bound to only by root (see
45 This is so clients connecting to low numbered ports can trust
46 that the service running on the port is the standard implementation,
47 and not a rogue service run by a user of the machine.
48 Well-known port numbers specified by the IANA are normally
49 located in this root-only space.
51 The presence of an entry for a service in the
53 file does not necessarily mean that the service is currently running
57 for the configuration of Internet services offered.
59 networking services are started by
61 and so won't appear in
63 In particular, news (NNTP) and mail (SMTP) servers are often
64 initialized from the system boot scripts.
72 This is usually set to
75 Each line describes one service, and is of the form:
77 \f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
82 is the friendly name the service is known by and looked up under.
84 Often, the client program is named after the
88 is the port number (in decimal) to use for this service.
91 is the type of protocol to be used.
92 This field should match an entry
96 Typical values include
102 is an optional space or tab separated list of other names for this
104 Again, the names are case
107 Either spaces or tabs may be used to separate the fields.
109 Comments are started by the hash sign (#) and continue until the end
111 Blank lines are skipped.
115 should begin in the first column of the file, since leading spaces are
118 can be any printable characters excluding space and tab.
119 However, a conservative choice of characters should be used to minimize
120 compatibility problems.
121 For example, a\-z, 0\-9, and hyphen (\-) would seem a
124 Lines not matching this format should not be present in the
126 (Currently, they are silently skipped by
128 .BR getservbyname (3),
130 .BR getservbyport (3).
131 However, this behavior should not be relied on.)
133 .\" The following is not true as at glibc 2.8 (a line with a comma is
134 .\" ignored by getservent()); it's not clear if/when it was ever true.
135 .\" As a backward compatibility feature, the slash (/) between the
139 .\" name can in fact be either a slash or a comma (,).
140 .\" Use of the comma in
141 .\" modern installations is deprecated.
143 This file might be distributed over a network using a network-wide
144 naming service like Yellow Pages/NIS or BIND/Hesiod.
148 file might look like this:
154 msp 18/tcp # message send protocol
155 msp 18/udp # message send protocol
156 chargen 19/tcp ttytst source
157 chargen 19/udp ttytst source
166 The Internet network services list
172 .\" It's not clear when/if the following was ever true;
173 .\" it isn't true for glibc 2.8:
174 .\" There is a maximum of 35 aliases, due to the way the
175 .\" .BR getservent (3)
178 .\" It's not clear when/if the following was ever true;
179 .\" it isn't true for glibc 2.8:
180 .\" Lines longer than
182 .\" (currently 1024) characters will be ignored by
183 .\" .BR getservent (3),
184 .\" .BR getservbyname (3),
186 .\" .BR getservbyport (3).
187 .\" However, this will also cause the next line to be mis-parsed.
191 .BR getservbyname (3),
192 .BR getservbyport (3),
199 Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002).