The short answer

A port is a number from 0 to 65535 that tells a computer which program should receive a piece of network traffic. The IP address gets the traffic to the right machine. The port gets it to the right service on that machine, such as the web server on 443 or the mail server on 25.

Ports belong to a transport protocol. TCP port 53 and UDP port 53 are separate, which is why the tables below list the protocol next to each number. The TCP vs UDP guide explains how the two differ.

How ports work

Every TCP connection and UDP exchange has a source port and a destination port. A server listens on a fixed, well-known port so clients know where to find it. The client picks a temporary port of its own, called an ephemeral port, for the reply to come back to.

So when a browser opens a site, the connection might run from 203.0.113.7:51544 on your laptop to 198.51.100.20:443 on the server. The pair of addresses and ports, plus the protocol, identifies that one connection.

The port numbers in this guide are conventions registered with IANA, not rules. A service can listen on any port, and the same port can be used for something else entirely. A scanner that finds port 3306 open is telling you something is listening there, which is very likely MySQL, but not certainly.

Port ranges

RangeNameUsed for
0–1023Well-known portsCore internet services such as DNS, HTTP and SMTP. On Linux and macOS, a program needs extra privileges to listen on them.
1024–49151Registered portsServices registered with IANA, such as databases, VPNs and remote desktop.
49152–65535Dynamic or private portsTemporary client-side ports. Many Linux systems pick ephemeral ports from 32768–60999 instead.

Web ports

A URL with no port in it uses 443 for https:// and 80 for http://. Any other port has to be written in the address, as in https://example.com:8443/.

PortProtocolServiceWhat it is for
80TCPHTTPPlain, unencrypted web traffic. Most sites only use it to redirect visitors to HTTPS.
443TCPHTTPSEncrypted web traffic (HTTP/1.1 and HTTP/2 over TLS). Also carries DNS over HTTPS.
443UDPHTTP/3 (QUIC)The newest version of HTTP, which runs over QUIC instead of TCP.
8080TCPHTTP alternateA common choice for proxies, development servers and admin consoles.
8443TCPHTTPS alternateA second HTTPS port, often used by appliances and management interfaces.

A browser that sees an HTTPS record or an Alt-Svc header can switch to HTTP/3 on UDP 443. The SVCB and HTTPS records guide covers how DNS advertises that.

Email ports

Email uses different ports for servers talking to each other and for people sending and reading their own mail.

PortProtocolServiceWhat it is for
25TCPSMTPMail servers passing messages to each other. Your MX records point here.
587TCPSMTP submissionMail apps sending outgoing mail through their own provider, upgraded to TLS with STARTTLS.
465TCPSMTP submission over TLSThe same job as 587, but encrypted from the first byte. RFC 8314 recommends it.
143TCPIMAPReading mail that stays on the server.
993TCPIMAPSIMAP over TLS. Use this instead of 143.
110TCPPOP3Downloading mail to one device.
995TCPPOP3SPOP3 over TLS. Use this instead of 110.

Many home and cloud networks block outbound TCP 25 to stop infected machines sending spam. Mail apps should use 587 or 465 instead. Server-to-server delivery on 25 can be protected with MTA-STS or DANE.

DNS ports

PortProtocolServiceWhat it is for
53UDP and TCPDNSOrdinary DNS queries. UDP for most answers, TCP for large ones and zone transfers.
853TCPDNS over TLSEncrypted DNS between a client and its resolver.
853UDPDNS over QUICEncrypted DNS over QUIC.
443TCP and UDPDNS over HTTPSEncrypted DNS that looks like ordinary web traffic.
5353UDPMulticast DNS (mDNS)Name lookups on a local network without a DNS server, such as printers and speakers.

A firewall that allows UDP 53 but blocks TCP 53 breaks large answers, including many DNSSEC responses, in ways that are hard to spot. The DoH vs DoT vs DoQ guide compares the encrypted options.

Remote access ports

PortProtocolServiceWhat it is for
22TCPSSH, SFTP, SCPEncrypted remote shell and file transfer.
23TCPTelnetUnencrypted remote shell. Passwords cross the network in plain text.
3389TCP and UDPRDPWindows Remote Desktop.
5900TCPVNCRemote screen sharing. Later displays use 5901, 5902 and so on.

These are the ports attackers try first. SSH on 22 and RDP on 3389 see constant password-guessing from the moment they are reachable. Keep them behind a VPN or an allow list where you can, and turn off Telnet.

File sharing ports

PortProtocolServiceWhat it is for
20, 21TCPFTPFile transfer. Port 21 carries commands and 20 carries data in active mode. Unencrypted.
990TCPFTPSFTP wrapped in TLS.
69UDPTFTPVery simple file transfer, used to boot network devices and load phone configs.
445TCPSMBWindows file and printer sharing.
137–139UDP and TCPNetBIOSOlder Windows name and session services that SMB used to depend on.
2049TCP and UDPNFSUnix and Linux network file systems.

SMB on 445 and NetBIOS on 137–139 should not be reachable from the internet. Several of the worst worms, including WannaCry, spread through exposed SMB.

Directory and sign-in ports

