The officially official Devuan Forum!

You are not logged in.

#1 2019-11-16 15:42:53

Job
Member
Registered: 2019-03-13
Posts: 19  

[Solved] hostname issue

I haven't restarted this machine for a while now.  I restarted it this time but the terminal has a different name than the one in /etc/hostname.  The terminal has "new-host-5".

$ hostname

also returned "new-host-5". 

No clue what might have caused the change but is there a way to display the correct name?

I am on Beowulf.

Thank you,

Last edited by Job (2019-11-16 22:45:48)

Offline

#2 2019-11-16 16:53:42

Geoff 42
Member
Registered: 2016-12-15
Posts: 283  

Re: [Solved] hostname issue

Are you running dhcp? Could this have handed out a new host name?

What is in /etc/network/interfaces ?

Geoff

Offline

#3 2019-11-16 22:31:29

Job
Member
Registered: 2019-03-13
Posts: 19  

Re: [Solved] hostname issue

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

Thanks for the help

Offline

#4 2019-11-16 22:42:22

Job
Member
Registered: 2019-03-13
Posts: 19  

Re: [Solved] hostname issue

Well I did an update and restarted the box.  The correct hostname is back.  Too bad I will never know what caused that.

Offline

#5 2019-11-16 22:59:29

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 340  
Website

Re: [Solved] hostname issue

It's likely to be caused by your DHCP server, as Geoff notes.

You might be able to prevent it by adding this to /etc/rc.local:

hostnamectl --transient set-hostname "$hostname"

Replace $hostname with the desired hostname.

But I don't know if hostnamectl(1) will work in (or is included with) Devuan. If it doesn't work then you can configure dhclient to not ask for a hostname:

https://askubuntu.com/questions/875276/ … ame-change


Fabricando fit faber

Offline

Board footer