Scenario / Questions
How do I configure domain names in Cent OS?
I am actually connecting to the servers via SSH remote terminal and I also have root credentials. Does configuring the
/etc/hosts suffice? Would be great to have some steps or configuration guides..
Find below all possible solutions or suggestions for the above questions..
Four things to do:
Add the hostname entry to
/etc/hosts. Use the format detailed here.
If your hostname is “your_hostname”, type
hostname your_hostnameat a command prompt to make the change effective.
Define the hostname in
/etc/sysconfig/networkto make this setting persist across reboots.
Reboot the system or restart services that depend on hostname (cups, syslog, apache, sendmail, etc.)
If by domain name you mean domain suffix, then
/etc/resolv.conf is where the domain goes. Just add a line
Then to set your server’s hostname, there’s only one good place for it, and it’s
/etc/sysconfig/network. Add a line
HOSTNAME=yourhostname, and don’t put the domain suffix in the hostname, as it will take it from
You do not need to add anything (and shouldn’t) in
/etc/hosts to define your hostname. This is the wrong way to do it.
To test your setup, use the
hostname -sto get the short name (should reflect what you have in
hostname -dcommand to test your domain (should reflect what you have in
To test it all together, you can use
hostname -Afor the very long version.
The way to do it now is
Kubernetes Free Online Tutorial, Kubernetes Beginner Tutorial
DevOps Free Online Tutorial, DevOps Beginner Tutorial
Ansible Free Online Tutorial, Ansible Beginner Tutorial
Docker Free Online Tutorial, Docker Beginner Tutorial
Openstack Free Online Tutorial, Openstack Beginner Tutorial
Disclaimer: This has been sourced from a third party syndicated feed through internet. We are not responsibility or liability for its dependability, trustworthiness, reliability and data of the text. We reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever.
Source: Configure domain name in CentOS