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

Mỹ An

New member
How do I assign an IP address to a hostname in Linux?
Answer
Procedure
  1. Open hosts file. # vi /etc/hosts.
  2. Press i to enter the editing mode, and add the local host IP address and host name. ipAddress hostName. ipAddress: The local host IP address. hostName: Host name.
  3. Press Esc to exit the editing mode and run the :wq command to save and exit the file.
 

Tìm kiếm

Back
Top