{"id":12377,"date":"2016-07-31T14:28:27","date_gmt":"2016-07-31T08:58:27","guid":{"rendered":"http:\/\/blog.taragana.com\/?p=12377"},"modified":"2016-07-31T14:28:27","modified_gmt":"2016-07-31T08:58:27","slug":"ubuntu-how-to-change-host-name-and-propagate-to-dhcp-server","status":"publish","type":"post","link":"https:\/\/blog.taragana.com\/ubuntu-how-to-change-host-name-and-propagate-to-dhcp-server-12377","title":{"rendered":"Ubuntu: How to Change Host name and Propagate to DHCP Server"},"content":{"rendered":"

How to change Hostname on Ubuntu<\/h2>\n

First find your current host name by typing:
\nhostname<\/strong>
\nOpen \/etc\/hostname and change the host name specified there to the new host name.
\nsudo vi \/etc\/hostname<\/strong>
\nNow open \/etc\/hosts and locate the old host name in the file and change it to the new host name.
\nsudo vi \/etc\/hosts<\/strong>
\nNow restart hostname with:
\nsudo service hostname restart<\/strong><\/p>\n

How to propagate Hostname Change to DHCP Server and other machines<\/h2>\n

The chosen host name should be propagated to the DHCP server so that any other computer can refer to this computer by your new chosen hostname. To do that run the following commands:
\nsudo dhcclient -r ; sudo dhclient<\/strong>
\nNow you should be able to access this machine by its newly chosen host name from any other machine in the same network and served the same DHCP server.
\nAn exception would be if a machine is configured statically or not configured to use the name server associated with this dhcp server.
\nMost routers today comes with DHCP server and an associated Name Server which can be configured as shown above.<\/p>\n","protected":false},"excerpt":{"rendered":"

How to change Hostname on Ubuntu First find your current host name by typing: hostname Open \/etc\/hostname and change the host name specified there to the new host name. sudo vi \/etc\/hostname Now open \/etc\/hosts and locate the old host name in the file and change it to the new host name. sudo vi \/etc\/hosts […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[66,109],"_links":{"self":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/12377"}],"collection":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/comments?post=12377"}],"version-history":[{"count":0,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/12377\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/media?parent=12377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/categories?post=12377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/tags?post=12377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}