Setting up an OpenVZ VPS DNS Server in CentOS 5.3

Here is my quick-and dirty way to build DNS servers using OpenVZ, CentOS and Bind/Named. This assumes you are creating a new server via OpenVZ. Although Bind is easy to admin with the configuration files recently I have found it is easier to simply admin the zones with Webmin. This setup will create the VPS, install Bind and install Webmin.

Create the VPS:

cd /vz/template/cache/
vzctl create ${cid} --ostemplate centos-5-x86_64 --config vps.basic
vzctl set ${cid} --hostname [HOSTNAMEHERE] --save
vzctl set ${cid} --ipadd [IP] --save
vzctl set ${cid} --nameserver [IP] --save
vzctl start ${cid}
vzctl exec ${cid} passwd
vzctl enter ${cid}

From inside the VPS I install bind and webmin

yum -y install bind bind-chroot bind-libs bind-utils caching-nameserver
cd /root
rpm -Uvh webmin-1.480-1.noarch.rpm

Now I simply visit webmin’s panel and tap in any new zones (or copy over our zones from another box).

OpenVZ and virtual serving makes this time-consuming task of bringing new boxes up a simple task!

[ centos openvz ]