If your getting null value as your host name, check that both /etc/hosts and /etc/hostname files has the same name to the host, If not put the same name to both file as hostname, Here[1] you can find how to do that.
Wednesday, March 20, 2013
How to change machine name in Ubuntu 12.04 LTS
Go to the terminal
Type "sudo su" , because you need log into root mode to modify following files.
Now type "gedit /etc/hostname"
Replace new name with old name
Save and close the file
Now type "gedit /etc/hosts"
Replace your new name with old name
eg : 127.0.1.1 <old name> --> 127.0.1.1 <new name>
Save and close the file
Now you need to restart the machine, type "reboot" in terminal to restart via terminal.
Now you have successfully changed machine name.
Type "sudo su" , because you need log into root mode to modify following files.
Now type "gedit /etc/hostname"
Replace new name with old name
Save and close the file
Now type "gedit /etc/hosts"
Replace your new name with old name
eg : 127.0.1.1 <old name> --> 127.0.1.1 <new name>
Save and close the file
Now you need to restart the machine, type "reboot" in terminal to restart via terminal.
Now you have successfully changed machine name.
Subscribe to:
Posts (Atom)
Categories
- Apache (10)
- Apache commons (3)
- Axis2 (6)
- Carbon (1)
- Class Loader (1)
- client (2)
- Drools (1)
- Enum (1)
- equinox (3)
- How to (8)
- IDE (1)
- Intellij Idea (1)
- java (14)
- java best practice (1)
- JavaScript (2)
- jdk (1)
- JSON (2)
- Linux (1)
- Maven (5)
- Netbeans (1)
- OSGi (3)
- server (2)
- soap (1)
- soapui (2)
- Terminal (4)
- Tips (2)
- ubuntu (9)
- WSDL (2)
- XML (3)
- XSD (2)
- Zookeeper (1)