[BlueOnyx:00787] Re: Lazy way to change a domain IP for multiple domains (pointing to the same website)
Taco Scargo
taco at scargo.nl
Mon Mar 16 06:13:51 -05 2009
Why not use the cmodvsite command ?
/usr/sbin/cmodvsite
Usage /usr/sbin/cmodvsite [OPTION]...
[--apop=string, -o, --set-apop] [--apopOff, --disable-apop] [--apopOn,
--enable-apop] [--catchall=string, -k, --enable-catchall, --set-catchall]
[--catchallOff, --disable-catchall] [--cgi=string, -c, --set-cgi] [--cgiOff,
--disable-cgi] [--cgiOn, --enable-cgi] [--domain=string, --domainname, -d]
[--fpx=string, -x, --set-fpx] [--fpxOff, --disable-fpx] [--fpxOn=string,
--enable-fpx] [--ftp=string, -f, --set-ftp] [--ftpConn=integer, -z,
--ftp-maxconn] [--ftpOff, --disable-ftp] [--ftpOn, --enable-ftp]
[--ftpQuota=integer, -m, --ftp-quota] [--help, -h, -?] [--host=string,
--hostname, -n] [--ipaddr=string, -i, --ipaddress] [--java=string, -j,
--set-java] [--javaOff, --disable-java] [--javaOn, --enable-java]
[--mailAliases=list, -e, --mail, --set-mailAliases] [--mailAliasesAdd=list,
--add-mailAliases] [--mailAliasesDel=list, --del-mailAliases]
[--maxusers=integer, -u, --max] [--name=list, --fqdn, -n, -g, --group]
[--php=string, -p, --set-php] [--phpOff, --disable-php] [--phpOn,
--enable-php] [--quick, -Q] [--quota=integer, -q, --set-quota]
[--shell=string, -t, --set-shell] [--shellOff, --disable-shell] [--shellOn,
--enable-shell] [--ssi=string, -s, --set-ssi] [--ssiOff, --disable-ssi]
[--ssiOn, --enable-ssi] [--ssl=string, -l, --set-ssl] [--sslOff,
--disable-ssl] [--sslOn, --enable-ssl] [--volume=string, -v]
[--webAliases=list, -w, --web, --set-webAliases] [--webAliasesAdd=list,
--add-webAliases] [--webAliasesDel=list, --del-webAliases]
On Mon, 16 Mar 2009 22:01:59 +1100, Greg Kuhnert wrote
> Hi Jeff...
>
> Jeff Jones wrote:
> > OK so lets say I have someone on a BO box - and they host the
> > following domains via BO DNS:
> >
> > bigboobies.com
> > big-boobies.com
> >
> What can I say.... I just couldnt resist having a play with ......
> DNS records.
> > Does anyone here know any clever way (perhaps some perl?) that I could
> > run that would just change the IP addresses all these boobie domains?
> >
> Here is a realy quick'n dirty script that you can use....
> Disclaimer: Not really heavily tested. Just pass it 3 arguments.
> Domain, OldIP, NewIP
>
> In its current form, it will get all "A" records for the specified
> domain. (www, mail, anything)... so dont run it in its current form
> unless thats what you want to do.
>
> A quick explanation to help give you some comfort: The "for" line in
> the script does a cce query to find the OID's for all DNS records in
> codb that relate to your source IP / domain name.
>
> It then iterates through that list of OID's, and does a change for
> each match. To "test" the script, you could remove the bit after the
> "|" character to view what its going to do before you finally run it.
>
> Hope that helps.
>
> Regards,
> Greg
>
> #!/bin/bash
> DOMAIN=$1
> FROMIP=$2
> TOIP=$3
>
> for X in `echo "find DnsRecord ipaddr=\"$FROMIP\" type=\"A\"
> domainname=\"$DOMAIN\"" |
> /usr/sausalito/bin/cceclient | grep ^104 | cut -d " " -f
> 3` do echo set $X ipaddr = \"$TOIP\" | /usr/sausalito/bin/cceclient
> done
>
> --
> +--------------------------------------------------------------------
> -+ | / \ Greg Kuhnert, gkuhnert at compassnetworks.com.au
> | | < o > Compass Networks - Pointing you in the right
> direction | | \ / Check out our website for NuOnce module
> support. | +----------------------------------------------
> -----------------------+ _______________________________________________
> Blueonyx mailing list
> Blueonyx at blueonyx.it
> http://www.blueonyx.it/mailman/listinfo/blueonyx
More information about the Blueonyx
mailing list