Exclude "local" from being placed in logs/top domains?

Having a large network of Apple products and them using bonjour, everything locally is looked for via its devicename.local. So at the end of each day my logs are made up of about 10% "local" domains.

Is it possible to have this excluded from being included in the logs/top domains?

There isn't anything currently built in to handle this, but you can make a script that runs every minute (through cron) that removes lines in the log that match those domains.

Have a look at this pull request:

This will not prevent loging the domains but it will exclude them from being displayed in the results of the API and hence on the web UI.

So say I exclude example.com, will this also hide any sub domains such as sub.example.com?

1 Like

Just following that pull request, it doesn't appear to work for me. Ive made exclusions for both domains and client ip's as per formatting but it doesn't reflect on the WebUI, those domains and clients still show. Is there something I could be missing here?

Are you on the developers branch? If not, don't do it. We are currently working on a release and you will be notified when the update is available. The feature will be available once you updated.

I'm facing the same issue here that my local domain (with ending ".local") gets listed in the PiHole admin console as one of the faremost top domains.

In the PiHole web admin console, I have already ticked the boxes "never forward non-FQDNs" and "never forward reverse lookups for private IP ranges" under "Settings -> DNS -> Advanced DNS settings".

In addition to these settings, I have addedd the server's host name with its .local domain name in the "/etc/pihole/local.list" and "/etc/hosts" files, and have updated the "/etc/dnsmasq.conf" and "/etc/dnsmasq.d/01-pohole.conf" to include the line "local=/local/" as directive for DNSMasq to use the entries in /etc/hosts for local domain queries.

Still, even after a restart of the PiHole server, the siutation remains the same. Any other options to pursue this further?

Just to make this clear: Is this a bug or something expected you just don't want to see?

They do what they describe:

  • never forward non-FQDNs
    This option prevents domains that are not fully qualified to be forwarded. non-FQDNs are, for example "raspberrypi" or "localhost". However, everything that has a TLD, like "laptop.local" is a FQDN and not affected by this setting.

  • never forward reverse lookups for private IP ranges
    This option prevents the DNS server to forward reverse queries when you want to resolve, e.g., 192.168.0.123. This only makes sense as any upstream DNS server will have no idea what is with this in your network with this IP. There is only one exception and that is if you have your router as your only upstream destination and the router is handling DHCP.

Now queries to these domains don't get forwarded, but they, of course, are still accounted for.

See my post further up in this thread, a viable solution for you might be setting exclusion filters on your settings page (*.local should be supported).

Thank you for the detailled explanations given above.

And yes, double-checking again, I have also followed the suggestions outlined with the article "Be able to exclude certain domains / clients", and have modified the "/etc/pihole/setupVars.conf" file, adding the following lines:

API_EXCLUDE_DOMAINS=local
API_EXCLUDE_CLIENTS=192.168.0.11

whereby the .11 represents the IP address of the PiHole server.

Let me check the configuration again to ascertain to which extent I can conclude correctly all above outlines.

OK, followed all above cited suggestions and I left the platform running for the last 24 hours, and it seems that the local PiHole DNS server with hostname "dnsbox.local" keeps listing itself as one of the top domains (albeit local):

Capture

This would hide only the domain local (which is not present in your Top Domains!). Please try

API_EXCLUDE_DOMAINS=dnsbox.local

or (for a wildcard type like you are looking for)

API_EXCLUDE_DOMAINS=*.local

like I suggested :slight_smile:

This indeed solved it in conjunction with the answer provided to have "local=/local/" in the "/etc/dnsmasq.conf" file.

Have to put "*.local" in the "/etc/pihole/setupVars.conf" file. :+1: