mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-24 16:20:13 +00:00
Created OpenVPN server: Only route DNS via VPN (markdown)
parent
2bd4e0f100
commit
0772e4eda2
1 changed files with 41 additions and 0 deletions
41
OpenVPN-server:-Only-route-DNS-via-VPN.md
Normal file
41
OpenVPN-server:-Only-route-DNS-via-VPN.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
Full article: https://github.com/pi-hole/pi-hole/wiki/Pi-hole---OpenVPN-server
|
||||
|
||||
### Optional: Only route DNS via VPN
|
||||
|
||||
With this setup you will force connected clients to use only the DNS provided by the VPN connection, i.e. the Pi-hole. Do this only if you don't want to tunnel **all** connections from the client thru the VPN, but only DNS queries.
|
||||
|
||||
Edit your `/etc/openvpn/server.conf` and remove (comment) the following line:
|
||||
```
|
||||
# push "redirect-gateway def1 bypass-dhcp"
|
||||
```
|
||||
|
||||
This works pretty much out of the box with common `client.ovpn` files, but when using the Network Manager, you will have to set an additional setting on the client side of things:
|
||||
|
||||

|
||||
|
||||
You will also have to set the address of the DNS server manually in your operating system:
|
||||
|
||||

|
||||
|
||||
After doing this, you should see:
|
||||
```
|
||||
pi.hole has address W.X.Y.Z (outside address of your VPN server)
|
||||
pi.hole has IPv6 address A:B:C:D:E:F (outside address of your VPN server)
|
||||
```
|
||||
|
||||
The web interface of your Pi-hole will be visible at `http://10.8.0.1/admin/` (even with the recommended firewall configuration mentioned on another subpage)
|
||||
|
||||
---
|
||||
## Troubleshooting
|
||||
|
||||
If your new DNS server configuration has not been activated (try restarting the interface / system) you will see
|
||||
```
|
||||
host pi.hole
|
||||
Host pi.hole not found: 3(NXDOMAIN)
|
||||
```
|
||||
|
||||
If you are not connected to your VPN network you will see
|
||||
```
|
||||
host pi.hole
|
||||
;; connection timed out; no servers could be reached
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue