View previous topic :: View next topic |
Author |
Message |
murrcoss n00b
Joined: 09 Jun 2021 Posts: 4 Location: Germany
|
Posted: Wed Jun 09, 2021 6:14 am Post subject: [SOLVED] hostname is changed |
|
|
Hi everyone,
when I boot in gentoo my hostname is changed to something like: username@2001... (ipv6-adress)
i think this happens, when i login to my wired network.
when i log in to kde, i can start programms (like my browser), but after some minutes i can't start any programms.
i have to change to a terminal, type in "sudo hostname gentoo", and then log out and log in. and then everything works as it should
can someone help me with this?
Last edited by murrcoss on Sun Jun 13, 2021 5:27 pm; edited 1 time in total |
|
Back to top |
|
|
wwdev16 n00b
Joined: 29 Aug 2018 Posts: 53
|
Posted: Wed Jun 09, 2021 8:31 am Post subject: |
|
|
Is the interface address being changed too? Use the ip addr command.
If the address changes I would suspect some kind of automatic network
configuration service is running and then breaking things, perhaps a
dhcp client. |
|
Back to top |
|
|
murrcoss n00b
Joined: 09 Jun 2021 Posts: 4 Location: Germany
|
Posted: Wed Jun 09, 2021 8:38 am Post subject: |
|
|
i have a dhcp client. it is working and i get a local ipv4 and ipv6 address. but something is making the dhcp-client to set the hostname.
i am using the kde-networkmanager |
|
Back to top |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 338
|
Posted: Wed Jun 09, 2021 11:15 am Post subject: |
|
|
murrcoss,
This is how to tell NetworkManager to ignore hostname provided via DHCP (restart required):
/etc/NetworkManager/NetworkManager.conf
Code: | [main]
plugins=keyfile
[keyfile]
hostname=gentoo |
|
|
Back to top |
|
|
murrcoss n00b
Joined: 09 Jun 2021 Posts: 4 Location: Germany
|
Posted: Wed Jun 09, 2021 1:09 pm Post subject: |
|
|
spica,
sorry, this did not work, i did a restart:
I had to create that file:
Code: | murrcoss@200116b8(...) ~ $ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=keyfile
[keyfile]
hostname=gentoo |
|
|
Back to top |
|
|
Fitzcarraldo Advocate
Joined: 30 Aug 2008 Posts: 2056 Location: United Kingdom
|
Posted: Wed Jun 09, 2021 1:57 pm Post subject: |
|
|
In earlier days it was necessary to specify the hostname in /etc/NetworkManager/NetworkManager.conf but that is no longer required and has no effect. According to NetworkManager.conf(5) man page: ‘This key is deprecated and has no effect since the hostname is now stored in /etc/hostname or other system configuration files according to build options.’
If NetworkManager was merged with the dhclient USE flag set then specify the hostname in /etc/hosts, /etc/conf.d/hostname, /etc/hostname and /etc/dhcp/dhclient.conf:
Code: | # grep -v "^#\|^$" /etc/dhcp/dhclient.conf
send host-name "gentoo";
supersede host-name "gentoo"; |
The purpose of the ‘supersede‘ statement in dhclient.conf is explained in man dhclient.conf(5):
Quote: | supersede [ option declaration ] ;
If for some option the client should always use a locally-configured value or values rather than whatever is supplied by the server, these values can be defined in the supersede statement. |
How I install and configure NetworkManager in Gentoo Linux: Using NetworkManager in Gentoo Linux _________________ Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.
My blog |
|
Back to top |
|
|
murrcoss n00b
Joined: 09 Jun 2021 Posts: 4 Location: Germany
|
Posted: Sun Jun 13, 2021 5:27 pm Post subject: |
|
|
Fitzcarraldo: Thanks, that helped! |
|
Back to top |
|
|
|