19

I know hot to block single tumblr blog with

127.0.1.1 something.tumblr.com

but I want to block entire tumblr. I tried 127.0.1.1 tumblr.com but it's not working.

Is there a way to do this?

Alvar
  • 17,058
user1079002
  • 447
  • 1
  • 5
  • 13

3 Answers3

27

From Ubuntu 14.04 LTS (Trusty Tahr) and above, which already have NetworkManager and use dnsmasq by default you don't need to install it.

Just create a file /etc/NetworkManager/dnsmasq.d/local:

address=/tumblr.com/127.0.0.1

and reboot or restart NetworkManager

$ sudo service network-manager restart

This will block tumblr.com and all of its subdomains by redirecting it to localhost (127.0.0.1).

Note this won't do anything unless you also set up your connection to use localhost/dnsmasq for name resolution.


On older than Trusty versions install dnsmasq:

$ sudo apt-get install dnsmasq

Then in /etc/dnsmasq.conf (which you may have to create) add the line:

address=/tumblr.com/127.0.0.1
Pablo Bianchi
  • 15,657
Kerrick
  • 1,851
  • Smart and simple way. – Luis Alvarado Jun 13 '12 at 04:29
  • 3
    Note this won't do anything unless you also set up your connection to use localhost/dnsmasq for name resolution. – ish Jun 13 '12 at 05:45
  • 1
    and how do you setup connection to use dnsmasq? do you have any link? – user1079002 Jun 14 '12 at 22:22
  • 2
    @user1079002 Connection setup can be found in this link https://help.ubuntu.com/community/Dnsmasq – RAM Aug 03 '13 at 06:42
  • 1
    @RAM can you elaborate a little bit? That link says to install dnsmasq and then edit a certain file. What sort of edits should I do in that file? It's almost 700 lines long and it's not obvious to me if any particular line means "Turn dnsmasq on" – Tyler Jan 16 '22 at 19:28
  • @Tyler answer has been edited to answer your query about editing the file, it will be visible to you all once the community approves the edited answer – RAM Feb 21 '23 at 07:52
5

The /etc/hosts file does NOT support wildcard subdomains. i.e. you can't say 127.0.0.1 *.tumblr.com and have it block all URLs of the form something.tumblr.com.

If you want to block these at the browser level, you can either use a plugin or better, a filtering proxy like Privoxy.

If you want to block these at the network level, so that no one on that computer can access the sites, you need a simple firewall rule to block something.tumblr.com's IP range, which at first glance appears to be 50.97.143.0/24, i.e. 50.97.143.0-50.97.143.255.

ish
  • 139,926
-3

Looking at and taking the IP address you entered as literal, you are typing it wrong. Instead of 127.0.1.1 it should be 127.0.0.1

Shogun
  • 233
  • 1
  • 2
  • 9