| Linode Forum https://forum.linode.com/ |
|
| [SOLVED] Cannot set transient hostname on Arch Linux Linode https://forum.linode.com/viewtopic.php?f=19&t=11059 |
Page 1 of 1 |
| Author: | joe_temp [ Mon May 19, 2014 1:16 pm ] |
| Post subject: | [SOLVED] Cannot set transient hostname on Arch Linux Linode |
Hey all, I'm an Arch Linux user and I'm trying to set up my VPS. The only problem I'm having is that I'm unable to set my transient hostname. Arch Linux uses hostnamectl to set the hostname. This sets the static hostname, the transient hostname, and the pretty hostname. However, as soon as I reboot, the transient hostname reverts to the default hostname, which looks like 'li708-220'. Has anyone else had this issue?? What should I do? |
|
| Author: | akerl [ Mon May 19, 2014 1:23 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
Why are you trying to set 3 different hostnames? - Les |
|
| Author: | joe_temp [ Mon May 19, 2014 1:29 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
That's just how Arch Linux rolls. And it's not me... it's by default. Hostnamectl is a function of systemd. |
|
| Author: | sweh [ Mon May 19, 2014 1:54 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
You're likely using DHCP to get an IP address and so DHCP is setting the host name. Either convert to static IP or tell DHCP to not set the hostname. How you do this with Arch Linux... I dunno! |
|
| Author: | akerl [ Mon May 19, 2014 2:14 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
joe_temp wrote: That's just how Arch Linux rolls. And it's not me... it's by default. Hostnamectl is a function of systemd. As somebody who uses Arch, "no it doesn't". You set one hostname, using hostnamectl: https://wiki.archlinux.org/index.php/Ne ... e_hostname - Les |
|
| Author: | joe_temp [ Mon May 19, 2014 2:46 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
@akerl Sorry to tell you Les, you are wrong. Read the hostnamectl man page: http://www.dsm.fordham.edu/cgi-bin/man- ... &sect=1 hostnamectl without question sets 3 distinct hostnames. That is, unless you haven't used spaces or special characters... then it only sets two, static and transient. The man page even talks about the fact that DHCP configurations can change the transient hostname. My question is how to stop that from happening, without using a static IP. I know for a fact there is a way to tell DHCP what the hostname should be, each time the machine is booted. I wish anyone had a meaningful answer. |
|
| Author: | manrajsingh [ Mon May 19, 2014 9:22 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
@joe_temp do the following as root. # hostnamectl set-hostname yourhostname and then # cp /usr/lib/systemd/network/10-dhcp.network /etc/systemd/network/ use your favorite editor to modify (I am using vim ) # vim /etc/systemd/network/10-dhcp.network Make sure the file looks like the following ... You should only have to add the last 2 lines. Code: [Match] Save the file .. reboot After reboot .. your hostname should be the one you set initially with hostnamectl command. |
|
| Author: | joe_temp [ Mon May 19, 2014 11:31 pm ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
Hey @manrajsingh... there are no words for how grateful I am. Thank you so much for helping me out with this. I KNEW there was some kind of DHCP controlling config somewhere that I needed to edit in some way. Thank you for helping me find that. Much, much appreciated. |
|
| Author: | joe_temp [ Tue May 20, 2014 11:32 am ] |
| Post subject: | Re: Cannot set transient hostname on Arch Linux Linode |
Does anyone know how this works? I wasn't aware that I had an interface of 'eth0'... so how does this work? By the way, it totally works, I'm just wondering how? |
|
| Author: | manrajsingh [ Wed May 21, 2014 1:39 pm ] |
| Post subject: | Re: [SOLVED] Cannot set transient hostname on Arch Linux Lin |
@joe_temp You can run Ip utility to see what kind of network interfaces you already have. Code: # ip address It should return something like the following. Notice the eth0 .. I changed my ip address to xx.xxx.xx.xxx .. but you should see your ip address there. Code: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default According to Network configuration - ArchWiki , with Systemd-networkd (systemd) version >= 209 it is possible to manage network connections with systemd-networkd. You can run the following to see if systemd-network is up and running in your system. Code: # systemctl status systemd-networkd If the above command returns something like the following Code: ● systemd-networkd.service - Network Service This means that your networking is handled by systemd-networkd service. Now systemd-networkd - ArchWiki states that configuration files will be read from /usr/lib/systemd/network In my previous post, I directed that you should copy the 10-dhcp.network from /usr/lib/systemd/network to /etc/systemd/network to override the settings. Why move it to /etc/systemd/network ? Becuase files in here will not change in case of an update while /usr/lib/systemd/network could change and revert to default whenever there may be an update to systemd-networkd Moving on .. the file contents of /usr/lib/systemd/network/10-dhcp.network are as the following Code: [Match] According to this, file your IP is assigned to you by the DHCP server and according to systemd-networkd - ArchWiki ====== systemd-networkd - ArchWiki as of 05/20/2014 ======= Quote: By default hostname received from the DHCP server will be used as the transient hostname. To change it add UseHostname=false in section [DHCPv4] Code: /etc/systemd/network/MyDhcp.network ====== end systemd-networkd - ArchWiki ============== So when you set UseHostname=false system doesnt use hostname provided by DHCP server but instead uses the one you set this hostnamectl command. Below is what your /etc/systemd/network/10-dhcp.network file should look like in order for you to use your own hostname rather than what DHCP server provides. Code: [Match] I hope this helped. |
|
| Author: | vonskippy [ Wed May 21, 2014 2:42 pm ] |
| Post subject: | Re: [SOLVED] Cannot set transient hostname on Arch Linux Lin |
manrajsingh wrote: I hope this helped. It helped me hate the SYSTEMD morons even more for inflicting this nonsense on everyone - thanks. |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|