Thursday, June 8, 2017

Configure domain name in CentOS



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/sysconfig/network and /etc/hosts suffice? Would be great to have some steps or configuration guides..


Answer



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_hostname at a command prompt to make the change effective.


  • Define the hostname in /etc/sysconfig/network to make this setting persist across reboots.


  • Reboot the system or restart services that depend on hostname (cups, syslog, apache, sendmail, etc.)




No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...