Domain Redirect


#1

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)


Setting up host names
Redirect dyndns conditionally [no NAT-loopback, Owncloud]
Redirect dyndns conditionally [no NAT-loopback, Owncloud]
#2

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


#3

I will look into adding this.


#4

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:


Bug in new "Domain Redirect" feature?
#5

This feature request has been merged.


#6