Enabling DNS cache with dnsmasq on Gentoo
Here are the steps to install and configure dnsmasq:
# emerge -av dnsmasq
Then insert 'nameserver 127.0.0.1' into the first (important!) line in /etc/resolv.conf
nameserver 127.0.0.1 ...
Then start dnsmasq
# /etc/init.d/dnsmasq start
You can test your local DNS cache by typing
Have a look at the query time (must be something higher than 50ms in most cases). Query google again.
Now that's amazing, isn't it? 0msec!
Let dnsmasq start at boot (otherwise you can't resolve any DNS names because you've edited the /etc/resolv.conf)
# rc-update add dnsmasq default