You are not logged in.

#1 2015-05-20 12:46:34

xamgore
Member
Registered: 2015-05-13
Posts: 3

NetworkManager changes the hostname

Hi guys! I'm new to Arch and the Linux world, so it's quite difficult to me to solve problems. And I need your help (:

The problem is that after connecting to some network (via wifi), either NetworkManager or something else (DHCP) changes my hostname. By default it is "localhost", and turns into "goga" (don't know why :D).

This affects Xorg, i.e.

~> xhost
No protocol specified
xhost:  unable to open display ":0"

So I'm not able to launch GUI application (KDE5+plasma). This make me sad :(


I partially solve it by hostnamectl set-hostname localhost. As you can understand it's pretty annoying to enter this line every time I connect to any network.

-----

I've already tried to add [keyfile]hostname=localhost, as described at this guide, it does not help.

Last edited by xamgore (2015-05-20 12:49:28)

Offline

#2 2015-05-20 13:01:18

Arogers10
Member
Registered: 2012-06-20
Posts: 68

Re: NetworkManager changes the hostname

Do you have your hostname written in the file /etc/hostname?

And it might just be an issue using localhost as your hostname as localhost has a special meaning/redirect to 127.0.0.1

Last edited by Arogers10 (2015-05-20 13:04:12)

Offline

#3 2015-05-21 17:24:25

xamgore
Member
Registered: 2015-05-13
Posts: 3

Re: NetworkManager changes the hostname

Arogers10 wrote:

Do you have your hostname written in the file /etc/hostname?

Yes, it is also localhost :D

Offline

#4 2015-05-21 18:18:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,293
Website

Re: NetworkManager changes the hostname

xamgore wrote:

I partially solve it by hostnamectl set-hostname localhost.

man hostnamectl wrote:

If a static hostname is set, and is valid (something other than localhost), then the transient hostname is not used.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-05-24 22:03:14

xamgore
Member
Registered: 2015-05-13
Posts: 3

Re: NetworkManager changes the hostname

Hm. Thank you, Jason, I have switched it to goga and now everything is fine!

Offline

Board footer

Powered by FluxBB