Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a situation where my hosts file is constantly changing. Because of this I don't want clients to cache ip addresses resolved using the hosts file. Here is the command that starts dnsmasq for me:

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

In looking at this site:

I see that the -T option has this description:

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

My command doesn't have the -T option. Do I need it or does dnsmasq default TTL to zero without it?

share|improve this question
up vote 1 down vote accepted

Correct, if you omit the -T or --local-ttl flag, it simply defaults to zero (for requests from the local machine, like from your hosts file).

You can also set a --max-ttl flag to indicate the maximum TTL value passed back to clients for recursive requests.

share|improve this answer
hmmm....then this should be working for me. There must be something else going on. Do some clients ignore the ttl and cache anyway? Or is there something else missing in my command? – user548971 Nov 29 '12 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.