From owner-freebsd-net Mon Sep 7 15:17:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA17609 for freebsd-net-outgoing; Mon, 7 Sep 1998 15:17:11 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA17600 for ; Mon, 7 Sep 1998 15:17:03 -0700 (PDT) (envelope-from roberto@keltia.freenix.fr) Received: (from uucp@localhost) by frmug.org (8.9.1/frmug-2.3/nospam) with UUCP id AAA29772 for freebsd-net@FreeBSD.ORG; Tue, 8 Sep 1998 00:16:46 +0200 (CEST) (envelope-from roberto@keltia.freenix.fr) Received: by keltia.freenix.fr (VMailer, from userid 101) id E923F1517; Mon, 7 Sep 1998 23:53:14 +0200 (CEST) Date: Mon, 7 Sep 1998 23:53:14 +0200 From: Ollivier Robert To: "FreeBSD-Net (FreeBSD.Org) List" Subject: Re: How to find which application is using a given UDP port Message-ID: <19980907235314.A25006@keltia.freenix.fr> Mail-Followup-To: "FreeBSD-Net (FreeBSD.Org) List" References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.94.4i In-Reply-To: =?iso-8859-1?Q?=3Cxzppvd8ut72=2Efsf=40hrotti=2Eifi=2Euio=2Eno=3E=3B_from?= =?iso-8859-1?Q?_Dag-Erling_Coidan_Sm=F8rgrav__on_Mon=2C_Sep_07=2C_1998_a?= =?iso-8859-1?Q?t_12:13:05PM_+0200?= X-Operating-System: FreeBSD 3.0-CURRENT/ELF ctm#4623 AMD-K6 MMX @ 200 MHz Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org According to Dag-Erling Coidan Smørgrav : > It won't tell you *which* app holds the port. fstat(1) will tell you > which processes have open TCP or UDP sockets, but not which port. The > trick is to use 'fstat' and 'netstat -Aan' and compare addresses: Better to use lsof (in ports/sysutils/lsof) which does that automatically. lsof -i ucp COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME syslogd 107 root 4u inet 0xf5830f60 0t0 UDP *:syslog named 116 root 4u inet 0xf5830f00 0t0 UDP *:1024 named 116 root 20u inet 0xf5830ea0 0t0 UDP keltia.freenix.fr:domain named 116 root 22u inet 0xf5830e40 0t0 UDP localhost:domain portmap 124 daemon 3u inet 0xf5830de0 0t0 UDP *:sunrpc inetd 148 root 10u inet 0xf5830c60 0t0 UDP *:biff inetd 148 root 11u inet 0xf5830c00 0t0 UDP *:ntalk inetd 148 root 17u inet 0xf5830ba0 0t0 UDP *:echo inetd 148 root 18u inet 0xf5830b40 0t0 UDP *:discard inetd 148 root 19u inet 0xf5830ae0 0t0 UDP *:chargen inetd 148 root 20u inet 0xf5830a80 0t0 UDP *:daytime inetd 148 root 21u inet 0xf5830a20 0t0 UDP *:time inetd 148 root 25u inet 0xf58309c0 0t0 UDP *:amanda ntpd 878 root 4u inet 0xf5830cc0 0t0 UDP *:ntp ntpd 878 root 5u inet 0xf5830d20 0t0 UDP keltia.freenix.fr:ntp ntpd 878 root 6u inet 0xf5830d80 0t0 UDP localhost:ntp actived 11699 news 4u inet 0xf5830960 0t0 UDP localhost:1119 -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr FreeBSD keltia.freenix.fr 3.0-CURRENT #63: Tue Sep 1 00:50:29 CEST 1998 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message