etc/hosts configuration on DigitalOcean

Discussion in 'Installation/Configuration' started by StefanoBertoli, Apr 26, 2018.

  1. Hi all, as can be seen in tutorials about hosts file:
    Code:
    Then edit /etc/hosts. Make it look like this:
    
    nano /etc/hosts
    
    127.0.0.1       localhost.localdomain   localhost
    192.168.1.100   server1.example.com     server1
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    In DigitalOcean hosts file of Debian server the file differ having 127.0.1.1 instead the real public IP
    Code:
    # Your system has configured 'manage_etc_hosts' as True.
    # As a result, if you wish for changes to this file to persist
    # then you will need to either
    # a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
    # b.) change or remove the value of 'manage_etc_hosts' in
    #     /etc/cloud/cloud.cfg or cloud-config from user-data
    #
    127.0.1.1 server1.example.com server1
    127.0.0.1 localhost
    
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    
    Can this cause some misconfiguration in ISPConfig? I think DO resolv the 127.0.1.1 like local IP (like with a venet) but I'm not sure if change the value with the real Public IP will be better.

    Thanks
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I think there is no need to edit that file. It is meant for internal LAN ip to be fixed for your server. Normally VPS already have a fixed LAN ip.
     

Share This Page