Domain Redirect

e.g. as replacement for missing NAT-Loopback so that i can redirect my dyndns to a specific server (in this case the PI where is OpenVPN and owncloud running so example.dyndns = 192.168.X.X)

You can do this today with native DNSMASQ configuration commands. Not quite as easy to do if there was a GUI, but not too bad.

sudo nano /etc/dnsmasq.d/99-domain-override.conf
host-record=example.dyndns,192.168.0.1

Save the file and exit nano. Then, restart dnsmasq:
sudo systemctl restart dnsmasq

I will look into adding this.

I don't think it is necessary to be able to add this using the web interface, but I added a convenient way of doing it via the command line.

First: Unconfigured, the Android OpenVPN client is not able to connect to the VPN server when in the internal network.

pi@raspberrypi:~# pihole -a hostrecord home.mydomain.de 192.168.1.10
Setting host record for home.mydomain.de -> 192.168.1.10

pi@raspberrypi:~# grep 'home' /etc/dnsmasq.d/01-pihole.conf
host-record=home.mydomain.de,192.168.1.10

Afterwards: The Android OpenVPN client is able to connect to the VPN server and shows its internal IP (192.168.1.10).


This command is IPv6-aware. Use:

pi@raspberrypi:~# pihole -a hostrecord home.mydomain.de 192.168.1.10,2003:89:xxxx:xxxx::xxx
Setting host record for home.mydomain.de -> 192.168.1.10,2003:89:xxxx:xxxx::xxx

It is also possible to remove the configuration by not specifying any host/IP:

pi@raspberrypi:~# pihole -a hostrecord
Removing host record

pi@raspberrypi:~# grep 'home' /etc/dnsmasq.d/01-pihole.conf

Result: The configuration has been removed. The OpenVPN server is, again, not able to connect.


Corresponding Pull Request:

This feature request has been merged.