If you simply want to block certain sites, why not use Pihole?
Programming
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
DNS over HTTPS bypasses pihole, and you have to do some effort to make it work. DNS in general is such a mess.
Yes DNS and pihole were never thought as content filtering tools
I need to block IPs and unauthorized connections that are not http/https as well, I know about DNS filtering but it's not what I am trying to achieve.
Is this on the same machine, or multiple machines?
The typical/easy design for an outgoing proxy, would be to set the proxy on one machine, configure the client on another machine to connect to the proxy, and drop any packets from the client that aren't targeted at the proxy.
For a transparent proxy, all connections coming from a client could be rewritten via NAT to go to the proxy, then the proxy can decide which ones it can handle or is willing to.
If you try to fold this up into a single machine, I'd suggest using containers to keep things organized.
Didn't think about the 2 machines thing. But yeah it looks definitely easier than setting a transparent proxy.. But I guess all of this has to be on the same network, I cannot use an external server to which I connect to via wan because at that point the connections would be already need to be unproxied going out right?
But can't your setup be done on the same machine with a firewall?