View previous topic :: View next topic |
Author |
Message |
akrmn24 n00b
Joined: 24 Nov 2024 Posts: 13
|
Posted: Mon Jan 13, 2025 6:02 pm Post subject: Proper way to set hostname |
|
|
In the installation manual it says to set the hostname in /etc/hostname. But this has no effect for me. In my terminal it shows just user@#, and hostname command returns a blank entry, and various programs that depend on the hostname give warnings. It only gets set when I use the hostname command (hostname <name>). Then I logout and log back in and I see the user@hostname in the terminal.
I'm trying this on a MUSL / arm64 / openrc system btw. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9860 Location: almost Mile High in the USA
|
Posted: Mon Jan 13, 2025 7:17 pm Post subject: |
|
|
After changing /etc/hostname you'll need to make openrc reread it.
/etc/init.d/hostname restart (or a reboot) should do it?
As an aside, does changing /etc/conf.d/hostname even work? The code looks wrong... or is it... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
freke Veteran
Joined: 23 Jan 2003 Posts: 1044 Location: Somewhere in Denmark
|
Posted: Mon Jan 13, 2025 7:37 pm Post subject: |
|
|
eccerr0r wrote: | After changing /etc/hostname you'll need to make openrc reread it.
/etc/init.d/hostname restart (or a reboot) should do it?
As an aside, does changing /etc/conf.d/hostname even work? The code looks wrong... or is it... |
I'm setting hostname with/in /etc/conf.d/hostname since forever - works perfectly fine. Code: | ns ~ # cat /etc/conf.d/hostname
# Hostname fallback if /etc/hostname does not exist
hostname="ns.vlh.dk"
ns ~ # hostname
ns.vlh.dk |
|
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 700
|
Posted: Mon Jan 13, 2025 8:25 pm Post subject: |
|
|
freke wrote: | hostname="ns.vlh.dk"
ns ~ # hostname
ns.vlh.dk[/code] | My mail server does odd things if I set the hostname to an FQDN and not just the host, like sending mail from root@hostname.mydomain.com.mydomain.com.
The only time the FQDN is set outside the context of "connect to/use this <IP|FQDN>" optional software config files is in /etc/hosts, re: Code: | 127.0.0.1 <FQDN> <hostname> localhost |
|
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9860 Location: almost Mile High in the USA
|
Posted: Mon Jan 13, 2025 9:59 pm Post subject: |
|
|
hostname should be just the name of the host, not fqdn.
domain name is separate.
I was staring at the init script for hostname and it just looks wrong for some reason. maybe there's some other script that handles /etc/conf.d/hostname. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
|