network – Alternative DNS resolution for Safari in macOS?

I use a Pihole on my network to provide a local DNS service to block ads and several websites. Recently I have noticed (maybe since Mojave) that Safari seems to overlook this. The Pihole device also works as my DHCP server, and is configured to transmit to clients that they must use their IP as a DNS server.

  • Running nslookup from the console it indicates that the operating system knows that the IP of Pihole is its DNS server.
  • The search of known advertising domains through nslookup correctly returns the IP address of Pihole (indicating that an ad that comes from there would be blocked).
  • In the Network preferences panel, in DNS for the network interface, the IP address of the Pihole is displayed in DNS Servers.
  • Other web browsers (Chrome and Firefox) in the same MacBook Pro do not show the ads that Safari shows.
  • I have the output port 53 blocked on my router for any device, but the Pihole switch nslookupthe server for 8.8.8.8 (Google DNS) results in a connection timeout (which would wait with the port of exit blocked).
  • No other device on my network exhibits this behavior, including iOS devices.

Network configuration -getdnsservers Wi-Fi reports "There are no DNS servers configured on Wi-Fi". If I configure it manually through networksetup -setdnsservers Wi-Fi 192.168.1.22 the situation gets best but the behavior of Safari still does not match with Chrome. And that is not really a viable solution in the long term, since I will have to deactivate it every time it leaves my home network.

Does Safari have any other means to search DNS that is hidden? How could I be overlooking the DNS settings?