mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-26 08:46:03 +00:00
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.
This commit is contained in:
parent
20dc6f78f1
commit
d4127af422
1 changed files with 3 additions and 0 deletions
|
@ -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"
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue