Caching nameserver [message #42692] |
Wed, 11 May 2011 23:18 |
mustardman
Messages: 91 Registered: October 2009
|
Member |
|
|
I have been looking into the possibility of enabling caching nameserver on one of my nodes. Most of the VPS's are used for email and with all the spam coming in it seems the majority of server resources are used for spamassassin dns lookups. I have read that spamassassin benefits quite a bit from caching nameserver.
The problem is that you cannot simply enable caching nameserver on a per VPS basis because my OpenVZ control panel (SolusVM) re-writes the resolv.conf file each time the VPS is rebooted.
So 1 possibility I can think of is to editing OpenVZ to re-write resolv.conf in the VPS with the localhost include in each VPS (which could cause unintended consequences if they do not have caching nameserver set up in every VPS).
The other possibility is to enable caching nameserver on the node itself which is probably a cleaner way to do it. I have not read any instructions for doing that on OpenVZ so perhaps it's not recommended or just won't work?
[Updated on: Thu, 12 May 2011 01:09] Report message to a moderator
|
|
|
|
|
Re: Caching nameserver [message #42760 is a reply to message #42749] |
Mon, 23 May 2011 18:52 |
mustardman
Messages: 91 Registered: October 2009
|
Member |
|
|
seanfulton wrote on Thu, 19 May 2011 09:02We use dnsmasq as a caching name server in the ve with no problem for the same purpose. You can add the localhost to resolve.conf by running:
vzctl set VEID --nameserver 127.0.0.1 --save
sean
Thanks for the info. I'll look into dnsmasq as an alternative. Setting the localhost on a per VPS basis is an option but I'd rather not do that.
[Updated on: Mon, 23 May 2011 18:53] Report message to a moderator
|
|
|
Re: Caching nameserver [message #49233 is a reply to message #42760] |
Thu, 11 April 2013 22:15 |
mustardman
Messages: 91 Registered: October 2009
|
Member |
|
|
I realize this thread is quite old but I wanted to update it because I found a simple solution.
Assuming you have root access to the node or your ISP will do it for you, just add 127.0.0.1 as the first nameserver entry for your container in addition to the other 2.
So now when the container reboots and /etc/resolv.conf is rewritten each time it has localhost as the first entry followed by the public DNS servers the node is set to use. Once that is taken care of you can do local dns caching in the container using BIND.
[Updated on: Thu, 11 April 2013 22:17] Report message to a moderator
|
|
|