How to Do a UDP Ping in Linux
Posted by jpluimers on 2026/01/07
Often connections are TCP based, but sometimes UDP is all you have to test with, so I was quite surprised that testing that was quite forward. The solutions by [Wayback/Archive] How to Do a UDP Ping in Linux works on any platform where you can have nmap or netcat on installed (which by now is almost all platforms including Windows):
For example, I’ve used UDP port 161 of the host at itsfoss.com:sudo nmap -sU -p 161 itsfoss.com I’ll be pinging itsfoss.com at UDP port 161 to check for listening ports only:netcat -v -u -z itsfoss.com 161
This makes it really easy to check if DNS port 53 or WireGuard default port 51820 are up.
Note :
- UDP port 53 is registered at IANA: [Wayback/Archive] Service Name and Transport Protocol Port Number Registry: udp 53 domain
- but 51820 is in the “free” range: [Wayback/Archive] Service Name and Transport Protocol Port Number Registry
Port numbers are assigned in various ways, based on three ranges: System Ports (0-1023), User Ports (1024-49151), and the Dynamic and/or Private Ports (49152-65535); the different uses of these ranges are described in [RFC6335]. According to Section 8.1.2 of [RFC6335], System Ports are assigned by the "IETF Review" or "IESG Approval" procedures described in [RFC8126]. User Ports are assigned by IANA using the "IETF Review" process, the "IESG Approval" process, or the "Expert Review" process, as per [RFC6335]. Dynamic Ports are not assigned.
[Wayback/Archive] RFC 6335: Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry
- So basically there is no need for a separate tool like [Wayback/Archive] wangyu-/UDPping: ping with UDP packets 🛠 (:
–jeroen






Leave a comment