Skip to content

Instantly share code, notes, and snippets.

@ghoneycutt
Created May 2, 2018 21:13
Show Gist options
  • Save ghoneycutt/e531984406b4b86ace687ea8958a6dc3 to your computer and use it in GitHub Desktop.
Save ghoneycutt/e531984406b4b86ace687ea8958a6dc3 to your computer and use it in GitHub Desktop.
default /etc/hosts

macos

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost 

el6

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

el7

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

ubuntu1604

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
127.0.1.1	ubuntu-xenial	ubuntu-xenial

ubuntu1404

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

amazon201703

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost6 localhost6.localdomain6

debian7

127.0.0.1	localhost
127.0.1.1	wheezy.raw	wheezy

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

debian8

127.0.0.1	localhost
127.0.1.1	jessie.vagrantup.com	jessie

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

debian9

127.0.0.1	localhost
127.0.1.1	stretch.localdomain	stretch

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
@Erfan-ram
Copy link

Erfan-ram commented Apr 6, 2023

Ubuntu 22.04

127.0.0.1	localhost
127.0.1.1	junior #my hostname


::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment