Can I use /etc/hosts file to block ads when using Ubuntu 14.04.3 OpenVPN server?

1

I have an OpenVPN server hosted on Digital Ocean. I've uploaded a hosts file to the server to help filter a lot of unwanted domains. When using the server, it filters the domains. However, when I use my client to connect to the OpenVPN server, the domains are still accessible on the client.

Is there a way block ads on the client as well? Do I need to setup Dnsmasq, Squid, or a DNS server to accomplish this?

user477101

Posted 2016-01-17T17:13:41.697

Reputation: 11

Answers

0

If you want to block domains in the same way you do it on server you can just edit hosts file no client's side. If it's Windows then this file is located in %SystemRoot%\System32\drivers\etc\hosts.

Complete list for different OS you can find here.

Wobbly

Posted 2016-01-17T17:13:41.697

Reputation: 346

Thank you for your answer. However, I want it to be able to protect anyone who uses my home network. Sometimes, we have iOS, Chromebooks, Chromecasts, and other devices that connect to the network. I want it to also work with guests who visit and use the network. – user477101 – 2016-01-17T22:10:11.970

By using hosts file you actually translate domain into wrong adress IP (localhost for example which is not accesible). To block traffic you can use iptables which will also affect on client side. – Wobbly – 2016-01-19T10:47:25.683