How to set TTL for Local DNS records?

I like the dns.hosts feature in v6, however it seems to have an issue. Records added using this feature always get served with TTL=0 and I cannot find any way to change this. The setting for local-ttl in DNSmasq settings doesn't seem to be applied to these records. A default of 0 seems like very bad idea so maybe it could be changed and a GUI option provided to configure an explicit value?

You can add a custom dnsmasq config line, e.g. to set a local TTL of 60 seconds:

sudo pihole-FTL --config misc.dnsmasq_lines '[ "local-ttl=60" ]'

In case you'd run Pi-hole as a Docker container, you may set its FTLCONF_misc_dnsmasq_lines environment variable.

That option is also accessible via All settings » Miscellaneous as misc.dnsmasq_lines.

If instead you want to keep a bunch of configuration lines in your own custom file under /etc/dnsmasq.d/, you could alternatively enable misc.etc_dnsmasq_d.

All settings is available in Expert mode only.

Thanks, this solved it for me. I hadn't noticed that inclusion of files in dnsmasq.d is no longer enabled by default since (I think) 6.0.