Host name with underscore such as foo_bar.local. will be incorrectly parsed as:

foo_bar.local. -> Instance=foo_bar, Domain=, Subtype=, Application=foo_bar.local, Protocol=

It then creates a wrong key when added to the cache : foo_bar.foo_bar.local..
which results in the host name not getting resolved even if the entry is there in the cache

Correct parsing should be:

foo_bar.local. -> Instance=foo_bar, Domain=local, Subtype=, Application=, Protocol=