Search code examples
linuxhostnamehosts

How to add new local host?


How can i set new local host with new hostname?

[main@evghost ~]$ host evghost
Host evghost not found: 3(NXDOMAIN)

[main@evghost ~]$ host localhost
localhost has address 127.0.0.1

[main@evghost ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost

# End of file

i just want to have new localhost with name evghost


Solution

  • maybe:

    127.0.0.1 evghost evghost
    

    You should specify your question a little more precise.

    Then you try

    localhost evghost evghost //
    localhost evghost.localdomain evghost //
    localhost evghost //
    127.0.0.1 evghost