{"id":2868,"date":"2012-04-23T21:53:03","date_gmt":"2012-04-23T13:53:03","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2868"},"modified":"2023-04-28T09:49:21","modified_gmt":"2023-04-28T09:49:21","slug":"how-to-change-hostname-on-centos-5-8","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-change-hostname-on-centos-5-8\/","title":{"rendered":"How to Change Hostname on CentOS 5.8"},"content":{"rendered":"<p>In this post, i will show you the basic guides on how to change the hostname on linux CentOS 5.8 server. Assumed that you have root account access on this CentOS server and this steps may working on RHEL 6, RHEl 5, CentOS 5.5, CentOS 5.6, CentOS 5.7, CentOS 6.0, CentOS 6.1 and CentOS 6.2.<\/p>\n<p>1. Check current hostname :<\/p>\n<pre>\n[root@localhost ~]# hostname\nlocalhost.localdomain\n<\/pre>\n<p>2. Modify &#8220;\/etc\/sysconfig\/network&#8221; to change hostname :<\/p>\n<pre>\n[root@localhost ~]# vi \/etc\/sysconfig\/network\n<\/pre>\n<pre>\nNETWORKING=yes\nNETWORKING_IPV6=no\nHOSTNAME=localhost.localdomain\n<\/pre>\n<p>Change the hostname to the following :<\/p>\n<pre>\nNETWORKING=yes\nNETWORKING_IPV6=no\nHOSTNAME=centos58.ehowtuff.local\n<\/pre>\n<p>Alternatively, you can execute the following command : <\/p>\n<pre>\n[root@localhost ~]# hostname centos58.ehowtuff.local\n<\/pre>\n<p>3. Change host file :<\/p>\n<pre>\n[root@localhost ~]# vi \/etc\/hosts\n<\/pre>\n<pre>\n# Do not remove the following line, or various programs\n# that require network functionality will fail.\n127.0.0.1               localhost.localdomain localhost\n::1             localhost6.localdomain6 localhost6\n\n127.0.0.1 centos58.ehowstuff.local centos58\n<\/pre>\n<p>4. Reboot the server.<\/p>\n<pre>\n[root@localhost ~]# reboot\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, i will show you the basic guides on how to change the hostname on linux CentOS 5.8 server. Assumed that you have root account access on this&#8230;<\/p>\n","protected":false},"author":6,"featured_media":349,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055],"tags":[1244,1249,1414,1536,1546],"class_list":["post-2868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos","tag-centos-5-8","tag-hostname","tag-linux","tag-linux-utilities"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2868"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2868\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/349"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}