Port 138: NetBIOS-DGM
Port 138 is the NetBIOS Datagram Service, used for connectionless communication such as browsing the network neighborhood on older Windows systems. It is part of the same legacy NetBIOS stack as ports 137 and 139.
| Port number | 138 |
|---|---|
| Service | NetBIOS Datagram Service |
| Protocol | UDP |
| Category | Windows |
| Default encryption | No |
How do I check whether port 138 is open?
Port 138 is UDP, which changes the answer: there is no handshake to complete, so nothing outside the host can prove the port is open. Asking the host itself is the reliable route.
| Question | Command | What to know |
|---|---|---|
| Is it open on a remote host? | sudo nmap -sU -p 138 example.com | UDP has no handshake, so there is nothing to complete. nmap infers the state from whether an ICMP port-unreachable comes back, needs root, and is slow and easy to misread. A silent port may be open, filtered, or simply not replying to a probe it does not recognise. |
| What is listening locally? | ss -ulnp | grep ':138 ' | Shows the UDP socket bound to port 138. This is the reliable way to answer the question, because you are asking the host itself rather than guessing from outside. |
Replace example.com with the host you are testing. A blocked port and a port with nothing listening on it look identical from the outside, so if a service should be running, check locally before blaming the firewall.
Frequently asked questions
What is port 138 used for?
Port 138 is the NetBIOS Datagram Service, used for connectionless communication such as browsing the network neighborhood on older Windows systems. It is part of the same legacy NetBIOS stack as ports 137 and 139.
Is port 138 TCP or UDP?
Port 138 (NetBIOS-DGM) uses UDP.
Is port 138 secure?
Port 138 is not encrypted by default. Where possible, use an encrypted alternative or tunnel it over TLS or a VPN.
Should I open port 138 on my firewall?
Only if you specifically need NetBIOS-DGM. Expose it to the smallest set of trusted sources, and never open database or Windows-service ports to the whole internet.