How to check the server port
In daily server management and network operation and maintenance, querying the server port is a basic and important operation. Whether checking port occupancy or troubleshooting network faults, mastering port query methods can improve work efficiency. This article details how to query a server port and provides structured data for quick reference.
1. Why do you need to query the server port?

The server port is the entry point for network communication, and each service is usually bound to a specific port. For example, the HTTP service uses port 80 by default, and HTTPS uses port 443. Querying the port can help us:
2. Commonly used port query methods
The following are several common methods for querying server ports, applicable to Windows and Linux systems.
| operating system | Commands/Tools | Description |
|---|---|---|
| Windows | netstat -ano | List all active network connections and listening ports, and display the corresponding process ID |
| Windows | telnet [IP] [port] | Test whether a certain port is open (Telnet client needs to be enabled first) |
| Linux | netstat -tuln | Display all listening TCP/UDP ports |
| Linux | ss-tuln | Function similar to netstat, but more efficient |
| Linux | lsof -i :[port] | Check the occupancy status of the specified port |
3. Detailed operation steps
1. Windows system query port
In Windows systems, you can use the following command to query the port:
2. Linux system query port
In Linux systems, commonly used port query commands include:
4. Common port list
Here are some common services and their default ports:
| service | Default port |
|---|---|
| HTTP | 80 |
| HTTPS | 443 |
| FTP | 21 |
| SSH | 22 |
| MySQL | 3306 |
| Redis | 6379 |
5. Summary
Querying server ports is an essential skill for network management and troubleshooting. Whether it is a Windows or Linux system, you can quickly obtain port information through command line tools. Mastering these methods can help us manage servers more efficiently and optimize network configuration.
If you have other questions about server ports, please leave a message in the comment area to discuss!
check the details
check the details