Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Fqdn
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ROGA
Apprentice
Apprentice


Joined: 17 Feb 2018
Posts: 156
Location: Zurich, Switzerland

PostPosted: Mon Oct 03, 2022 10:51 am    Post subject: [SOLVED] Fqdn Reply with quote

Hi,

I'm having problems to set the fqdn to my linux host. I'm a little bit confused, because earlier this was no problem for me. I recently build my new gentoo linux and when I was finished, I noticed that my box did not have a fqdn. Only hostname is working. I tried to set fqdn on traditionelly way in /etc/hosts

Code:

127.0.0.1 myhost.mydomain.local  myhost  localhost


and also set the hostname with

Code:

hostnamectl set-hostname myhost


but on the console login the greeting-message says: This is myhost.unknown_domain (Linux x86_64 5.15.69-gentoo) 12:34:45

A query with hostname gave following
Code:

gentoo ~# hostname -s
gentoo ~# myhost
gentoo ~#
gentoo ~# hostname -f
gentoo ~# myhost
gentoo ~#
gentoo ~# hostname -d
gentoo ~#



Can anybody tell me, how I have to correctly set the fqdn for my gentoo-box?

thank you for advising
_________________
regards,

Roland


Last edited by ROGA on Tue Oct 04, 2022 4:47 am; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3875

PostPosted: Mon Oct 03, 2022 5:08 pm    Post subject: Reply with quote

Plz set it thus
Code:

hostnamectl set-hostname myhostname.mydomain.dom

_________________
:)
Back to top
View user's profile Send private message
ROGA
Apprentice
Apprentice


Joined: 17 Feb 2018
Posts: 156
Location: Zurich, Switzerland

PostPosted: Tue Oct 04, 2022 3:47 am    Post subject: Reply with quote

@alamahant:

Great! It seems to work!

Now hostname returns all value correct

fqdn
Code:
linux ~# hostname -f 
linux ~# myhost.mydomain.local

and shortname
Code:
linux ~# hostname -s
linux ~# myhost


and domainname

Code:
linux ~# hostname -d
linux ~# mydomain.local



but one thing is a bit weird. On the local console the greeting-message now says: This is myhost.mydomain.local.mydomain.local (Linux x86_64 5.15.89-gentoo) 06:43:23

I fixed it while I changed the following in /etc/issue

Code:

This is \n.\O (\s \m \r) \t

to
Code:

This is \n (\s \m \r) \t


and all seems to be fine :-)

Thank you for this great and usefull hint. (I mark this thread as solved)
_________________
regards,

Roland
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Oct 04, 2022 9:41 am    Post subject: Reply with quote

Systemd hostnamectl: Short name or FQDN? That's the question!

See: https://serverfault.com/questions/331936/setting-the-hostname-fqdn-or-short-name
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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