How do you assign an IP address to a hostname in Linux?

Huỳnh Hiền

New member
How do you assign an IP address to a hostname in Linux?
Answer
How to Change HostName and IP-Address in CentOS / RedHat Linux
  1. Use hostname command to Change Hostname. In this example, we’ll change the hostname from dev-server to prod-server. …
  2. Modify the /etc/hosts file. …
  3. Modify the /etc/sysconfig/network file. …
  4. Restart the Network. …
  5. Change ip-address Temporarily Using ifconfig. …
  6. Change ip-address Permanently. …
  7. Modify /etc/hosts file. …
  8. Restart the Network.
14 окт. 2013 г.
 

Tìm kiếm

Back
Top