sudhirgoogle
asked on
how to set domain name in RHEL 5.3
I would like to know the proper way to set the domain name in RHEL 5.3.
I have set DOMAINNAME=example.com in /etc/sysconfig/network file, and when i use domainname command is shows none.
Please help
I have set DOMAINNAME=example.com in /etc/sysconfig/network file, and when i use domainname command is shows none.
Please help
ASKER
Actually restarted the machine, but it didn't work. also restarted xinetd, no luck
Sorry I havent looked the question properly. Write as given below in your /etc/sysconfig/network file.
HOSTNAME=example.com
Then restart the xinetd service.
It will change your system's hostname.
HOSTNAME=example.com
Then restart the xinetd service.
It will change your system's hostname.
ASKER
HOSTNAME parameter is to set the hostname not the domain name.
my hostname is station1 and i want my domain name as example.com.
In network file i have set HOSTNAME=station1 and DOMAINNAME=example.com.
when i use domainname command it shows the output as none. when is use the domainname command it should give the output as example.com
'domainname' command is used to set the NIS domain, not the DNS domain. Do you have NIS configured under RedHat?
You want to set the DNS Domain name or NIS Domain ?
ASKER
No NIS. I just want to set domain name, how do i set in RHEL 5.3
ASKER
DNS Domain name.
It would be very helpful for you.
http://www.cyberciti.biz/faq/linux-setting-hostname-and-domain-name-of-my-server/
http://www.cyberciti.biz/faq/linux-setting-hostname-and-domain-name-of-my-server/
ASKER
i already gone through that URL, but it didn't help.
In your /etc/sysconfig/network file write
HOSTNAME=station1.example. com
Then restart the xinetd service.
Here station1 is your hostname and example.com is your DNS domain name. Make the DNS entry for the same as well.
HOSTNAME=station1.example.
Then restart the xinetd service.
Here station1 is your hostname and example.com is your DNS domain name. Make the DNS entry for the same as well.
ASKER
i followed your instruction except Making the DNS entry on the BIND.
when i type domainname command it returns none.
I would kindly request you to test your solution from ur end and then suggest me.
when i type domainname command it returns none.
I would kindly request you to test your solution from ur end and then suggest me.
Try to edit /etc/hosts & /etc/resolv.conf file and then restart the system. This may help u in solving the problem.
ASKER
what you want me to edit in those files ?? be specific
domainname report your NIS domain name only, To check your dns domain name type:
# dnsdomainname
in /ect/hosts make entry as given below.
<Ip Address> station1.example.com station1
In /ect/resolv.conf
Enter your DNS server's IP Address.
# dnsdomainname
in /ect/hosts make entry as given below.
<Ip Address> station1.example.com station1
In /ect/resolv.conf
Enter your DNS server's IP Address.
It is NISDOMAIN=name in /etc/sysconfig/network file
You would need to reboot the machine
You would need to reboot the machine
This link explains it
http://bradthemad.org/tech/notes/redhat_nis_setup.php
http://bradthemad.org/tech/notes/redhat_nis_setup.php
Hi
This is one way found, echo the domainname on startup onto proc
echo domainname.com > /proc/sys/kernel/domainnam e
this should work for you???
MS
This is one way found, echo the domainname on startup onto proc
echo domainname.com > /proc/sys/kernel/domainnam
this should work for you???
MS
ASKER
Hello mohansahu:
echo domainname.com > /proc/sys/kernel/domainnam e works for me. but how do i make persistent across reboot.
echo domainname.com > /proc/sys/kernel/domainnam
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your response.
the command sysctl -w kernel.domainname=example. org is not updating /etc/sysctl.conf file, in this case how will it be persistent after reboot. should i manually add entry in sysctl.conf file ??
the command sysctl -w kernel.domainname=example.
sysctl -w kernel.domainname=example. org is to write the kernel
-w for is write ...or try to add it manually & check .
-w for is write ...or try to add it manually & check .
ASKER
Thanks for your solution. you are genius.
ex: type service xinetd restart
It will get reflect.