I need to increase TTL on the local DNS resolution from 0 to 10 seconds. The reason I need it is because when I enable sending logs to an external syslog server, the external syslog server floods OpenWRT's dnsmasq with dozens of DNS requests per second for every host name that it receives in syslog messages. There is no reason to resolve the same host name over and over and over again every time it's mentioned in the syslog message received by the syslog server. So, I want to increase the local DNS TTL and see if I can dramatically reduce the number of DNS requests from the Syslog server as well as the size of the syslog files saved on the Syslog server because every DNS request is also logged into the same file.
I tried to add the following line to the config section of /etc/config/dhcp
option localttl '10'
Then, I restarted dnsmasq like this:
service dnsmasq restart
However, TTL continues to be 0 on DNS requests to OpenWRT for hostnames defined locally in OpenWRT. This dig was done on a Mac requesting the A record of the QNAP server on my LAN after I made the aforementioned change and restarted the dnsmasq service.
% dig +nocmd +noall +answer +ttlid a qnap.mydomain.local
qnap.mydomain.local. 0 IN A 192.168.200.30
Thank you!