Once you have decided to create a name for a port, you need to edit the
file. To edit this file:
/etc/services in an editor, such as
- Find where the entry should go in the file. Notice that as you scroll down through the file, the port numbers increase.
You should put your new entry so that port numbers remain sorted.
- Insert the port name, number and protocol, any aliases, and a comment.
View the SlideShow below to see the process of inserting a new entry into the
: What line would you put in /etc/services for the foobar service running on UDP port 8888?
foobar 8888/udp # the foobar service
The first field in /etc/services is the official service name. Next, you list the port and protocol using the "port/protocol" format. Finally, you list any aliases and a descriptive comment. Since you don't have any aliases, only a descriptive comment is required.
The next lesson describes the function of the Domain Name System.