Domain Redirect

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: