Just curious and a relaxed request: Is it planned to introduce DNS rewrite capability? To answer not just 0.0.0.0 but something configurable to certain requests? Thanks for your work, very much appreciated.
Testing pi-hole 5.0 on a dietpi, where almost everything is working great, just one small hiccup because it is not using lighthttpd. One
That can already be achieved now by injecting additional host records into dnsmasq, or simply by editing /etc/hosts (see also implemented FR Domain Redirect).
It seems like you canāt add two records to the same IP though, which is disappointing...
If I add the following for example:
pihole -a hostrecord app1.loadbalancer.example.com 192.168.1.10
pihole -a hostrecord app2.loadbalancer.example.com 192.168.1.10
pihole -a hostrecord app3.loadbalancer.example.com 192.168.1.10
pihole -a hostrecord app4.loadbalancer.example.com 192.168.1.10
Only the last one actually works, the rest are all overwritten.
No, I just added multiple entries to /etc/dnsmasq.d/01-pihole.conf and that worked, since thatās what the command above does basically as per this.
Iām just saying, the command doesnāt work properly.
dschaper@nanopineo:~$ head -n20 /etc/dnsmasq.d/01-pihole.conf
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
# FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
# #
# IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
# /etc/pihole/setupVars.conf #
# #
# ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
# WITHIN /etc/dnsmasq.d/yourname.conf #
###############################################################################
I can confirm that pihole -a hostrecord only writes or alters a singlehost-record= line to 01-pihole.conf.
Pihole v5 will allow you to add Custom DNS entries via its UI.
With v4, you still could alter /etc/hosts, or create a separate file (named e.g. /etc/dnsmasq.d/50-hostrecords.conf) and manually add several lines. That way, they would be safe from being overwritten on Pihole updates (as Dan pointed out for manual edits of 01-pihole.conf).
I just checked the description there - it is doing exactly what it is supposed to do.
Furthermore, the help confirms this:
$ pihole -a hostrecord -h
Usage: pihole -a hostrecord <domain> [IPv4-address],[IPv6-address]
Example: 'pihole -a hostrecord home.domain.com 192.168.1.1,2001:db8:a0b:12f0::1'
Add a name to the DNS associated to an IPv4/IPv6 address
Options:
"" Empty: Remove host record
-h, --help Show this help dialog
Note that many of the -a options should not be used directly. They are used internally by the pi.hole/admin interface (hence the a). Their behavior might change at any time and without further notice when this is necessary for the proper function of the dashboard. We are trimming the dashboard to use less and less CLI commands in the backend, so be prepared that these internal commands may simply disappear at some point. Again, without further notice.
Doing such involved DNS configuration should not be an everyday task. It is also not something inexperienced users shouldn't do, probably. So going to your Pi-hole and modifying some config file for this seems acceptable.
Even more, your changes will likely overwritten by the first settings change you do on the dashboard. Hence, you should put your lines in a separate file to avoid headaches:
edit: Added man page screenshot + marked unnecessary comments appropriately.
58 users think that pihole -a hostrecord is useless. Even when it originally fixed an issue a user had.
We'll finally remove this option with v5.0 to avoid further confusion, sorry, I wasn't aware of that it was causing such an immense pain. We don't get pinged when you react with to an issue so we don't feel the "level of suffering" a feature creates.
I'm missing something here. The feature was added (a long time ago). New functionality has since been added in V5.0 that makes this feature superfluous, and it has been removed.
Great, not sure where the 5 votes for discourse comes in to play other than to complain that yet another thing we don't do right, but hey, we get that a lot.