Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Changing Namesevers for all OpenVZ Virtual Servers  (Read 2497 times)

0 Members and 1 Guest are viewing this topic.

Aby

  • Guest
Changing Namesevers for all OpenVZ Virtual Servers
« 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).