In this post, I have came forward with the instructions and guidance to set the permanent hostname for the CentOS box.
In this video, you find the needed configurations to setup the HOSTNAME.
The ip-address you see in the /etc/hosts file has been acquired from the concerned system, using the “ifconfig” command. The ipaddress is needed to mention the hostname in the hosts file. However you can find the ipaddress of your own computer using Ifconfig command in TUI (terminal) mode.
The setup has been chosen in the CentOS platform, as the demand is noticed in high. You can follow the same instruction for other Linux distributions, however the path, commands, Shell usage affects the process.
Here I have used “nano” as text editor to edit the configurations files, however you can use you favorite text editor; VI, CAT or other’s. After i have used the nano /etc/sysconfig/network or other files editing, i have manipulated the files and i have saved the configurations using the CTRL+X buttons click and pressing the Y button for the asked query, whether to save the changes or not by the nano editor; so i am saying yes to save the things. This will save the configured things.
you do need to exit the current working shell to notice the changes of hostname. However it is recommended to logout of the box after changes and login back again. The next post about how to set-up DNS will be published soon.
Here in the video, the hostname has been mentioned as linuxbox1, and the fqdn has been assigned as the linuxbox.centos1; however it is recommended to use the linux box as the hostname or to change the fqdn to be as linuxbox1; both are acceptable. (edited-16-06-10)
If you have any queries, comment here or else you can reach me @ twitter.com/chaladhi or facebook.com/chaladi
Thanks for the great video.
What if I want to name a server that is supposed to have a fqdn in the web?
suppose that the registered domain is mydomain.com
should I replace linuxbox with mydomain and centos1 with com in your example?
Thanks
LikeLike
Appreciated.
Yes, If your website name is; for instance, mydomain.com, then it is the web-server’s name obviously and it should be mentioned in hosts file. Because it should be able to communicate with the canonical name over internet. So, in hosts file, you add; below the IPV6 line, IP address of your WEB-SERVER (WEB SITE HOSTING COMPUTER), FQDN NAME and ALIAS NAME of the COMPUTER. ALIAS is the alternative name you call your PC to respond for, or with as well.
Like the process explained to set a permanent hostname for the linux box, the FQDN should be mentioned in the hosts file accordingly. More technically going, your computer; webserver; where the website is being hosted, should be able to communicate with the widespread heterogeneous communication devices, for e.g PC, MAC, PDA etc., with the same name, so the exact website name is needed, to be mentioned in the HOSTS FILE.
Thank you
regards,
admin
chaladi.wordpress.com
P.S If you have any queries or want any relevant information on Linux platform’s or any computer networking related, you definitely could ask me without any hesitations.
P.P.S If you need any video tutorials on HOW-TO, you definitely can request me.
LikeLike