Hi,
the first patch fixes the bug that Jean-Baptiste Denis found earlier today. In case the lookup was not done using a FQDN, the code would skip setting the entries to the ncache.
The second patch is an incremental improvement. I don't think we should abort the whole lookup if setting an entry in negcache would fail. The negative cache is a performance optimization after all.