Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] I cannot change my HOSTNAME
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 92

PostPosted: Thu Oct 30, 2014 8:22 am    Post subject: [Solved] I cannot change my HOSTNAME Reply with quote

I am using systemd instead of openrc.
I try to change the hostname in /etc/hostname file, but there is no effect. Even I delete /etc/hostname, there is nothing changed (the old hostname displays).
If I use "#hostname" command, the hostname will be changed, but certainly everything will be the same after booting.

So I don't know how to change it now.

Thank you for your advice!


Last edited by bluephoenix on Thu Oct 30, 2014 10:48 am; edited 1 time in total
Back to top
View user's profile Send private message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 92

PostPosted: Thu Oct 30, 2014 10:39 am    Post subject: Reply with quote

sorry, I should say the hostname configure file locates /etc/conf.d

I just made mistake in the previous post and now I still cannot solve the problem.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Thu Oct 30, 2014 10:48 am    Post subject: Reply with quote

bluephoenix wrote:
sorry, I should say the hostname configure file locates /etc/conf.d
http://wiki.gentoo.org/wiki/Systemd#Hostname
Back to top
View user's profile Send private message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 92

PostPosted: Thu Oct 30, 2014 10:51 am    Post subject: Reply with quote

I solved the issue by edit the "Default hostname" in the kernel configuration - "General setup". And then everything get fine.

Thanks everybody!
Back to top
View user's profile Send private message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 92

PostPosted: Thu Oct 30, 2014 11:08 am    Post subject: Reply with quote

And I do confirm systemd is using hostname file in /etc folder but not /etc/conf.d

Systemd's tool - hostnamectl can change the hostname permanently while it does change the content of /etc/hostname.

Just one thing I don't know if it is a bug. When I use "hostnamectl set-hostname" command and input the hostname with capital letter, and finally the command will write the file with lowercase letter and thus the hostname will be lowercase after booting for sure. And I do prefer to use capital letter to align with my other computers so I have to edit /etc/hostname by hand.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum