![]() ![]() ComputerName and LocalHostName are usually derived from the first user's name and the Mac model (e.g. On a newly installed consumer system no hostname is set. The hostname is usually related to or used with DNS, NIS, hosts file or similar methods of name resolution. ComputerName is the user friendly name, LocalHostname is the Bonjour name - both also visible in System Preferences > Sharing - and HostName is the hostname of the device. The computer name in macOS is not necessarily indentical to the hostname or the Bonjour name! You can simply check this with scutil -get. iTunes Music Sharing/File Sharing) you can't get the computer name based on the IP-address. ssh or ARD) and no service running on it (e.g. When nslookup is given an IP address, it will try to do a PTR lookup.Īs per the other reply, if the IP belongs to a Windows machine, you can also do nbtstat -A 10.31.46.Without further access to the host (e.g. So to get the hostname of 10.11.12.13, we say to DNS "Give me the PTR record for 13.12.11.10.in-addr.arpa." The IP address in the PTR record is reversed. However, there is no obligation to store PTR records so they may not be present, in which case the lookup will fail. For each IP address, there is a PTR record in which is stored the associated hostname. In DNS this is achieved through PTR records. Once you have the IP address, you are relying on a name resolution service to do a reverse lookup and return a hostname that is associated with an IP. You can trigger arp requests manually by pinging every IP on the network, or using a utility like nmap to do them all in one go. ![]() In order for this to work, both devices must be on the same layer 2 network - the same switch/vlan. ![]() In order to populate that list, the machine will have had to at some point issued an arp request, saying "who has IP x.x.x.x" - the owner will reply and upon receipt, the arp table will be populated. As per the question, arp -a will list the MAC addresses and corresponding IP addresses. This means that you need access to a device that has the IP address associated with the MAC. If you start with a MAC address, you first need to get the IP address. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |