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.
source share