How do you block gmail through etc/hosts?
-
Most "distracting" sites I can block by an entry in my etc/hosts file (Mac OSX 10.8.2). e.g.:127.0.0.1 plus.google.comBut this method doesn't seem to be able to block gmail. Here's the relevent lines in my etc/hosts file: 127.0.0.1 localhost 255.255.255.255 broadcastlocalhost ::1 localhost fe80::1%lo0 localhost 127.0.0.1 https://gmail.com 127.0.0.1 gmail.com 127.0.0.1 www.gmail.com 127.0.0.1 https://mail.google.com 127.0.0.1 mail.google.com 127.0.0.1 https://accounts.google.com 127.0.0.1 accounts.google.com But none of these seem to block gmail. Does anyone have any suggestions? I could try a "site blocker" but most of these rely on setting a "blocking time" e.g. 30 minutes -- this is not practical for gmail as I want to be able to log into it when I need to confirm my email address if I sign up to a site. I would prefer to be able to block gmail with the knowledge that I could unblock it in about 30s -- I find this "overhead" gives the best of both worlds. I could also take Ritalin, and/or practice my self-control. That's also another option :). NB: moments before I was about click "post" I was able to solve this. I'll post the solution then close the question in the hope it helps someone else.
-
Answer:
127.0.0.1 https://gmail.com 127.0.0.1 https://mail.google.com 127.0.0.1 https://accounts.google.com I don't think URLs are valid entries in /etc/hosts. If I recall, it's just for mapping hostnames to IP addresses.
tomargue at Ask.Metafilter.Com Visit the source
Other answers
Okay, well, this is embarrassing. Initially I thought it was due a bug in Mountain Lions treatment of the loopback address: http://superuser.com/questions/544789/why-cant-i-block-facebook-using-etc-hosts-on-mountain-lion In that you needed something like this: fe80::1%lo0 gmail.com But what solved it was restarting the computer.
tomargue
Yeah - /etc/hosts is only IPs and hostnames. The URL entries are not going to do a whole lot and you can safely delete them.
jquinby
You can flush the DNS cache and avoid the rebooting.dscacheutil -flushcacheThere's a layer between the hosts file or DNS server queries and applications where successful lookups are cached for a while to improve performance. They may also be cached in the application itself requiring an application restart to pick up changes. If you want some finer grained control check if the `dnsmasq` application is available on Mac OS. It is a local DNS server thing... you configure your system to use dnsmasq as its DNS server, then configure dnsmasq to use your real DNS server. Then you can configure dnsmasq to return 127.0.0.1 for wildcards like '*.google.com' and do real lookups for specific 'app.google.com'. A bit more power, but a bit more headache than editing the hosts file.
zengargoyle
I use LeechBlock on Firefox, it does not require that you set a time for sites, you can have it turned on and block sites always, and turning it off when needed is pretty quick for me.
effigy
Related Q & A:
- How do I forward gmail raw email to a web service?Best solution by email.about.com
- How do I block specific web sites?Best solution by Yahoo! Answers
- How can I download gmail for my mobile?Best solution by Yahoo! Answers
- How to get my Gmail contacts to my Yahoo account?Best solution by support.google.com
- How can I get Gmail Alpha and what is it?Best solution by Super User
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.