It looks like cache-domains scripts produce symlinks /tmp/lancache.conf and /tmp/dnsmasq.d/lancache.conf that point to /var/cache-domains/lancache.conf
Unfortuinately, something about these being symlinks makes dnsmasq not work at all. And I mean at all, it's not that it doesn't act on the cache-comain entries, it fails to work completely.
Replacing the symlinks by copies of the files that are symlinked makes it work.
I have a cron script that fixes it in a bit of rednecky way, but that's a rather crap workaround, not a solution.
#!/bin/sh
if [ -L /tmp/lancache.conf ] && [ -f /var/cache-domains/lancache.conf ]; then
echo "lancacne.conf symlink detected"
rm -f /tmp/lancache.conf
cp /var/cache-domains/lancache.conf /tmp/lancache.conf
service dnsmasq restart
fi
if [ -L /tmp/dnsmasq.d/lancache.conf ] && [ -f /var/cache-domains/lancache.conf ]; then
echo "/tmp/dnsmasq.d/lancacne.conf symlink detected"
rm -f /tmp/lancache.conf
cp /var/cache-domains/lancache.conf /tmp/dnsmasq.d/lancache.conf
service dnsmasq restart
fi
md51=`md5sum /tmp/lancache.conf | awk '{print $1;}'`
md52=`md5sum /var/cache-domains/lancache.conf | awk '{print $1;}'`
if [ "$md51" != "$md52" ]; then
echo $md51
echo $md52
echo "File mismatch"
rm -f /tmp/lancache.conf
cp /var/cache-domains/lancache.conf /tmp/lancache.conf
service dnsmasq restart
fi
md51=`md5sum /tmp/dnsmasq.d/lancache.conf | awk '{print $1;}'`
if [ "$md51" != "$md52" ]; then
echo $md51
echo "File mismatch"
rm -f /tmp/dnsmasq.d/lancache.conf
cp /var/cache-domains/lancache.conf /tmp/dnsmasq.d/lancache.conf
service dnsmasq restart
fi
I am not sure if this is more of a dnsmasq bug or a cache-domains bug.
Where should I file a bug about this? This has been broken for years, and it re-breaks after each router reboot.