{"id":22318,"date":"2021-06-18T14:27:09","date_gmt":"2021-06-18T14:27:09","guid":{"rendered":"https:\/\/www.itrcp.com\/blog\/?p=22318"},"modified":"2025-09-22T14:11:02","modified_gmt":"2025-09-22T14:11:02","slug":"how-to-change-hostname-in-centos-7","status":"publish","type":"post","link":"https:\/\/www.itrcp.com\/blog\/learn\/how-to-change-hostname-in-centos-7.html","title":{"rendered":"How to Change Hostname in CentOS 7"},"content":{"rendered":"\n<figure class=\"wp-block-gallery columns-0 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><\/ul><\/figure>\n\n\n\n<p>Here you will learn to change and Manage the Hostname Using hostnamectl. You can run the following command to check for the current hostname<\/p>\n\n\n\n<p>Confirm that your current hostname, execute the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@nod home]# hostnamectl<\/code><\/pre>\n\n\n\n<p>change your current hostname, execute the following command.<\/p>\n\n\n\n<p>That\u2019s it! You\u2019ve just changed your server hostname to server1.domain.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here you will learn to change and Manage the Hostname Using hostnamectl. You can run the following command to check for the current hostname Confirm that your current hostname, execute the following command change your current hostname, execute the following command. That\u2019s it! You\u2019ve just changed your server hostname to server1.domain.com<\/p>\n","protected":false},"author":1,"featured_media":174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-22318","post","type-post","status-publish","format-gallery","has-post-thumbnail","hentry","category-learn","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/posts\/22318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/comments?post=22318"}],"version-history":[{"count":1,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/posts\/22318\/revisions"}],"predecessor-version":[{"id":22319,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/posts\/22318\/revisions\/22319"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/media?parent=22318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/categories?post=22318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itrcp.com\/blog\/wp-json\/wp\/v2\/tags?post=22318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}