3

I was searching for porn blockers and such things. I found something called OpenDNS. I don't know how it really works, but it's something like stopping some IPs or something like that.

It seems like it could be configured either for all computers using a router or for just one laptop. Is this true? If so, how do I configure it on just one laptop without affecting others using the same router?

Also, how do I configure it to block only porn and not violence or other topics?

muru
  • 207,228
melbx
  • 133

1 Answers1

3

What you're looking for

What you're asking about is OpenDNS Family Shield. In simple terms, it's two DNS servers which you can use instead of what your router gives, specifically the addresses are

208.67.222.123
208.67.220.123

According to their page it is supposed to:

. . .block pornographic content, including our “Pornography,” “Tasteless,” and “Sexuality” categories, in addition to proxies and anonymizers (which can render filtering useless). It also blocks phishing and some malware.

What is DNS and how it works

DNS is basically like a phone operator: you ask for a website like google.com , but computers don't understand addresses like that - they understand IP addresses, similar to how phone numbers don't care if you call to John Doe, they care about John Doe's phone number.

When you connect to router, the router gives you a specific information among which is what DNS server you're supposed to use. In case of Ubuntu, you can edit the /etc/dhcp/dhclient.conf. That way,when your computer connects to WiFi and receives some kind of information , it wills say "Thanks router, but I'll use my own DNS server". That's where those IP addresses come into play

Using your own DNS server

I've touched on this before several times, here for example. Basic idea this:

  1. Open /etc/dhcp/dhclient.conf file with your favorite text editor as root with sudo or gksu or pkexec (this one is preferred)
  2. Add this line that says option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; add a new line that says

    supersede domain-name-servers 208.67.222.123, 208.67.220.123;
    

    Notice the semicolon, very important !

  3. Save the file and reconnect to your network. You can check if the settings were successful via the GUI applet in the top right panel, or using nmcli dev show | grep DNS in terminal

Example:

Here's an example of my actual file. The line of interest is # 25. Note that in this example, I am using 208.67.222.222 and 208.67.220.220 servers, those are still OpenDNS but they're not Family Shiled servers. Use the 208.67.222.123 and 208.67.220.123 as I've mentioned before.

 1  # Configuration file for /sbin/dhclient.
 2  #
 3  # This is a sample configuration file for dhclient. See dhclient.conf's
 4  #   man page for more information about the syntax of this file
 5  #   and a more comprehensive list of the parameters understood by
 6  #   dhclient.
 7  #
 8  # Normally, if the DHCP server provides reasonable information and does
 9  #   not leave anything out (like the domain name, for example), then
10  #   few changes must be made to this file, if any.
11  #
12  
13  option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
14  
15  send host-name = gethostname();
16  request subnet-mask, broadcast-address, time-offset, routers,
17      domain-name, domain-name-servers, domain-search, host-name,
18      dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
19      netbios-name-servers, netbios-scope, interface-mtu,
20      rfc3442-classless-static-routes, ntp-servers;
21  
22  #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
23  #send dhcp-lease-time 3600;
24  #supersede domain-name "fugue.com home.vix.com";
25  supersede domain-name-servers 208.67.222.222, 208.67.220.220;
26  #prepend domain-name-servers 127.0.0.1;
27  #require subnet-mask, domain-name-servers;
28  timeout 300;
29  #retry 60;
30  #reboot 10;
31  #select-timeout 5;
32  #initial-interval 2;
33  #script "/sbin/dhclient-script";
34  #media "-link0 -link1 -link2", "link0 link1";
35  #reject 192.33.137.209;