When I use the command ping ff02::1%eth0 to get a response from all IPv6 hosts in the network segment, I get responses from a bunch of link-local (fe80::) addresses (LLIPs).

In order to figure out which hosts are (or are not) responding, I then have to use arp to see the MAC address associated with the IPv4 address, and then try to match them up with the IPv6 address to figure out which host is which.

Although I am starting to remember which MAC address belongs to which host, I'd much rather have the system automatically map the LLIPs back to hostnames.

Is there any mechanism to do this?

I have tried putting the LLIP in /etc/hosts, with and without the zone (%interface suffix), and this allows me to ping a single host by name, but it is not used by ping to convert IP responses back to hostnames.

ping has the -n option to avoid name resolution which hints to me that what I am trying to achieve is possible, I'm just not quite sure how to do it!

  • I just examined ping's behavior using strace (on Kali Linux): ping does not look up /etc/hosts. My suspicion is that you have to script just what you did manually. ~ Using IPv6 multicast to find out what hosts are on the LAN sounds a bit odd for several reasons, moreover, some nodes might choose to not answer - a more aggressive approach is to use a tool like alive6 from the THC-IPv6 suite. Looks slightly like an XY problem - what are you actually trying to achieve? – countermode Aug 3 '17 at 13:10
  • strace tells me ping does read /etc/hosts if I supply a hostname on the command line, so not sure exactly what governs those lookups. I am setting up some headless Raspberry Pi systems with IPv6 and sometimes due to typos they will lose their IPv4 and/or IPv6 addresses, so I am using this to figure out whether they are actually up and I can connect to them to fix the problem, without going to the physical box to do so. – Malvineous Aug 5 '17 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.