{"id":1646,"date":"2013-10-11T11:32:15","date_gmt":"2013-10-11T09:32:15","guid":{"rendered":"http:\/\/raftaman.net\/?p=1646"},"modified":"2021-05-15T11:46:38","modified_gmt":"2021-05-15T09:46:38","slug":"resolve-local-host-name-with-nss-myhostname","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1646","title":{"rendered":"Resolve local hostname with nss-myhostname"},"content":{"rendered":"<p>Many applications rely on a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fully_qualified_domain_name\">fully qualified domain name<\/a> and won&#8217;t work properly or even fail to start without one. For example, even if your hostname is correctly set up, apache won&#8217;t start with the default configuration on Fedora 19 if your DNS server cannot resolve the hostname:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nAH00557: httpd: apr_sockaddr_info_get() failed for HostName\r\nAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message\r\n<\/pre>\n<p>But fortunately there&#8217;s a plugin to the <a href=\"http:\/\/www.gnu.org\/software\/libc\/manual\/html_node\/Name-Service-Switch.html\">GNU Name Service Switch (NSS)<\/a> of <a href=\"https:\/\/www.gnu.org\/software\/libc\/\">glibc<\/a> called <a href=\"http:\/\/0pointer.de\/lennart\/projects\/nss-myhostname\/\"><code>nss-myhostname<\/code><\/a> that ensures, that the local hostname is always resolvable.<\/p>\n<p>Since Fedora 19, <code>nss-myhostname<\/code> is no longer a separate package but part of the <code>systemd<\/code> package. To enable the plugin, open <code>\/etc\/nsswitch.conf<\/code> with you favourite editor and add <strong>myhostname<\/strong> to the line starting with <code>hosts:<\/code><\/p>\n<pre class=\"brush: plain; highlight: [2]; title: \/etc\/nsswitch.conf; notranslate\" title=\"\/etc\/nsswitch.conf\">\r\n&#x5B;...]\r\nhosts:     files dns myhostname\r\n&#x5B;...]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Many applications rely on a fully qualified domain name and won&#8217;t work properly or even fail to start without one. For example, even if your hostname is correctly set up, apache won&#8217;t start with the default configuration on Fedora 19 if your DNS server cannot resolve the hostname: AH00557: httpd: apr_sockaddr_info_get() failed for HostName AH00558: httpd: Could not reliably determine&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1646\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[62,63,7],"class_list":["post-1646","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-apache","tag-dns","tag-fedora"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1646"}],"version-history":[{"count":14,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1646\/revisions"}],"predecessor-version":[{"id":2178,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1646\/revisions\/2178"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}