I have a problem, I have a gateway for home automation and if I set PiHole's DNS to the network he no longer navigates the network and I can't control the devices, how can I make sure that only he doesn't go through PiHole?
as a system I use UNiFi for the network with DNS towards PiHole, but DHCP given by UNiFi
Another option, if you can set the DNS on the home automation gateway, is to simply not use Pi-hole on that device and instead configure it to use an external DNS server, such as Quad9.
Just to clarify – on your network you have a Pi-hole and devices are using it for DNS. One of those devices is the home automation gateway. When this is using Pi-hole it doesn't work properly, and when it is not using Pi-hole (what is it using instead?) it does work properly? Is all that correct?
Just trying to understand better what you are describing and how it's all set up. What are the symptoms you are seeing?
Are you sure that Pi-hole is the cause of the symptoms you are seeing? What happens if you go to Disable Blocking > Indefinitely in Pi-hole, does the problem go away?
The only thing that Pi-hole might interfere with is blocking some domains which the home automation gateway needs to access. The post I linked to shows how to put the home automation gateway into its own group with no blocking, and this would fix that problem. Or identify any blocked domains and whitelist them. Or you could configure the home automation gateway to not use Pi-hole for DNS and instead use something else, if it is possible to do that.
How are devices using your Pi-hole? Is your router giving out the Pi-hole address in its DHCP settings to use as the DNS server? Os is the Pi-hole the WAN DNS for your ISP router? Do you see the home automation gateway and other devices in your Pi-hole Query Log, or do you just see your ISP router in there?
It is not possible to change the DNS on the gateway, I also tried to whitelist the domains it blocks, but in any case if I remove the PiHole DNS and put 1.1.1.1 on the network the gateway is reachable, with the PiHole DNS set on the network it is not it is reachable.
In the Query Log I see the device, and I see that it is OK and does not block anything but the gateway both in the local network and externally is unrecoverable
Where are you making the change between 1.1.1.1 and your Pi-hole IP?
When you say the home automation gateway becomes unreachable, what do you mean by that and how are you testing that? How are you trying to reach it? What happens when you try?
It might be worth creating a debug log and posting just the token URL here. Then we can take a look at the Pi-hole config and see if anything jumps out.