I know it's possible to complete this task using the networking API but everything about this API is highly confusing to me. Do you know of any place I can go where I can find out about unix network programming syntax? I know all hosts on a subnet have the same network address and subnet mask values.
I know how to use the subnet mask to obtain the network address from a given IP address. First, convert the subnet mask and IP address to binary and perform an AND operation on them to obtain the network address.
Given this, how can I find the IP Address given the subnet mask and network address???
To giltjr: What do you mean when you say PTR; do you mean pointer? I'm pretty sure I don't need a dns query because what I'm doing shouldn't involve sockets.
Here's an example of how I can find the DNS given the subnet id.
Given the subnet mask and a network address in dotted-decimal notation, I'd like to find all the DNS names assigned to all hosts on that subnet.
Main Topics
Browse All Topics





by: giltjrPosted on 2009-04-11 at 17:27:48ID: 24124135
You might not be able to. In order to find a host name based on the IP address there needs to be a PTR record for the address setup.
What you would need to do is do a DNS query for the the host "name" d.c.b.a.in-addr.arpa the d.c.b.a is the IP address backwards.
So if you knew the IP address was 10.23.4.15 you would look up 15.4.23.10.in-addr.arpa.