Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Hostname changes to dhcppc2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
niyumard
n00b
n00b


Joined: 08 Sep 2020
Posts: 3

PostPosted: Tue Sep 08, 2020 10:59 am    Post subject: [Solved] Hostname changes to dhcppc2 Reply with quote

Hi, I've set my hostname as per handbook's guidance:
Code:

cat /etc/hostname
computerpc

but running hostname returns: dhcppc2

When I first boot my computer, my host name is shown correctly but after a while (for example by logging in or entering a wrong password), it just changes to dhcppc2
What should I do?


Last edited by niyumard on Tue Sep 08, 2020 2:56 pm; edited 2 times in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24687
Location: here

PostPosted: Tue Sep 08, 2020 11:23 am    Post subject: Reply with quote

Welcome to gentoo forum.

You are sure that /etc/hostname is correct location?
In handbook we talk about /etc/conf.d/hostaname.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
niyumard
n00b
n00b


Joined: 08 Sep 2020
Posts: 3

PostPosted: Tue Sep 08, 2020 1:33 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Welcome to gentoo forum.

You are sure that /etc/hostname is correct location?
In handbook we talk about /etc/conf.d/hostaname.


Oh right,
I'd set that place actually, and today I saw a strange line added to it:
Code:

# Set to the hostname of this machine
hostname="computerpc"
is<80>kbge<80>kb<80>kbcomputerpc^[:wq^M


I removed the other line and will update this message if this changes anything.

Update: removing the line didn't change anything, hostname still returns dhcppc2
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4142
Location: Illinois, USA

PostPosted: Tue Sep 08, 2020 2:29 pm    Post subject: Reply with quote

I'd guess that your dhcp server is setting it.
Back to top
View user's profile Send private message
niyumard
n00b
n00b


Joined: 08 Sep 2020
Posts: 3

PostPosted: Tue Sep 08, 2020 2:55 pm    Post subject: Reply with quote

Tony0945 wrote:
I'd guess that your dhcp server is setting it.


Yep, this just reminded me that I'm using connman and ArchWiki has warned about it changing the host name.
Fixed it by the way suggested in ArchWiki's article:

https://wiki.archlinux.org/index.php/ConnMan#Avoid_changing_the_hostname

Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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