Skip to content

Instantly share code, notes, and snippets.

@Jlaird
Created November 8, 2018 17:09
Show Gist options
  • Select an option

  • Save Jlaird/3efa3f8cc91dde5d940a97acdf6cbd67 to your computer and use it in GitHub Desktop.

Select an option

Save Jlaird/3efa3f8cc91dde5d940a97acdf6cbd67 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Loops over hostzone and gets NS records and updates NameServers to match.
echo $1
for domain in $(cli53 export $1 |grep NS); do
if [[ $domain =~ 'ns-' ]]; then
ns_list+=($domain)
fi
done
aws route53domains update-domain-nameservers --domain-name $1 --nameservers "[{\"Name\": \"${ns_list[0]}\"}, {\"Name\": \"${ns_list[1]}\"}, {\"Name\": \"${ns_list[2]}\"}, {\"Name\": \"${ns_list[3]}\"}]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment