How to set domainname in RHEL7.3 machine
5,299
Are you sure you want the domainname
and not hostname
or hostname -d
? The domainname
is used on hosts with NIS(YP).
If you want to set just the hostname in FQDN form, use following command:
hostnamectl set-hostname hostname.example.com
And yes, don't forget to put it into /etc/hosts.
Related videos on Youtube
Author by
Subodh Joshi
A Developer from India . I convert caffeine into code. Trying to Select * from life; if (FAIL) { keepTrying(); } else{ keepTrying(); }
Updated on September 18, 2022Comments
-
Subodh Joshi over 1 year
I have to setup domainname right now when i am typing below command i am getting nonne
[root@username ~]# domainname (none)
But hostname command giving proper result
[root@username ~]# hostname username
I try to add below in
vim /etc/hosts
<Server IP> example.com
but even this change wont help me.
I am trying to resolve this issue
https://stackoverflow.com/questions/47454271/olcrootpw-can-only-be-set-when-rootdn-is-under-suffix
-
Subodh Joshi over 6 yearsThanks for your reply but hostname command already giving the result .
-
Jaroslav Kucera over 6 yearsAnd are you using NIS?
-
Subodh Joshi over 6 yearsSorry but i am newbie in this what is NIS?
-
Jaroslav Kucera over 6 yearsThat's the why I'm asking.
domainname
returns the NIS domain. The NIS is described here: en.wikipedia.org/wiki/Network_Information_Service -
Subodh Joshi over 6 yearsFYI..this is a virual machine inside a organization but i raised this issue due to i am getting issue in the Ldap Configuration .