You may want all the information for posterity, such as hardware addresses and duration of connections you can script this easily by scanning your network at intervals, appending output to a file. But all currently online nodes will be listed unless your routers name service (usually some tiny dnsmasq) is broken. Note that your router will query its dhcp-leases file, and even nodes that have disconnected will resolve until their leases are purged. Reverse-lookup each live host on your router you will discover their dhcp-hostnames (usually these are set to their hostnames) - first create live_hosts.txt: Note that on most distros, you will need to be root for this, so (again, example on my local LAN): sudo arp-scan 192.168.169.0/24 If you have a non-standard interface, you may specify it with the -I switch: arp-scan -I enp4s2 192.168.1.0/24 Again, install arp-scan for your distribution, then do: arp-scan 192.168.1.0/24Īssuming again you are on the same LAN as the example above. Similarly, arp-scan should give you the mac address. The others are in DNS, and so they have hostnames. The hosts with no names are dhcp and do not get hostnames. Nmap done: 256 IP addresses (11 hosts up) scanned in 3.79 seconds Nmap will ping scan all IPs and try to resolve their hostnames for you.įor example, on my local LAN I see: nmap -sP 192.168.169.0/24 Where /nn is your IP and subnet mask bits. Install nmap for whatever flavour of Linux you are on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |