Skip to content

Instantly share code, notes, and snippets.

@doekenorg
Created November 21, 2013 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doekenorg/7578491 to your computer and use it in GitHub Desktop.
Save doekenorg/7578491 to your computer and use it in GitHub Desktop.
Little bashscript that find replaces every ip in a series of named-files.
#dnschange.sh
!/bin/sh
for domain in "$@"
do
sed -i 's/ORIGINAL_IP/NEW_IP/g' /var/named/$domain.db
done
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
#usage: ./dnschange.sh domain.ext domain2.ext domain3.etc etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment