[BlueOnyx:00786] Re: Lazy way to change a domain IP for multiple domains (pointing to the same website)
Greg Kuhnert
greg.kuhnert at theanchoragesylvania.com
Mon Mar 16 06:01:59 -05 2009
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. |
+---------------------------------------------------------------------+
More information about the Blueonyx
mailing list