OpenVZ Forum


Home » General » Support » Caching nameserver (Is it useful)
Caching nameserver [message #42692] Wed, 11 May 2011 23:18 Go to next message
mustardman is currently offline  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 #42749 is a reply to message #42692] Thu, 19 May 2011 13:02 Go to previous messageGo to next message
seanfulton is currently offline  seanfulton
Messages: 105
Registered: May 2007
Senior Member
We 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
Re: Caching nameserver [message #42758 is a reply to message #42692] Mon, 23 May 2011 18:34 Go to previous messageGo to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
I created a VPS specifically as a nameserver VPS and I point the other VPS to use it's IP. I run a spam filtering company and I wanted fast DNS.

Re: Caching nameserver [message #42760 is a reply to message #42749] Mon, 23 May 2011 18:52 Go to previous messageGo to next message
mustardman is currently offline  mustardman
Messages: 91
Registered: October 2009
Member
seanfulton wrote on Thu, 19 May 2011 09:02
We 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 Go to previous message
mustardman is currently offline  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

Previous Topic: yum command not found within openvz container
Next Topic: How can we vzctl 101 set --cpuunits > 500 000
Goto Forum:
  


Current Time: Tue Nov 05 17:11:23 GMT 2024

Total time taken to generate the page: 0.05353 seconds