add Rogue DNS feature


#1

Hello devs and community.
First, thx for PiHole and it’s great webui.

People who self-host their services and have HairPinning problems with bad routers must return a LAN (or VPN) IP address for certain domain names, instead of “official” ip address.
Example :

  • in the officials public DNS server, the address of mycloud.user.com is 8.8.8.8, user can use it only when he is not on his LAN
  • in the private user DNS Server (PiHole), the address of mycloud.user.com is 192.168.1.42, user can use it only on LAN.

When the user is on his LAN, the PiHole send the LAN address of his server.
When the user is on another network, the public DNS server send the WAN adresss of his server.

So with PiHole we must add DnsChef to accomplish this action, although netmasq seems to allow this via these options if I believe the following paragraph (source /etc/dnsmasq )

# Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local
# web-server.
#address=/double-click.net/127.0.0.1

It can be helpfull to add this feature for can remove dnschef dependancy, if it has your favors :slight_smile:

This feature offers the possibility to add another feature in the futur: a NTP server to give time to IOT machines whose user has blocked access to internet (isolated machines). But this feature needs to be able to return two or three known public NTP server domain names to the local, because the IOT does not often allow to choose its own NTP server (example Foscam). It’s working properly with dnschef + ntpd (on a machine with PiHole).