-2

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.

Noah
  • 101
  • 2
  • Mouse over the down arrow; the popup says "*This question does not show any research effort; it is unclear or not useful*". Downvotes without comment may be presumed to be for at least one of those reasons. – MadHatter Jan 26 '15 at 12:22

1 Answers1

2

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.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • Does this need to be for each client individually? Or just the DNS my VPN is using (currently Google's 8.8.8.8). If the former, I don't think I agree as I know people at many workplaces log on to a VPN as a way to get on the company's locally hosted JIRA or other service. – Noah Jan 25 '15 at 20:06
  • The VPN servers have settings that override the client computers' DNS settings when they connect, so yes, it is the former. – Tero Kilkanen Jan 25 '15 at 23:37
  • Do you mean the latter? Since as you say, the DNS used by my VPN settings override the clients'. In my own experiment, it's the former. But maybe I phrased something wrong. Anyway, assuming the VPN DNS is used, thanks for the info. – Noah Jan 25 '15 at 23:54
  • Well, it is a matter of definition actually. The VPN server instructs VPN client to use DNS server provided by the VPN server, not the DNS server provided by local network via DHCP. In my eyes, this is VPN server that makes clients override their DNS settings. – Tero Kilkanen Jan 25 '15 at 23:55
  • OK, so I'll try set up a DNS server and approve your answer if that proves to work out. – Noah Jan 26 '15 at 00:10