Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


timmmay

20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

#302108 29-Oct-2022 11:00
Send private message

I have an Ubuntu server running in Oracle Cloud which I vpn into using Wireguard from various devices and locations - home desktop, phone on 4G, etc. I'd like the server to do ad blocking so my various clients get fewer ads. What do people think the best technique is?

 

  • PiHole on the server? Somehow configure the server / vpn to use the local PiHole server?
  • Software similar to PiHole but better suited?
  • Something simple like a hosts file block? This is higher maintenance.

Suggestions appreciated for ways to do this on the server.


Filter this topic showing only the reply marked as answer Create new topic
rscole86
4999 posts

Uber Geek
+1 received by user: 462

Moderator
Trusted
Lifetime subscriber

  #2989464 29-Oct-2022 11:21
Send private message

I've not run your set up, but I would have thought you can tell wireguard to use the DNS you define. Can you not change it to your pihole?



timmmay

20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

  #2989475 29-Oct-2022 11:57
Send private message

While I'm at home I could, but I would like it to work from my phone over 4G.

rscole86
4999 posts

Uber Geek
+1 received by user: 462

Moderator
Trusted
Lifetime subscriber

  #2989481 29-Oct-2022 12:14
Send private message

I think you need to define as local DNS resolver within wireguard, it should point to the IP of your pihole(s).

Then make sure your peer is setup correctly.



dfnt
1553 posts

Uber Geek
+1 received by user: 1036

Trusted
Lifetime subscriber

  #2989482 29-Oct-2022 12:14
Send private message

Is the wireguard server in the same location as Pi-hole or somewhere else?

If it’s somewhere else just install Pi-hole on the same server as wireguard then use DNS = in your client config

Make sure not to expose Pi-hole to the internet

NightStalker
327 posts

Ultimate Geek
+1 received by user: 159


  #2989494 29-Oct-2022 12:54
Send private message

could try setting up server to use an external dns adblock service like adguard
https://adguard-dns.io/en/public-dns.html

 

 


nzkc
1634 posts

Uber Geek
+1 received by user: 1041


  #2989495 29-Oct-2022 13:07
Send private message

I have what you are describing and simply have the host running Wireguard to use the Pihole as DNS.  Works fine. Even if Wireguard is configured so your clients use it as the DNS just have it use the Pihole as upstream servers.


 
 
 
 

Shop now for Dyson appliances (affiliate link).
jamesrt
1663 posts

Uber Geek
+1 received by user: 941

ID Verified
Trusted
Lifetime subscriber

  #2989503 29-Oct-2022 13:48
Send private message

I have a PI running both WireGuard and PiHole - when I VPN via WireGuard from my phone, the phone uses the PiHole for AdBlocking/DNS.

 

This is because WireGuard is configured to use the PiHole as DNS for WireGuard clients; and on PiHole I had to enable "Permit all Origins" in Settings/DNS to enable PiHole to respond to the IP subnets used by WireGuard.

 

I'd give you the WireGuard config; except on the PI it's wrapped via "pivpn" - "pivpnDNS1=10.6.0.1" in the pivpn's WireGuard setupVars.conf; I'm sure it's not that hard to work out how go get WireGuard to supply a custom DNS to clients - getting PiHole to respond was the slightly harder thing, which is the "Permit all Origins" setting I mentioned above.

 

 


timmmay

20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

  #2989505 29-Oct-2022 13:55
Send private message

Thanks all. I asked the question from my phone, I didn't ask a great question. I've clarified the first post now, so I won't write more details here.

 

  • PiHole on Ubuntu server might be a good option. I'd just have to configure the VPN to use PiHole. Not 100% sure how but I can probably figure it out.
  • AdGuard public DNS server might be a good option, I didn't think of that, thanks @NightStalker :)  This is probably the easiest option.

fe31nz
1294 posts

Uber Geek
+1 received by user: 423


  #2989609 29-Oct-2022 23:05
Send private message

I use a Privoxy, a proxy server, for my ad blocking.  It is highly configurable and can even rewrite the content of web pages to remove obnoxious things.

 

https://www.privoxy.org

 

It is available as a package in Ubuntu.  Most of its configuration can be edited from a config web page it provides if you use this url:

 

http://p.p

 

So you can add new blocks or unblock a server or page easily on the fly while browsing.

 

 


Yoban
453 posts

Ultimate Geek
+1 received by user: 86


timmmay

20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

  #2990728 1-Nov-2022 20:42
Send private message

Interesting, thanks. I haven't used it much but simply pointing the Algo VPN at the ad blocking DNS should be enough. I'll have a look if not 🙂

Filter this topic showing only the reply marked as answer Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.