Ubuntu Hostname vanaf de prompt aanpassen

Ubuntu: Changing Hostname from Command Line

As described at it’s straight forward:

1 sudo /bin/hostname mynewhostname

Supplying the path to the binary is for security reasons, I guess, to make sure we have the right bin (eventhough it could have been replaced there, too…).

But the people at debianadmin.com forgot to mention in order to avoid “hostname: Unknown Host” you have to

1 sudo edit /etc/hosts

and change it there, too!

  1. Marcin Szamotulski said,

    I had to change my host name, and I followed these instructions. Everything works ok (sysctl kernel.hostname give the new hostname) but the cron which is trying to send emails to the old hostname and I get a lot of email notifications. How do cron access for hostname (I do not see this in man pages)?
    I’ve checked for any env. variables and there is nothing what contains my old hostname. I also made grep -r oldhostname in \etc directory (a desperaccy act) and I do not find my old hostname.

    Thanks for any help.

Geplaatst in Linux, Server beheer, Ubuntu
%d bloggers liken dit: