Admin-Ahead Community

Linux => General Linux => Topic started by: Aby on May 22, 2014, 03:16:32 am

Title: Changing Namesevers for all OpenVZ Virtual Servers
Post by: Aby on May 22, 2014, 03:16:32 am
Changing Namesevers for all OpenVZ Virtual Servers

This is a simple script to change the name servers to desired name.

====
#!/bin/sh
 
VPS="$(cd /vz/private/ && echo *)"
 for VPS in $VPS; do
 vzctl set $VPS --nameserver 8.8.8.8 --nameserver 8.8.4.4 --save
 done;
====

This will set the resolver ip's in all the vps to the Google resolvers(example).