services file

Definition of services file in The Network Encyclopedia.

What is a Services Files

A text file that assigns Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) port numbers to TCP/IP protocols and services for a computer on a TCP/IP network. The entries in the services file are used for well-known service (WKS) records in Domain Name System (DNS) servers and other Windows Sockets applications. You can also use the file to quickly determine which well-known TCP or UDP port number is assigned to a specific network service or protocol.

How It Works

You will find the services file at the following location on a computer running Microsoft Windows:

  • Windows NT and Windows 2000:
    %SystemRoot%\System32\drivers\etc\services

     

  • Windows 95 and Windows 98:
    %WinDir%\Services

     

Each line in the services file contains the standard name for the service followed by the well-known port number as defined in Request for Comments (RFC) 1060, an alias, and an optional comment prefixed with a pound sign (#). The following example is a portion from the sample services file included with Windows:

# Format:
# <service name> <port number>/<protocol> [aliases...]
...
ftp-data 20/tcp # FTP, data
ftp 21/tcp # FTP. control
telnet 23/tcp
smtp 25/tcp mail # Simple Mail Transfer Protocol
time 37/tcp timeserver
time 37/udp timeserver
TIP

You can change the default port number for a TCP/IP service by editing the services file - for example, if you need to run multiple Simple Network Management Protocol (SNMP) agents or if you want to change the default File Transfer Protocol (FTP) control port to make access more private.

Web References