1. View hostname with uname-a [root @ localhostlogs] # uname-aLinuxlocalhot.domain12.6.32-220.el6.x86_64 #1SMPTueDec619: 48: 22GMT2011x86_64x86_64x86_64GNU/Linux with ho 1. View hostname
[root@localhost logs]# uname -aLinux localhot.domain1 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost logs]# uname -nlocalhot.domain1[root@localhost logs]# hostnamelocalhot.domain1
2. how to modify the hostname
- You can modify/etc/sysconfig/network.
- The command sysctl kernel. hostname = Test2 takes effect immediately without modifying/etc/sysconfig/network. That is, the value of/proc/sys/kernel/hostname will be overwritten by/etc/sysconfig/network, however, the new hostname takes effect in/proc/sys/kernel/hostname by modifying the kernel.
References: http://www.cnblogs.com/kerrycode/p/3595724.html