Tag Archives: hostname

How to change the hostname in RHEL7

At last, Red Hat has decided to act like other distros to change the hostname of the server in Red Hat Enterprise Linux 7. In older Red Hat releases, changing the hostname required modifying the  “/etc/sysconfig/network” configuration file and edit … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

How to change your hostname in Ubuntu without restarting

Replace your old hostname in the /etc/hostname file with the new one: “sudo vi /etc/hostname” Replace your old hostname beside the 127.0.0.1 in the /etc/hosts file Run the following “sudo service hostname start” Exit the terminal and open a new … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

How to change hostname in Redhat & Oracle Linux

As user “root” “vi /etc/sysconfig/network”, change HOSTNAME value to the new hostname “hostname NEW_HOST_NAME” to change it for the current sessions “vi /etc/hosts”, change the old value to point to the new hostname “service network restart” to restart the networking … Continue reading

Posted in Linux | Tagged , , , , | 2 Comments

Resolve Hostname on AIX

host “hostname” e.g. host “myhost” Output: myhost is 10.11.212.134,  Aliases:   wkms2

Posted in Unix | Tagged , | Leave a comment

Change your hostname randomly in Ubuntu

The following script worked great: #!/bin/bash #random_computer_name sudo sed -i 1,10d /etc/hostname function randnum{number=$[ ( $RANDOM % 15 ) + 8 ]} randnum function randpass{newhostname=`} randpass (echo ‘0a’; echo $newhostname; echo ‘.’; echo ‘wq’) | sudo ed -s /etc/hostname sudo … Continue reading

| Tagged , | Leave a comment

Change your computer’s hostname in Ubuntu

“sudo hostname new_name“ where “new_name” is the new hostname you’ll use

| Tagged , | Leave a comment