Overriding `local-ttl` in user config files

Hi, I've seen the posts on why local-ttl is set to 2s, but I'd still like to have the ability to override the value in my custom config files. E.g.
https://discourse.pi-hole.net/t/change-the-ttl/6903/16

As some other users reported, the reason for wanting to change the value is to deal with Ubiquity equipment that continuously resolves the controller address.
I do not care if the local blacklist is not updated in 2s, it is more important for me to reduce network traffic.

I am not asking to change the default value, I am just asking that I can override the value in my config.
As is, it is not possible to specify the local-ttl value in my user config, the resolver fails to start, I must change the value in the default 01-pihole.conf file. But, every time pihole updates, it reverts my change.

E.g. pihole docker was updated by watchtower last night:

Please allow us to override the local-ttl value in user config, so that it is not reset on app updates.

Since you seem to need a longer TTL for just a single record for your Ubiquiti controller, did you consider to define a host-record with such a TTL in a custom dnsmasq configuration file?

host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
(...)
If the time-to-live is given, it overrides the default, which is zero or the value of --local-ttl . The value is a positive integer and gives the time-to-live in seconds.

(qouted from dnsmasq man page)

I have the DNS host entry defined in /pihole/custom.list:
192.168.1.2 unifi-direct.home.insanegenius.net

I am not clear on what file the config should go in, 01-pihole.conf is overwritten on install.
Do I add the config line to my 02-custom.conf file?

Update:
I just tried it out.
Added host-record=unifi-direct.home.insanegenius.net,192.168.1.2,300 to 02-custom.conf, and deleted the entry from custom.list.

Before: unifi-direct.home.insanegenius.net. 2 IN A 192.168.1.2
After: unifi-direct.home.insanegenius.net. 300 IN A 192.168.1.2

I still think it would generally be good to allow values to be overridden by user files, but this works for this particular domain.

Thx

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.