I have two machines connected in link local IPv4 over a CAT6 cable. Is there a way from host1
that I can determine host2
's IPv4 address?
I'm on an Debian-derivative running kernel 3.2.0-34-generic.
I have two machines connected in link local IPv4 over a CAT6 cable. Is there a way from host1
that I can determine host2
's IPv4 address?
I'm on an Debian-derivative running kernel 3.2.0-34-generic.
Yes, already posted in the comments as a verified solution, but posting as an answer anyway.
Try using mDNS.
One should install avahi-daemon
on the machine you want to resolve (e.g. host2
), and at least some Avahi client libraries appropriate for your client system (e.g. host1
). These client libraries are usually installed by default on most desktop distributions. Provided your Linux distribution then automatically installs hooks to actually use the Avahi client (mDNS) for lookups, you should then be able to resolve the name host2.local
on the client machine.
The Avahi set of tools is an mDNS implementation. Summarized, it provides name services via multicast, for both regular host resolving and service discovery. Mac OS X users might recognize this as "Bonjour" and this is how for example iTunes applications find each other (service discovery). However, plain address lookup should work just out of the box.
Avahi is triggered in host name lookups because of the settings in /etc/nsswitch.conf
(for me at least on Debian/Ubuntu), like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
The .local
suffix is exported by the Avahi daemon and configurable. host2
is just the base hostname of the machine.
.local
scope. Try usingping host2.local
. – gertvdijk Dec 04 '12 at 16:54host2.local
via Avahi. – Naftuli Kay Dec 04 '12 at 17:51