Skip to content

Commit

Permalink
Respect /etc/hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Dec 13, 2021
1 parent 8682905 commit cf2198d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ static void preloadNSS() {
*
* All other platforms are unaffected.
*/
if (dlopen (LIBNSS_DNS_SO, RTLD_NOW) == NULL) {
printMsg(Verbosity::lvlWarn, fmt("Unable to load nss_dns backend"));
}
__nss_configure_lookup ("hosts", "dns");
if (!dlopen(LIBNSS_DNS_SO, RTLD_NOW))
warn("unable to load nss_dns backend");
// FIXME: get hosts entry from nsswitch.conf.
__nss_configure_lookup("hosts", "files dns");
#endif
});
}
Expand Down

0 comments on commit cf2198d

Please sign in to comment.