Date: Monday 11th February 2013 09:45:46 UTC (over 4 years ago)

On Mon, Feb 11, 2013 at 09:11:47AM +0000, Simon Kelley wrote:
> > On 11/02/13 09:02, trang dang wrote:
> >
> > > Hello,
> > >
> > > I use dnsmasq 2.63 on debian, only dns is on, and want to read cache
> > > dump with a small script. Till now the cache dump has been written
> > > in extra log file (log-facility is on) or in syslog. Is there any
> > > way to get an extra cache file? It will be easier to parse the
> > > content of the cache. Furthermore, the host name in the log is cut
> > > after about 39 characters. Is there any way to get the complete
> > > content?
> >
> > There's not way to do either of those, sorry. You best bet is probably
> > to start hacking on the existing cache dumping code in src/cache.c to
> > make it do what you want.
> I did exactly this about a month ago:ยน
> This adds a `--hosts-cache=` option that dumps the current cache
> to  in hosts file format on SIGUSR1.
> If anyone is curious why I would want such a feature, I am using the
> information to construct firewalls for children (e.g. visit,
> browse around, dump hosts to file, then add them to child's outbound
> firewall rules). There are other ways to go about this, but I found this
> to be straightforward.
> It also happens to be useful for navigating to sites whose DNS entries
> have been recently hijacked, which has become a frightening reality in
> recent years.
>     guns

This is exactly what I am looking for.


The dnsmasq cache dump is a feature that is desirable by many people, and
this is the most straightforward solution. Would you take this patch
please, or there are better ways to do it now?

Dnsmasq-discuss mailing list

Reply via email to