What will log file be written when the hostname is changed? and how do I learn the previous hostnames? p.s there is not seen at the /var/log/messages
1 Answer
What log file will be written when the hostname is changed?
None.
There is no file that contains this history. Perhaps you may be able to pull it out of syslog, but you're going to have to go searching for it.
Source Hostname changes history in unix systems, answer by EEAA
And:
Have a look at these files:
/etc/hostname /etc/hosts /etc/ssh/ssh_host_*_key.pub $HOME/.ssh/id_*.pub
In these typically the host name appears and it might be still unchanged by your renaming action (however you did that).
Also these might contain the old name:
/var/log/Xorg.failsafe.log /var/log/auth.log.1 /var/log/pm-suspend.log.1 /var/log/Xorg.1.log.old /var/log/lightdm/x-0.log /var/log/lightdm/x-1.log /var/log/lightdm/x-2.log /var/log/pm-suspend.log /var/log/Xorg.0.log.old /var/log/Xorg.1.log /var/log/syslog /var/log/Xorg.2.log /var/log/auth.log /var/log/kern.log.1 /var/log/kern.log /var/log/Xorg.failsafe.log.old /var/log/syslog.1 /var/log/Xorg.0.log
Source How to get the previous hostname of my linux system?, answer by Alfe