{"id":2853,"date":"2022-12-20T15:17:30","date_gmt":"2022-12-20T18:17:30","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/nssresolve-man8\/"},"modified":"2022-12-20T15:17:30","modified_gmt":"2022-12-20T18:17:30","slug":"nssresolve-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/nssresolve-man8\/","title":{"rendered":"NSS&minus;RESOLVE (man8)"},"content":{"rendered":"<h1 align=\"center\">NSS\u2212RESOLVE<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">nss-resolve, libnss_resolve.so.2 \u2212 Hostname resolution via systemd\u2212resolved.service<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">libnss_resolve.so.2<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>nss\u2212resolve<\/b> is a plug\u2212in module for the GNU Name Service Switch (NSS) functionality of the GNU C Library (<b>glibc<\/b>) enabling it to resolve hostnames via the <b>systemd-resolved<\/b>(8) local network name resolution service. It replaces the <b>nss\u2212dns<\/b> plug\u2212in module that traditionally resolves hostnames via DNS.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To activate the NSS module, add &#8220;resolve\u00a0[!UNAVAIL=return]&#8221; to the line starting with &#8220;hosts:&#8221; in \/etc\/nsswitch.conf. Specifically, it is recommended to place &#8220;resolve&#8221; early in \/etc\/nsswitch.conf&#8217;s &#8220;hosts:&#8221; line. It should be before the &#8220;files&#8221; entry, since systemd\u2212resolved supports \/etc\/hosts internally, but with caching. To the contrary, it should be after &#8220;mymachines&#8221;, to give hostnames given to local VMs and containers precedence over names received over DNS. Finally, we recommend placing &#8220;dns&#8221; somewhere after &#8220;resolve&#8221;, to fall back to <b>nss\u2212dns<\/b> if systemd\u2212resolved.service is not available.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that <b>systemd\u2212resolved<\/b> will synthesize DNS resource records in a few cases, for example for &#8220;localhost&#8221; and the current hostname, see <b>systemd-resolved<\/b>(8) for the full list. This duplicates the functionality of <b>nss-myhostname<\/b>(8), but it is still recommended (see examples below) to keep <b>nss\u2212myhostname<\/b> configured in \/etc\/nsswitch.conf, to keep those names resolveable if <b>systemd\u2212resolved<\/b> is not running.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Here is an example \/etc\/nsswitch.conf file that enables <b>nss\u2212resolve<\/b> correctly:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">passwd: compat systemd <br \/> group: compat systemd <br \/> shadow: compat<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">hosts: mymachines <b>resolve [!UNAVAIL=return]<\/b> myhostname files dns <br \/> networks: files<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">protocols: db files <br \/> services: db files <br \/> ethers: db files <br \/> rpc: db files<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">netgroup: nis<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>systemd<\/b>(1), <b>systemd-resolved<\/b>(8), <b>nss-systemd<\/b>(8), <b>nss-myhostname<\/b>(8), <b>nss-mymachines<\/b>(8), <b>nsswitch.conf<\/b>(5)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  nss-resolve, libnss_resolve.so.2 \u2212 Hostname resolution via systemd\u2212resolved.service <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,203],"class_list":["post-2853","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-nss-resolve"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=2853"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2853\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}