Linux

dnsmasq 客戶端 TTL

  • November 29, 2012

我的主機文件不斷變化的情況。因此,我不希望客戶端記憶體使用主機文件解析的 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 為零?

正確,如果您省略-Tor--local-ttl標誌,它預設為零(對於來自本地電腦的請求,例如來自您的hosts文件)。

您還可以設置一個--max-ttl標誌來指示傳遞回客戶端以進行遞歸請求的最大 TTL 值。

引用自:https://serverfault.com/questions/453613