Can 'avahi' handle IP address lookups as well as host name lookups?

Yes, avahi supports reverse IP address lookups for the .local names that are registered on the local network. However, most of the commands for performing test queries contact DNS servers directly without using avahi. In order to confirm that this is working at the command line, you have to use the getent hosts command instead of nslookup, dig, or host.

For example, you can look up an IP address using the following commands:

$ nslookup 192.168.0.1
$ dig -x 192.168.0.1
$ host 192.168.0.1
$ getent hosts 192.168.0.1

Only the getent hosts command will return the corresponding name because it is the only command that uses avahi to perform the reverse lookup.

(Actually, this also applies to looking up names, but it is usually simpler to just type ping hostname.local which performs a name lookup using DNS or avahi and checks connectivity at the same time.)


dig also could perform reverse DNS lookup using avahi:

dig -x 192.168.0.1 @224.0.0.251 -p 5353