just saw sparkmoods answer to this question: How to block any site? but he didn't provide enough information for me to act on his answer. I'm not sure where /etc/hosts is.
Asked
Active
Viewed 63 times
2 Answers
1
You can easily edit /etc/hosts by typing sudo gedit /etc/hosts
in the terminal.
What you are doing here is exactly what people commented on your question: there is a etc folder at the root of your filesystem and there is a hosts files inside the etc folder. There is no extension to this file, it is a plain text file called hosts.
You edit it and the system knows where to go when looking for a given nameserver. So if you wanna block google you add
127.0.0.1 google.com
On your hosts file.
On a sidenote, 127.0.0.1 is an special address every IPv4 computer uses to refer to itself, which explains "localhost". Anything you point to it points to itself, therefore blocking the content.
EDIT: I'll post that to your original question.
/etc/hosts
is a file under the directory namedetc
, under/
(the root of your filesystem). There is plenty of information. If you don't really understand UNIX paths, you may want to do some research on the filesystem. – TheWanderer Mar 18 '16 at 17:31(gedit:5719): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
(gedit:5719): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files mikethe1wheelnut@mikethe1wheelnut-OptiPlex-9010:~$
– juggler Mar 18 '16 at 18:27