{"id":1967,"date":"2025-03-29T16:12:24","date_gmt":"2025-03-29T13:12:24","guid":{"rendered":"https:\/\/virtirio.com\/blog\/?post_type=knowledgebase&#038;p=1967"},"modified":"2025-03-29T17:28:29","modified_gmt":"2025-03-29T14:28:29","slug":"hostname-ubuntu","status":"publish","type":"knowledgebase","link":"https:\/\/virtirio.com\/blog\/wiki\/ubuntu\/hostname-ubuntu\/","title":{"rendered":"\u041a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 (hostname) \u0432 Ubuntu?"},"content":{"rendered":"<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 Ubuntu, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <strong>hostnamectl<\/strong> \u0438 \u0432\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b <strong>\/etc\/hosts<\/strong>. \u0412\u043e\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f:<\/p>\n<ol>\n<li><strong>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u0447\u0435\u0440\u0435\u0437 hostnamectl<\/strong><br \/>\n\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 <em>\u043d\u043e\u0432\u043e\u0435_\u0438\u043c\u044f<\/em> \u043d\u0430 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo hostnamectl set-hostname \u043d\u043e\u0432\u043e\u0435_\u0438\u043c\u044f<\/pre>\n<p>\u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435.<\/li>\n<li><strong>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \/etc\/hosts<\/strong><br \/>\n\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <strong>\/etc\/hosts<\/strong>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo nano \/etc\/hosts<\/pre>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0441\u0442\u0430\u0440\u043e\u0435 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 <em>(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>127.0.1.1   \u0441\u0442\u0430\u0440\u043e\u0435_\u0438\u043c\u044f<\/code>)<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 <em>\u043d\u043e\u0432\u043e\u0435_\u0438\u043c\u044f<\/em>. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <em>(Ctrl+O, Enter, Ctrl+X)<\/em>.<\/li>\n<li><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/strong><br \/>\n\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">hostnamectl<\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">hostname<\/pre>\n<\/li>\n<li><strong>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438)<\/strong><br \/>\n\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo reboot<\/pre>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u0448\u0430\u0433\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 Ubuntu \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 Ubuntu, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 hostnamectl \u0438 \u0432\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b \/etc\/hosts. \u0412\u043e\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f: \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u0447\u0435\u0440\u0435\u0437 hostnamectl \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","knowledgebase_cat":[138],"class_list":["post-1967","knowledgebase","type-knowledgebase","status-publish","hentry","knowledgebase_cat-ubuntu"],"_links":{"self":[{"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/knowledgebase\/1967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/comments?post=1967"}],"version-history":[{"count":3,"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/knowledgebase\/1967\/revisions"}],"predecessor-version":[{"id":1982,"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/knowledgebase\/1967\/revisions\/1982"}],"wp:attachment":[{"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/media?parent=1967"}],"wp:term":[{"taxonomy":"knowledgebase_cat","embeddable":true,"href":"https:\/\/virtirio.com\/blog\/wp-json\/wp\/v2\/knowledgebase_cat?post=1967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}