DNS works with host, but not with wget

  • This is the first time to see resolve hosts keyword, it seems wrong. You should have something like

    hosts: files dns [NOTFOUND=return]
    

    or if you have mDNS installed

    hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4
    

    You can remove [NOTFOUND=return] or [!UNAVAIL=return] , it's the default action anyway if nothing left to query.

  • Well, after some digging I could find that there is an NSS module new to me

    libnss-resolve

    nss module to resolve names via systemd-resolved
    
    nss-resolve is a plugin for the GNU Name Service Switch (NSS) functionality
    of the GNU C Library (glibc) providing DNS and LLMNR resolution to programs via
    the systemd-resolved daemon (provided in the systemd package).
    
    Installing this package automatically adds resolve to /etc/nsswitch.conf.
    

    You could end up installing it somehow and not with the packages you mentioned. There is no package depends on it.

    ~$ apt-cache rdepends libnss-resolve
    libnss-resolve
    Reverse Depends:
    

    But I can't say anything right now, why systemd-resolved was unreliable. It is better to report it as bug in systemd.