dnsmasq客户端TTL

我有一个情况,我的主机文件不断变化。 因此,我不希望客户端caching使用主机文件parsing的IP地址。 这里是为我启动dnsmasq的命令:

/usr/sbin/dnsmasq -K -R -y -Z -b -E -S 8.8.8.8 -l /tmp/dhcp.leases -r /tmp/resolv.conf.auto --stop-dns-rebind --rebind-localhost-ok --dhcp-range=lan,192.168.2.2,192.168.2.249,255.255.255.0,12h -2 eth0 

在看这个网站: http : //www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

我看到-T选项有这样的描述:

  -T, --local-ttl=<time> When replying with information from /etc/hosts or the DHCP leases file dnsmasq by default sets the time-to-live field to zero, meaning that the requester should not itself cache the information. This is the correct thing to do in almost all situations. This option allows a time-to-live (in seconds) to be given for these replies. This will reduce the load on the server at the expense of clients using stale data under some circumstances. 

我的命令没有-T选项。 我需要它还是没有它的dnsmasq默认TTL为零?

正确的话,如果你省略了-T--local-ttl标志,它只是默认为零(对来自本地机器的请求,比如你的hosts文件)。

您也可以设置一个--max-ttl标志来指示传递给客户端的recursion请求的最大TTL值。