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:
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.
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.