Removing DNS entries with gcloud -
adding dns record gcloud good
gcloud dns record-sets transaction start -z my-zone gcloud dns record-sets transaction add -z my-zone --name "some_domain.com" --ttl 0 --type txt "test" gcloud dns record-sets transaction execute -z my-zone
but when try remove entry
gcloud dns record-sets transaction start -z my-zone gcloud dns record-sets transaction remove -z my-zone --name "some_domain.com" --ttl 300 --type txt "test" gcloud dns record-sets transaction execute -z my-zone
i error
error: (gcloud.dns.record-sets.transaction.remove) invalid value 'parameters.name': 'some_domain.com' (code: 400)
the dns zone file standard requires complete domain names end trailing '.' character. since common mistake, other gcloud dns ...
commands automatically append trailing '.' domain names if user forgets add one. however, particular command not seem doing that. fixed soon.
meanwhile, workaround it, need add trailing '.' in domain name. so:
gcloud dns record-sets transaction remove -z my-zone --name "some_domain.com." --ttl 300 --type txt "test"
alternatively, can use import/export follows:
gcloud dns record-sets export -z my-zone records-file
edit records-file
remove records not need. then:
gcloud dns record-sets import -z my-zone --delete-all-existing records-file
Comments
Post a Comment