I saved 32MB on my VPS Link 4, by using nsd instead of bind. The best thing about nsd is that it reads bind zone files. So if you need to serve domains, but are short of ram nsd is the way to go. BUT it does not do DNS forwarding, it only serves its own domains. For most VPS solutions, this shouldn't be a problem.
# ~/Free
VPS Memory: 134/479 MB (28%)
# service named stop
Stopping named: [ OK ]
# service nsd start
zonec: reading zone "domain1".
zonec: processed 11 RRs in "domain1".
..
zonec: reading zone "domain12".
zonec: processed 6 RRs in "domain12".
global_region: 421 objects (421 small/0 large), 4816 bytes allocated (306 wasted) in 2 chunks, 116 cleanups
db->region: 178 objects (178 small/0 large), 6376 bytes allocated (132 wasted) in 2 chunks, 1 cleanups
zonec: done with 0 errors.
Starting nsd...
# ~/Free
VPS Memory: 102/479 MB (21%)
# cat ~/Free
#!/bin/bash
bean="/proc/user_beancounters"
guar=`cat $bean | grep vmguar | awk '{ print $4;}'`
priv=`cat $bean | grep privvm | awk '{ print $2;}'`
let totl=guar/256
let used=priv/256
let usedp=100*priv/guar
echo "VPS Memory: $used/$totl MB ($usedp%)"
For some reason nsd only listens on one IP, even though the instructions say otherwise. If you know a better fix for this, please update this page. For those needing it to listen on more than one, use iptables to redirect your requests:
# iptables -t nat -A PREROUTING -d <secondary-ip> -p udp --dport 53 -j DNAT --to-destination <main-ip>
If you are running mySQL on your server, give myDNS a try. It works really well for me. Instead of dealing with complex hard to maintain bind formatted text files, myDNS is database driven. This is great for programmatic updates, it even comes with a PHP web page for basic admininistration. It has no trouble with multiple IP addresses. On my system it appears to use less then 1 MB of ram when running.