1

I made a mistake and accidentally deleted hosts file from my system and cannot figure out how to get back my hosts (/etc/) file, when i do

sudo service apache2 restart

it's showing sudo: unable to resolve host SystemName.

I am using ubunt 14.04 Lts Please help me out, i am just beginner.

I tried by sudo vi hosts and put

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

but no avail

3

This is the contents of my /etc/hosts. Obviously, change the second line to reflect your hostname.

127.0.0.1   localhost
127.0.1.1   sparhawk-XPS-17

# 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
  • @Atiq No worries. If this solved your problem, please click the tick button on the left. Cheers. – Sparhawk Dec 13 '14 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.