Avahi hostname resolution: caching somewhere?

I am using Fedora 18 with avahi command line tools (version 0.6.31)

I use avahi-resolve-host-name to discover the IP addresses of units in my subnet for testing purposes during development. I track request and response with Wireshark. After one successful request and response, no additional requests appear in Wireshark, but the tool still returns the IP address. Is it possible that the computer daemon / avahi / something else "caches" the result?

Question: I want to send a request packet with EVERY CALL avahi-resolve-host-name. Is it possible?

Reason: I call so-called “false positives”. I try to resolve "test1.local" and I get the resulting IP address, but the block is no longer at that IP address. I want the request to be sent every time, so I can avoid looking at units with the wrong IP addresses.

+6
source share
1 answer

I see that I am a little late to answer your question, but I am going to leave a general answer if someone else stumbles upon this.

My answer is based on avahi-0.6.32_rc.


Is it possible that the computer daemon / avahi / something else "caches" the result?

Yes, avahi-daemon are cache search results. Although this is not explicitly stated in the functions, the avahi-daemon(8) man page suggests:

The daemon [...] provides two IPC APIs for local programs that use the mDNS cache entry supported by avahi-daemon.


I want to send a request packet with EVERY call avahi-resolve-host-name. Is it possible?

Yes it is. The corresponding cache-entries-max option (from avahi-daemon.conf(5) ):

cache-entries-max= Gets an unsigned integer that determines how many resource records are cached for each interface. Larger values ​​allow mDNS to work correctly on large local area networks, but also increase memory consumption.

To achieve the desired effect, you can simply set:

 cache-entries-max=0 

This will completely disable caching and force avahi-daemon to reissue MDNS packets for each request, so you can control them.

However, I should note here that this will also make avahi virtually useless for normal use. While avahi-daemon will produce search packets, it will not be able to save the results, and every call to avahi-resolve-host-name (as well as other command line tools, nss-mdns, D-Bus API ...) will end with a mistake.

+2
source

Source: https://habr.com/ru/post/952304/


All Articles