Question

How do I fix or reset the hosts file? I am unable to connect to git or another machine

I tried to add a another machine mapping to an alias in the hosts file. After which I am unable to connect to anything. How do I fix this?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @dineshgpillai

Try replacing your hosts file with this, and changing the hostname and FQDN:

127.0.1.1 hostname hostname.yourdomain.com
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