I am about to despair about this topic. I read dozens of articles, saw some videos on youtube and finally read this article here. Still, it just doesn't work for me.
When I finally do an nslookup on my Raspberry Pi that runs Pi-hole, I end up getting this:
I set up a second Raspi with a fresh installation of everything and found out that it correctly resolves my router when not having Pi-hole yet installed.
Just after installation (with of course configuring the conditional forwarding) I get that error message.
Adding to above, if you run below one on Pi-hole you should be able to see the Local domain name/DNS suffix/search domain that your FB is advertising to the network clients:
pi@raspberrypi4:~ $ pihole-FTL dhcp-discover
Scanning all your interfaces for DHCP servers
Timeout: 10 seconds
WARN: Could not sendto() in send_dhcp_discover() (/root/project/src/dhcp-discover.c:223): Network is unreachable
* Received 548 bytes from eth0:192.168.178.1
Offered IP address: 192.168.178.5
Server IP address: 192.168.178.1
Relay-agent IP address: N/A
BOOTP server: (empty)
BOOTP file: (empty)
DHCP options:
Message type: DHCPOFFER (2)
server-identifier: 192.168.178.1
lease-time: 864000 ( 10d )
renewal-time: 432000 ( 5d )
rebinding-time: 756000 ( 8d 18h )
netmask: 255.255.255.0
router: 192.168.178.1
dns-server: 192.168.178.9
domain-name: "fritz.box"
broadcast: 192.168.178.255
ntp-server: 192.168.178.1
Port Control Protocol (PCP) server: 192.168.178.1
DHCP packets received on interface lo: 0
DHCP packets received on interface docker0: 0
DHCP packets received on interface vethafc5361: 0
DHCP packets received on interface veth46333ce: 0DHCP packets received on interface vethb3c0982: 0
DHCP packets received on interface eth0: 1
DHCP packets received on interface wlan0: 0
I dont know which IP is what?
192.168.178.1 --> FB
192.168.178.5 --> ?
192.168.178.9 --> ?
And could you rephrase what your expecting pls?
If you mean the nslookup in your OP resolving to a NXDOMAIN (non existing domain), your querying the Quad9 public DNS server at 9.9.9.9, configured in your OS/network manager DNS settings, for a domain that only exists in your private LAN:
This 9.9.9.9 IP is most likely configured at the bottom of below file which you can edit (if change any, reboot to apply):
cat /etc/dhcpcd.conf
You should try run this exact same nslookup on one of your clients (Windows/MacOS or Linux) in a command prompt.
Looking at that Pi-hole settings screenshot, you configured Pi-hole correctly for conditional forwarding.
I need to have the local hostnames on the Pi where I am running Pi-hole.
It works flawlessly on all my other machines, but not on the Pi with the Pi-hole. As far as I understood it, this is "normal" unless you enable conditional forwarding in Pi-hole. Which perfectly makes sense to me. The Pi-hole should pass local hostnames to be resolved in my router.
192.168.178.1 --> FB
My router, the FritzBox
192.168.178.5 --> ?
IP of the Pi-Hole
192.168.178.9 --> ?
IP of another Pi-Hole in a docker container in a macvlan network (just testing this currently as a possible workaround, the problems I have were exactly the same without this additional Pi-hole).
Have you also tested box as local domain name?
Yes, but fritz.box is correct. It's the FritzBox's local domain name.
Advantages of using the 127.0.0.1 IP on the loopback adapter named lo is that nothing gets broadcasted over the eth0/wlan0 interface;
Also the loopback is way faster as ethernet or WiFi;
And loopback is not dependent on a physical connection like for example when the eth0 cable is unplugged
Pi-hole won't touch the DNS settings of its host machine, as that doesn't affect Pi-hole's operation.
You are free to configure your RPi's DNS resolution in any way you see fit (e.g. your RPi would have picked up Pi-hole as DNS from your FritzBox DHCP if you had configured your RPi to stick with DHCP (and configured a fixed IP address for it in your FB)).
It can be advantageous to provide a public DNS server in addition to or instead of Pi-hole.
That way, your RPi would still be able to resolve DNS and allowing you to reinstall or reconfigure Pi-hole or to update other OS packages even in case Pi-hole itself would be down, misconfigured or otherwise unavailable.
fritz.box is a fully qualified domain name (FQDN), whereas philips-hue-br2 isn't.
You may have to untick Never forward non-FQDNs under Advanced DNS settings from Settings| DNS.
If your router isn't your Pi-hole's only upstream, you may have to define respective Local DNS records for your plain hostnames instead.