How to you edit the /etc/hosts file? My father put every video site on the internet on and he won't tell me how to get rid of it. I need an answer because tinypic and youtube are on it!


You need open the file as root:

Open the terminal CTRL + ALT + T.

sudo nano /etc/hosts (You need enter your user password)

after, it will open the file to edit, use CTRL + X to close and save the file.

Good luck!


Open the terminal by pressing CTRL + ALT + T.

Get the info you need your going to want to copy the commands output.

neil@ASUS:~$ sudo cat /etc/hosts | grep

Copy the outputted code.   localhost   ASUS

Then type in terminal

sudo rm /etc/hosts

then type in

sudo nano /etc/hosts

Press CTRL + shift + V

Then your hosts file shoud look like this.       localhost       ASUS

and then press Ctrl + X to save

That should restore what your father did. unless he deleted from the host file.

  • 1
    Yes, that makes sense. Copying things from a file and then inserting it in the same file is really useful...
    – wie5Ooma
    Oct 29 '15 at 2:18
  • @wie5Ooma I edited my post. just released my mistake.
    – Neil
    Oct 29 '15 at 5:03

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