In Ubuntu my /etc/hosts file is empty. It happened suddenly, i did not modify it and don't think any other program also modified it. How can this happen ?
Now moreover I am not able to edit the /etc/hosts file from vi. I tried changing permission using
sudo but that did not work as sudo was giving me 'unable to resolve host ghost' error. ghost is my host name. One more thing I have noticed while installing Ubuntu I set computer name as 'GHOST' which was taken as the hostname. Now if I change it to anything like 'ABC' the hostname it takes is 'abc' (all in lowercase) also if the device name is like abc.xyz.com then the hostname it takes is abc-xyz-com, replaces all . with - . Why this is happening.
Moreover how should I recover my /etc/hosts file as I am not able to edit the file at all.