{"id":1098,"date":"2012-08-21T10:33:06","date_gmt":"2012-08-21T08:33:06","guid":{"rendered":"http:\/\/www.dotmana.com\/weblog\/?p=1098"},"modified":"2012-08-21T10:33:06","modified_gmt":"2012-08-21T08:33:06","slug":"hostname-name-or-service-not-known","status":"publish","type":"post","link":"http:\/\/www.dotmana.com\/weblog\/2012\/08\/hostname-name-or-service-not-known\/","title":{"rendered":"hostname : name or service not known"},"content":{"rendered":"<p>Pour ceux qui gal\u00e8rent avec leur hostname en FQDN, voici <a target=\"_blank\" href=\"http:\/\/www.virtualmin.com\/node\/19226#comment-86441\">le tuto \u00e0 suivre<\/a> :<\/p>\n<blockquote>\n<p>Getting the FQDN to work properly can be a b*tch. \ud83d\ude09<\/p>\n<p>Basically, for the FQDN resolution to work correctly, three (or four)<br \/>\n things need to play together. That&#8217;s the files \/etc\/hostname,<br \/>\n\/etc\/hosts, \/etc\/resolv.conf and your external nameserver (provided by<br \/>\nyour hoster e.g.).<\/p>\n<p>Let&#8217;s say your server&#8217;s hostname is &#8220;lyra&#8221; and its already<br \/>\nestablished and externally resolvable domain name is &#8220;tianet.de&#8221;. Let&#8217;s<br \/>\nfurther say that lyra&#8217;s IP is 46.4.181.243, and the nameserver that<br \/>\nforwards requests to the outside has the IP 46.4.181.241 (real-life<br \/>\nexample from my experimental Virtualmin VM).<\/p>\n<p>Then the contents need to be as follows:<\/p>\n<p><code>\/etc\/hostname<\/code><\/p>\n<div class=\"geshifilter\">\n<pre class=\"text geshifilter-text\" style=\"font-family:monospace;\">lyra<\/pre>\n<\/div>\n<p><code>\/etc\/hosts<\/code><\/p>\n<div class=\"geshifilter\">\n<pre class=\"text geshifilter-text\" style=\"font-family:monospace;\">127.0.0.1       localhost\n46.4.181.243    lyra.tianet.de lyra<\/pre>\n<\/div>\n<p>(Note that I have both the FQDN and the standalone hostname there.)<\/p>\n<p><code>\/etc\/resolv.conf<\/code><\/p>\n<div class=\"geshifilter\">\n<pre class=\"text geshifilter-text\" style=\"font-family:monospace;\">nameserver 46.4.181.241\ndomain tianet.de<\/pre>\n<\/div>\n<p>After setting these contents, it might be helpful\/required to reboot the machine or execute <code>\/etc\/init.d\/networking restart<\/code>, though usually that&#8217;s not necessary.<\/p>\n<p><code>hostname<\/code> should then reply with &#8220;lyra&#8221;, and <code>hostname -f<\/code> with &#8220;lyra.tianet.de&#8221;.<\/p>\n<p>If you still have trouble then, you can additionally check the file <code>\/etc\/nsswitch.conf<\/code> which tells the system which facilities to consult for resolving various stuff. You should have a line like this there:<\/p>\n<div class=\"geshifilter\">\n<pre class=\"text geshifilter-text\" style=\"font-family:monospace;\">hosts: files dns<\/pre>\n<\/div>\n<p>If it&#8217;s missing or deviating, edit it to this.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Pour ceux qui gal\u00e8rent avec leur hostname en FQDN, voici le tuto \u00e0 suivre : Getting the FQDN to work properly can be a b*tch. \ud83d\ude09 Basically, for the FQDN resolution to work correctly, three (or four) things need to &hellip; <a href=\"http:\/\/www.dotmana.com\/weblog\/2012\/08\/hostname-name-or-service-not-known\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,14],"tags":[],"class_list":["post-1098","post","type-post","status-publish","format-standard","hentry","category-linux","category-work"],"_links":{"self":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/comments?post=1098"}],"version-history":[{"count":2,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1098\/revisions"}],"predecessor-version":[{"id":1100,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1098\/revisions\/1100"}],"wp:attachment":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/media?parent=1098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/categories?post=1098"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/tags?post=1098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}