How do I assign an IP address to a hostname in Linux?
Answer
Procedure
Answer
Procedure
- Open hosts file. # vi /etc/hosts.
- 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.
- Press Esc to exit the editing mode and run the :wq command to save and exit the file.