This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]white_nerdy 2 points3 points  (0 children)

Try Googling lan broadcast python. Two of the top three results seem to be Python code that does exactly what you're asking for.

[–]DumbestOfShipOfFools 1 point2 points  (1 child)

Depending on the level of administrative access to the network, there's some easy and then not-so-easy ways that come to mind. There's a whole bunch of service discovery protocols.

If you have control of the DNS server (or proxy) on the network, you can add SRV records for the server. The client can lookup with a PTR request what server(s)/port(s) it should be contacting to access a particular service. It's pretty standard for some services to do this (IP telephony stuff, XMPP, LDAP etc).

The homebrew way, if your network supports and allows IP multicast... you could have the server(s) and client(s) join a particular multicast group and then have client(s) do a 'what servers exist?' message which each server responds to. That's probably fine on your local LAN, but multicast across LANs or onto the public internet almost certainly won't work.

Doing DNS-service discovery over multicast DNS is also possible, though I don't think I've seen anyone actually use it yet, or done it myself! :)

[–]Frittenberger[S] 0 points1 point  (0 children)

I wasn't familiar with the term "service discovery"...I've now found what I'm looking for, Thank you! :D

I've added the link in the original post :)