This isn't NetworkMonks. You didn't even ask how to do random X in Perl.
Basically, though, you already have one way to do it. Checking with the entity that assigns the IPs can be a good way to do it if you have some way to tie the usernames to the MAC address or the hostname of the system.
Another way to do it is to have each user or an automated client program on their computer connect to a known place and authenticate. This can be a simple UDP or TCP server, a CGI web app, an authentication/authorization/accounting (AAA) server like RADIUS, or even a plug-in for a POP3 server anything that authenticates. Then, serve that info out. You could do that as easily as making it the resulting web page upon successful authentication, or making it a POP3 bulletin.
You could use an extant VPN service like Hamachi that basically does the above.
You could use a dynamic DNS service client on each system and connect to each other by the assigned DNS hostnames.
You could set each machine up to check its IP every few minutes and email the new IP to someone. I used to use this method for my phone to get the update for my home system rather than worrying about messing with a dynamic DNS service. If each person needs the complete list, set up a mailing list.
If each person is always on the same computer, use arp and set up a MAC-to-person table on each system or in a central location. If you're also doing the DHCP yourself, you could just assign the right IP based on the MAC. If you're assigning the IP based on the MAC, you could throw in your own local DNS server with a zone for your group that maps those names to the IPs and vice-versa statically since the IPs won't change for the same machine (unless the MAC changes, of course).
If I tried, I'm sure I could come up with a dozen or more additional ways to do this, both practical and silly. What any of them has specifically to do with Perl I have no idea.
Please ask questions about Perl here.
|