{"id":153,"date":"2024-06-08T23:39:46","date_gmt":"2024-06-08T22:39:46","guid":{"rendered":"https:\/\/horrillo.eu\/?p=153"},"modified":"2024-06-08T23:44:59","modified_gmt":"2024-06-08T22:44:59","slug":"como-cambiar-el-nombre-de-host-en-un-servidor-linux","status":"publish","type":"post","link":"https:\/\/horrillo.eu\/?p=153","title":{"rendered":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg\" alt=\"\" class=\"wp-image-154\" style=\"width:379px;height:auto\" srcset=\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg 1024w, https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-300x225.jpg 300w, https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-768x576.jpg 768w, https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1536x1152.jpg 1536w, https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-2048x1536.jpg 2048w, https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-600x450.jpg 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Cambiar el nombre de host en un servidor Linux es una tarea com\u00fan que puede ser necesaria por diversas razones, como la reorganizaci\u00f3n de la red o la adopci\u00f3n de nuevas convenciones de nomenclatura. A continuaci\u00f3n, te explicamos c\u00f3mo hacerlo en algunas de las distribuciones de Linux m\u00e1s populares.<\/p>\n\n\n\n<p><strong>Cambiar el Nombre de Host Temporalmente<\/strong><\/p>\n\n\n\n<p>Este cambio es temporal y se perder\u00e1 despu\u00e9s de reiniciar el sistema.<\/p>\n\n\n\n<p>sudo hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p><strong>Cambiar el Nombre de Host Permanentemente<\/strong><\/p>\n\n\n\n<p>Para que el cambio sea permanente, es necesario modificar algunos archivos de configuraci\u00f3n. Aqu\u00ed te mostramos c\u00f3mo hacerlo en distintas distribuciones.<\/p>\n\n\n\n<p><strong>En Distribuciones Basadas en Debian\/Ubuntu<\/strong><\/p>\n\n\n\n<p>1. <strong>Editar el archivo <\/strong><strong>\/etc\/hostname<\/strong><strong>:<\/strong><\/p>\n\n\n\n<p>Abre el archivo con un editor de texto, como nano o vim.<\/p>\n\n\n\n<p>sudo nano \/etc\/hostname<\/p>\n\n\n\n<p>1. Cambia el contenido por el nuevo nombre de host y guarda el archivo.<\/p>\n\n\n\n<p>2. <strong>Editar el archivo \/etc\/hosts:<\/strong><\/p>\n\n\n\n<p>sudo nano \/etc\/hosts<\/p>\n\n\n\n<p>2. Busca la l\u00ednea que contiene el nombre de host antiguo y c\u00e1mbialo por el nuevo. Por ejemplo:<\/p>\n\n\n\n<p>127.0.1.1 nuevo-nombre-de-host<\/p>\n\n\n\n<p>3. <strong>Aplicar los cambios:<\/strong><\/p>\n\n\n\n<p>Para que los cambios surtan efecto sin necesidad de reiniciar, ejecuta:<\/p>\n\n\n\n<p>sudo hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p><strong>En Distribuciones Basadas en Red Hat\/CentOS\/Fedora<\/strong><\/p>\n\n\n\n<p>1. <strong>Usar hostnamectl (preferido en sistemas modernos):<\/strong><\/p>\n\n\n\n<p>sudo hostnamectl set-hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p>2. <strong>Editar el archivo <\/strong><strong>\/etc\/hostname<\/strong><strong>:<\/strong><\/p>\n\n\n\n<p>Abre el archivo con un editor de texto.<\/p>\n\n\n\n<p>sudo nano \/etc\/hostname<\/p>\n\n\n\n<p>2. Cambia el contenido por el nuevo nombre de host y guarda el archivo.<\/p>\n\n\n\n<p>3. <strong>Editar el archivo \/etc\/hosts:<\/strong><\/p>\n\n\n\n<p>sudo nano \/etc\/hosts<\/p>\n\n\n\n<p>3. Busca la l\u00ednea que contiene el nombre de host antiguo y c\u00e1mbialo por el nuevo. Por ejemplo:<\/p>\n\n\n\n<p>127.0.0.1 nuevo-nombre-de-host<\/p>\n\n\n\n<p>4. <strong>Aplicar los cambios:<\/strong><\/p>\n\n\n\n<p>Aunque hostnamectl generalmente se encarga de aplicar los cambios sin reiniciar, puedes asegurarte ejecutando:<\/p>\n\n\n\n<p>sudo hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p><strong>En Distribuciones Basadas en openSUSE<\/strong><\/p>\n\n\n\n<p>1. <strong>Usar hostnamectl:<\/strong><\/p>\n\n\n\n<p>sudo hostnamectl set-hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p>2. <strong>Editar el archivo \/etc\/hostname:<\/strong><\/p>\n\n\n\n<p>sudo nano \/etc\/hostname<\/p>\n\n\n\n<p>2. Cambia el contenido por el nuevo nombre de host y guarda el archivo.<\/p>\n\n\n\n<p>3. <strong>Editar el archivo \/etc\/hosts:<\/strong><\/p>\n\n\n\n<p>sudo nano \/etc\/hosts<\/p>\n\n\n\n<p>3. Busca la l\u00ednea que contiene el nombre de host antiguo y c\u00e1mbialo por el nuevo.<\/p>\n\n\n\n<p>4. <strong>Aplicar los cambios:<\/strong><\/p>\n\n\n\n<p>sudo hostname nuevo-nombre-de-host<\/p>\n\n\n\n<p><strong>Verificar el Cambio<\/strong><\/p>\n\n\n\n<p>Despu\u00e9s de realizar estos cambios, puedes verificar el nuevo nombre de host con el comando:<\/p>\n\n\n\n<p>hostname<\/p>\n\n\n\n<p>O, si usaste hostnamectl:<\/p>\n\n\n\n<p>hostnamectl<\/p>\n\n\n\n<p><strong>Nota Adicional<\/strong><\/p>\n\n\n\n<p>Es importante que los nombres de host sean \u00fanicos dentro de una red y que sigan las convenciones est\u00e1ndar para evitar problemas de resoluci\u00f3n de nombres.<\/p>\n\n\n\n<p>Esperamos que esta gu\u00eda te haya sido \u00fatil. Si tienes alguna pregunta o necesitas m\u00e1s detalles, no dudes en dejar un comentario a continuaci\u00f3n.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Cambiar el nombre de host en un servidor Linux es una tarea com\u00fan que puede ser necesaria por diversas razones, como la reorganizaci\u00f3n de la red o la adopci\u00f3n de nuevas convenciones de nomenclatura. A continuaci\u00f3n, te explicamos c\u00f3mo hacerlo en algunas de las distribuciones de Linux m\u00e1s populares. Cambiar el Nombre de Host Temporalmente [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/horrillo.eu\/?p=153\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog\" \/>\n<meta property=\"og:description\" content=\"Cambiar el nombre de host en un servidor Linux es una tarea com\u00fan que puede ser necesaria por diversas razones, como la reorganizaci\u00f3n de la red o la adopci\u00f3n de nuevas convenciones de nomenclatura. A continuaci\u00f3n, te explicamos c\u00f3mo hacerlo en algunas de las distribuciones de Linux m\u00e1s populares. Cambiar el Nombre de Host Temporalmente [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/horrillo.eu\/?p=153\" \/>\n<meta property=\"og:site_name\" content=\"Mi blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-08T22:39:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-08T22:44:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg\" \/>\n<meta name=\"author\" content=\"Juan Antonio Horrillo de Haro\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Juan Antonio Horrillo de Haro\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/horrillo.eu\/?p=153#article\",\"isPartOf\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153\"},\"author\":{\"name\":\"Juan Antonio Horrillo de Haro\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\"},\"headline\":\"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux\",\"datePublished\":\"2024-06-08T22:39:46+00:00\",\"dateModified\":\"2024-06-08T22:44:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153\"},\"wordCount\":447,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153#primaryimage\"},\"thumbnailUrl\":\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/horrillo.eu\/?p=153#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/horrillo.eu\/?p=153\",\"url\":\"https:\/\/horrillo.eu\/?p=153\",\"name\":\"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog\",\"isPartOf\":{\"@id\":\"https:\/\/horrillo.eu\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153#primaryimage\"},\"image\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153#primaryimage\"},\"thumbnailUrl\":\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg\",\"datePublished\":\"2024-06-08T22:39:46+00:00\",\"dateModified\":\"2024-06-08T22:44:59+00:00\",\"author\":{\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\"},\"breadcrumb\":{\"@id\":\"https:\/\/horrillo.eu\/?p=153#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/horrillo.eu\/?p=153\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/horrillo.eu\/?p=153#primaryimage\",\"url\":\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-scaled.jpg\",\"contentUrl\":\"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-scaled.jpg\",\"width\":2560,\"height\":1919},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/horrillo.eu\/?p=153#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/horrillo.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/horrillo.eu\/#website\",\"url\":\"https:\/\/horrillo.eu\/\",\"name\":\"Mi blog\",\"description\":\"Blog de inform\u00e1tica\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/horrillo.eu\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\",\"name\":\"Juan Antonio Horrillo de Haro\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g\",\"caption\":\"Juan Antonio Horrillo de Haro\"},\"url\":\"https:\/\/horrillo.eu\/?author=3\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/horrillo.eu\/?p=153","og_locale":"es_ES","og_type":"article","og_title":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog","og_description":"Cambiar el nombre de host en un servidor Linux es una tarea com\u00fan que puede ser necesaria por diversas razones, como la reorganizaci\u00f3n de la red o la adopci\u00f3n de nuevas convenciones de nomenclatura. A continuaci\u00f3n, te explicamos c\u00f3mo hacerlo en algunas de las distribuciones de Linux m\u00e1s populares. Cambiar el Nombre de Host Temporalmente [&hellip;]","og_url":"https:\/\/horrillo.eu\/?p=153","og_site_name":"Mi blog","article_published_time":"2024-06-08T22:39:46+00:00","article_modified_time":"2024-06-08T22:44:59+00:00","og_image":[{"url":"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg","type":"","width":"","height":""}],"author":"Juan Antonio Horrillo de Haro","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Juan Antonio Horrillo de Haro","Tiempo de lectura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/horrillo.eu\/?p=153#article","isPartOf":{"@id":"https:\/\/horrillo.eu\/?p=153"},"author":{"name":"Juan Antonio Horrillo de Haro","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec"},"headline":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux","datePublished":"2024-06-08T22:39:46+00:00","dateModified":"2024-06-08T22:44:59+00:00","mainEntityOfPage":{"@id":"https:\/\/horrillo.eu\/?p=153"},"wordCount":447,"commentCount":0,"image":{"@id":"https:\/\/horrillo.eu\/?p=153#primaryimage"},"thumbnailUrl":"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg","articleSection":["Linux"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/horrillo.eu\/?p=153#respond"]}]},{"@type":"WebPage","@id":"https:\/\/horrillo.eu\/?p=153","url":"https:\/\/horrillo.eu\/?p=153","name":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux - Mi blog","isPartOf":{"@id":"https:\/\/horrillo.eu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/horrillo.eu\/?p=153#primaryimage"},"image":{"@id":"https:\/\/horrillo.eu\/?p=153#primaryimage"},"thumbnailUrl":"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-1024x768.jpg","datePublished":"2024-06-08T22:39:46+00:00","dateModified":"2024-06-08T22:44:59+00:00","author":{"@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec"},"breadcrumb":{"@id":"https:\/\/horrillo.eu\/?p=153#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/horrillo.eu\/?p=153"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/horrillo.eu\/?p=153#primaryimage","url":"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-scaled.jpg","contentUrl":"https:\/\/horrillo.eu\/wp-content\/uploads\/2024\/06\/pexels-kevin-ku-92347-577585-scaled.jpg","width":2560,"height":1919},{"@type":"BreadcrumbList","@id":"https:\/\/horrillo.eu\/?p=153#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/horrillo.eu\/"},{"@type":"ListItem","position":2,"name":"C\u00f3mo Cambiar el Nombre de Host en un Servidor Linux"}]},{"@type":"WebSite","@id":"https:\/\/horrillo.eu\/#website","url":"https:\/\/horrillo.eu\/","name":"Mi blog","description":"Blog de inform\u00e1tica","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/horrillo.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Person","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec","name":"Juan Antonio Horrillo de Haro","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g","caption":"Juan Antonio Horrillo de Haro"},"url":"https:\/\/horrillo.eu\/?author=3"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":3,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/157"}],"wp:attachment":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}