# [Solved] I cannot change my HOSTNAME

## bluephoenix

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

----------

## bluephoenix

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.

----------

## charles17

 *bluephoenix wrote:*   

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

  http://wiki.gentoo.org/wiki/Systemd#Hostname

----------

## bluephoenix

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

Thanks everybody!

----------

## bluephoenix

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.

----------

