#!/usr/bin/perl -w if( $> != 0 ) { die "I must be run as root or setuid root\n"; } if( -f "/etc/resolv.conf" ) { print "Disabling DNS\n"; rename("/etc/resolv.conf", "/etc/resolv.conf.old") || die "Could not rename file!"; exit; } if( -f "/etc/resolv.conf.old" ) { print "Enabling DNS\n"; rename("/etc/resolv.conf.old", "/etc/resolv.conf") || die "Could not rename file!"; exit; } die "No DNS stuff found!";