Translating IP address on a local network
Alex Tweedly
alex.tweedly at gmail.com
Tue Apr 29 18:45:02 EDT 2008
Sarah Reichelt wrote:
> Hi All,
>
> We have a small network behind a NAT router, with IP addresses either
> set manually or by DHCP in the format 192.168.1.xxx.
> All the computer's are Macs so they also have Bonjour names e.g.
> sarah-mac.local.
>
> I have set up a custom web server based on Andre's RevOnRockets. When
> the web server receives a request, the IP address of the requesting
> computer is contained in the socket ID. I would like to be able to
> translate that to the Bonjour name of the requesting computer as that
> would make the logs much more easily read.
>
> Is there a Mac shell command or any way of getting this data for
> addresses inside a local network which are not listed on any DNS or
> Directory service?
>
>
I don't fully understand the context here, so this answer may not be
helpful .... in particular, I'm assuming that this is all happening
within the local network (i.e. you don't need to extract NAT
translations to get the real IP addresses).
You can use dns-sd or mDNS to get at least some of the data
dns-sd -B _workstation._tcp
gives you a list of all the workstations offering 'service' of
workstation. I think the "Instance name" column gives you the name of
the workstation and the MAC address (I only have a single Mac on my
network, so I don't know if it does the same thing for other
computers). This may be enough for you, or if not and if you have a
real network you can spot a pattern, or experiment with other commands
to translate from the info this gives you to something useful.
I also found it useful, or at least interesting, to look at the Bonjour
Browser at http://www.tildesoft.com/Programs.html
-- Alex.
More information about the use-livecode
mailing list