When tunnelling through a VPN, block or redirect certain domains [closed]

I’d like to block or redirect certain domains for anyone using my VPN tunnel (pptp).

I thought simply editing the hosts file would achieve this, but I guess not. Is there another way?

The VPN is set up on a DigitalOcean VPS.

EDIT: I assume the down vote comes from the assumption I want to do something malicious. Actually, I am just trying to set up a kind of Intranet where I can create redirect traffic from a-domain-that-does-not-exist-irl.com to localhost, which will host a web app. The purpose is to show a client their project while it’s in progress without putting it public not he Internet.

EDIT2: Why the down votes? Please comment.

Answer

You need to override your VPN clients’ DNS server with a DNS server you have control over, and where you can set the overrides for DNS resolving.

Attribution
Source : Link , Question Author : Noah , Answer Author : Tero Kilkanen

Leave a Comment