From d4127af4221550fc047e77bce7aef6cd99342d0e Mon Sep 17 00:00:00 2001 From: "B. Blechschmidt" Date: Sat, 25 Mar 2023 15:20:31 +0100 Subject: [PATCH] Add DNS hint Virtual DNS intercepts the DNS queries generated by the machine. This requires that the queries are actually sent through the tunnel interface. In some scenarios, this is not automatically the case, for example when `/etc/resolv.conf` contains a `nameserver` entry with some local IP address for which there is a route through the ethernet interface. A special-purpose IP address like 198.18.0.1 is unlikely to be inside another route than the default route and can be used to force DNS resolution through the tunnel. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4ca3c19..bc6218d 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ sudo ip route add 0.0.0.0/1 dev tun0 sudo ip route add ::/1 dev tun0 sudo ip route add 8000::/1 dev tun0 +# Make sure that DNS queries are routed through the tunnel. +sudo sh -c "echo nameserver 198.18.0.1 > /etc/resolv.conf" + ./target/release/tun2proxy --tun tun0 --proxy "$PROXY_TYPE://$PROXY_IP:$PROXY_PORT" ```