[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Got a machine name problem



With systemd-based Debian, the probably now best way to set a hostname is with:

hostnamectl set-hostname NAME

What Tom suggested is completely valid, but hostnamectl should I understand be the preferred route as I believe it will update everything necessary automatically.Doing it this way will also be a persistent change.

James
-- 
  James B
  portoteacher80@fastmail.com

Em Ter, 23 Fev ʼ21, às 19:29, Tom Browder escreveu:
> On Tue, Feb 23, 2021 at 11:59 AM Gene Heskett <gheskett@shentel.net> wrote:
> ...
> > Nothing I do survives a reboot, so what do I do to actually rename the
> > machine and make it stick? Hopefully without losiing the networking
> 
> Hey, Gene.  I usually have to fiddle around a little, but I've always
> had success on Debian this way (as root):
> 
>     # hostname TLM
> 
>    edit /etc/hostname and set the desired name to TLM if it's not
> already changed
> 
> I also edit /etc/hosts and make the first couple of lines look like this:
> 
>     127.0.0.1 localhost.localdomain.com   localhost
>     127.0.1.1 TLM.geneslinuxbox.net        TLM
> 
> Then reboot and cross your fingers.
> 
> Blessings,
> 
> -Tom
> 
> P.S. Keep your powder dry!
> 
>


Reply to: