{"id":3605,"date":"2013-05-03T12:33:33","date_gmt":"2013-05-03T12:33:33","guid":{"rendered":"https:\/\/bodhost.com\/kb\/?p=3605"},"modified":"2026-02-26T14:04:32","modified_gmt":"2026-02-26T14:04:32","slug":"how-to-change-server-hostname-on-centos-dedicated-server","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/","title":{"rendered":"How to Change Server Hostname on CentOS Dedicated Server?"},"content":{"rendered":"\r\n<p>The blog post shows steps on how to change the hostname on <a href=\"https:\/\/www.bodhost.com\/managed-dedicated-servers\" target=\"_blank\" rel=\"noreferrer noopener\">CentOS dedicated server<\/a>. There are two different methods for changing the server hostname on CentOS.<\/p>\r\n\r\n\r\n\r\n<p>The first method to change the server hostname on CentOS is using the \u201c<strong>Hostname command<\/strong>\u201d.<\/p>\r\n\r\n\r\n\r\n<p>Login to your dedicated server and open the console.<\/p>\r\n\r\n\r\n\r\n<p>Fire the following command into the console:<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p><em>hostname my.server.com<\/em><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>Once the above command is fired, it will automatically change the server hostname on CentOS.<\/p>\r\n\r\n\r\n\r\n<p>The second method to change the server hostname on CentOS is via the \u201c<strong>Editing network file<\/strong>\u201d.<\/p>\r\n\r\n\r\n\r\n<p>To do this, simply fire the below command into the console:<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p><em>vi \/etc\/sysconfig\/network<\/em><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>Where \u201c<strong>vi<\/strong>\u201d is a file editor.<\/p>\r\n\r\n\r\n\r\n<p>Once you enter the above command you will see something similar as shown below:<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p><em>NETWORKING=\u201dyes\u201d<\/em><br \/><em>GATEWAY=\u201d192.0.2.2\u2033<\/em><br \/><em>HOSTNAME=\u201dsome.servername.com\u201d<\/em><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>Now, just change the \u201chostname\u201d there, save, and exit the file using the following command.<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p><em>:wq<\/em><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>That\u2019s it! You\u2019re done. Following the above <strong>steps the server hostname on CentOS dedicated server<\/strong> will be successfully changed.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>The blog post shows steps on how to change the hostname on CentOS dedicated server. There are two different methods for changing the server hostname on CentOS. The first method to change the server hostname on CentOS is using the \u201cHostname command\u201d. Login to your dedicated server and open the console. Fire the following command [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[471,469,470],"class_list":["post-3605","post","type-post","status-publish","format-standard","hentry","category-dedicated-server-hosting","tag-centos-dedicated-server","tag-change-hostname-on-centos","tag-changing-hostname"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change Server Hostname on CentOS Dedicated Server?<\/title>\n<meta name=\"description\" content=\"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change Server Hostname on CentOS Dedicated Server?\" \/>\n<meta property=\"og:description\" content=\"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-03T12:33:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:04:32+00:00\" \/>\n<meta name=\"author\" content=\"Jonathan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/\"},\"author\":{\"name\":\"Jonathan\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/77a3beb34058f91e64f2464d745a0a55\"},\"headline\":\"How to Change Server Hostname on CentOS Dedicated Server?\",\"datePublished\":\"2013-05-03T12:33:33+00:00\",\"dateModified\":\"2026-02-26T14:04:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/\"},\"wordCount\":181,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"centos dedicated server\",\"change hostname on centos\",\"changing hostname\"],\"articleSection\":[\"Dedicated Server Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/\",\"name\":\"How to Change Server Hostname on CentOS Dedicated Server?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2013-05-03T12:33:33+00:00\",\"dateModified\":\"2026-02-26T14:04:32+00:00\",\"description\":\"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-change-server-hostname-on-centos-dedicated-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Dedicated Server Hosting\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/dedicated-server-hosting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change Server Hostname on CentOS Dedicated Server?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/77a3beb34058f91e64f2464d745a0a55\",\"name\":\"Jonathan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g\",\"caption\":\"Jonathan\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/jonathan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change Server Hostname on CentOS Dedicated Server?","description":"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?","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:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Change Server Hostname on CentOS Dedicated Server?","og_description":"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?","og_url":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2013-05-03T12:33:33+00:00","article_modified_time":"2026-02-26T14:04:32+00:00","author":"Jonathan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/"},"author":{"name":"Jonathan","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/77a3beb34058f91e64f2464d745a0a55"},"headline":"How to Change Server Hostname on CentOS Dedicated Server?","datePublished":"2013-05-03T12:33:33+00:00","dateModified":"2026-02-26T14:04:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/"},"wordCount":181,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["centos dedicated server","change hostname on centos","changing hostname"],"articleSection":["Dedicated Server Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/","url":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/","name":"How to Change Server Hostname on CentOS Dedicated Server?","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2013-05-03T12:33:33+00:00","dateModified":"2026-02-26T14:04:32+00:00","description":"In this article you will learn about How to Change Server Hostname on CentOS Dedicated Server?","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/how-to-change-server-hostname-on-centos-dedicated-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Dedicated Server Hosting","item":"https:\/\/www.bodhost.com\/kb\/category\/dedicated-server-hosting\/"},{"@type":"ListItem","position":2,"name":"How to Change Server Hostname on CentOS Dedicated Server?"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/77a3beb34058f91e64f2464d745a0a55","name":"Jonathan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b93e6817cd84520fc41dbc73dfb9004e812a9fd554d40b6e38907e163c0b1e8?s=96&d=mm&r=g","caption":"Jonathan"},"url":"https:\/\/www.bodhost.com\/kb\/author\/jonathan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/3605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=3605"}],"version-history":[{"count":5,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/3605\/revisions"}],"predecessor-version":[{"id":12257,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/3605\/revisions\/12257"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=3605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=3605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=3605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}