how to change hostname in linux without restart

its quite simple ..

you need just to echo new hostname into /proc/sys/kernel/hostname

for exmaple –

echo $NEWHOSTNAME > /proc/sys/kernel/hostname

logoff and login again to host :)

but remeber to add the new hostname to /etc/hosts as well

comments powered by Disqus