PortProtocolServiceWhat it is for
88TCP and UDPKerberosSign-in tickets for Active Directory and other Kerberos realms.
389TCP and UDPLDAPDirectory lookups, such as finding users and groups.
636TCPLDAPSLDAP over TLS.
1812, 1813UDPRADIUSAuthentication and accounting for Wi-Fi, VPNs and network devices.

Active Directory finds its domain controllers through DNS SRV records such as _ldap._tcp and _kerberos._tcp, which carry these port numbers. The SRV records guide shows how.

Network infrastructure ports

PortProtocolServiceWhat it is for
67, 68UDPDHCPHanding out IP addresses. Servers listen on 67 and clients on 68.
123UDPNTPKeeping clocks in sync. Certificates, Kerberos and DNSSEC all need the right time.
161, 162UDPSNMPMonitoring network devices. 161 answers queries and 162 receives alerts (traps).
514UDPSyslogSending log messages to a central server. Syslog over TLS uses TCP 6514.
179TCPBGPRouters exchanging internet routes.

Open NTP and SNMP servers on UDP can be abused to send floods of traffic to a spoofed victim, the same trick used in DNS amplification attacks. Answer only the networks you serve.

VPN ports

PortProtocolServiceWhat it is for
500UDPIKE (IPsec)Setting up IPsec VPN tunnels.
4500UDPIPsec NAT traversalIPsec traffic wrapped in UDP so it can pass through NAT.
1194UDPOpenVPNThe default OpenVPN port. TCP 1194 or 443 are used where UDP is blocked.
51820UDPWireGuardThe usual WireGuard port, although any UDP port can be configured.

Database and cache ports

PortProtocolServiceWhat it is for
1433TCPMicrosoft SQL ServerSQL Server databases.
1521TCPOracle DatabaseThe Oracle listener.
3306TCPMySQL, MariaDBMySQL and MariaDB databases.
5432TCPPostgreSQLPostgreSQL databases.
6379TCPRedisIn-memory data store and cache.
11211TCP and UDPMemcachedIn-memory cache. Open UDP 11211 has been abused for very large reflection attacks.
27017TCPMongoDBMongoDB databases.
9200TCPElasticsearchThe Elasticsearch HTTP API.

Databases and caches are meant to be reached by your own applications, not the whole internet. Exposed Redis, MongoDB and Elasticsearch servers are a common source of data leaks, often because they were installed with no password.

Voice and video ports

PortProtocolServiceWhat it is for
5060UDP and TCPSIPSetting up voice and video calls.
5061TCPSIP over TLSEncrypted SIP signaling.
3478UDP and TCPSTUN, TURNHelping calls and video meetings get through NAT and firewalls.

Calls also need a wide range of UDP ports for the audio and video itself (RTP). The exact range depends on the phone system or meeting service, so check its documentation before you open a firewall.

How to check whether a port is open

Only test systems you own or have permission to test. A quick check of a single TCP port:

MacOS and Linux:

nc -vz example.com 443

Windows PowerShell:

Test-NetConnection example.com -Port 443

To see what is listening on your own machine, use ss -tulpn on Linux, lsof -i -P -n on macOS or netstat -ano on Windows.

To check a public host from outside your network, use the TCP Port Check.

A port that does not answer can be in one of two states. Closed means the machine replied that nothing is listening, so the connection is refused straight away. Filtered means a firewall dropped the traffic, so the connection just times out. The TCP handshakes and port states guide explains both. UDP is harder to test because a service often sends nothing back to a probe it does not understand.

How DNS Panopticon uses ports

DNS Panopticon does not scan ranges of ports. Its scans only connect to the standard ports a visitor would use, and one tool checks a single port you choose:

  • Website Recon opens the homepage on 443 (HTTPS) first and falls back to 80 (HTTP) if that fails. The Homepage card shows which one answered.
  • The HTTP Status Code Verification tool in Zone Analyzer requests each selected host over HTTPS on 443.
  • Domain Visualizer asks its DNS questions through public resolvers over DNS over HTTPS, an encrypted web request, rather than as plain DNS on port 53.
  • The TCP Port Check opens a TCP connection to one host and port you enter, from Cloudflare’s network, and reports whether it is open, closed or filtered, with the handshake and connect times.

When a site does not answer at all, there is no HTTP status code to show. The HTTP status codes guide explains what each kind of failure means.

FAQ

What is the difference between TCP and UDP ports?

They are separate number spaces. TCP port 53 and UDP port 53 are different ports, even though DNS happens to use both. A firewall rule has to name the protocol as well as the number.

Which ports does a website need?

TCP 443 for HTTPS, plus TCP 80 if you want plain http:// addresses to redirect to HTTPS. Allow UDP 443 as well if you serve HTTP/3.

Is it dangerous to have open ports?

An open port is only as risky as the service behind it. Web and mail ports are meant to be public. Remote access, file sharing and database ports should be limited to the people and systems that need them.

Does changing a service to a non-standard port make it secure?

Not on its own. Moving SSH off port 22 cuts down on automated noise, but scanners check every port. Strong authentication and a firewall matter far more.