Check for running DHCP daemon?

Chris Angelico rosuav at
Fri Jan 23 18:04:24 CET 2015

On Sat, Jan 24, 2015 at 3:02 AM, Jason Bailey <jbailey at> wrote:
> I'm actually wondering if it might be more beneficial for me to check if the
> local DHCP port (udp 67) is bound and in use. I had tried to do this some
> time ago, and couldn't get it working right (it would always test true, even
> when it shouldn't have). Can anyone steer me in the right direction on port
> status?

You can check with netstat:

$ sudo netstat -n4lp|grep ':67 '
udp        0      0    *

On my system, there's a /proc/net/udp which carries this information.
Everything's in hex, so port 67 is shown as 0043:

$ grep :0043 /proc/net/udp
 5755: 00000000:0043 00000000:0000 07 00000000:00000000 00:00000000
00000000     0        0 8334454 2 ffff880403e60b40 0

You'd have to check your own system to know what's truly reliable and
worth using.


More information about the Python-list mailing list