DNS - List Domains
Aim
In this demo, we'll be listing the domains in your account.
Instructions
Web Console
Log in to the web console, in the Services menu, click on DNS. You'll see a Domains Submenu. Clicking this will take you to a list of domains in your account.
Ansible
You can see detailed expected output here Ansible Output
$ cd ansible/
$ ansible-playbook playbook.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Collection community.aws does not support Ansible version 2.10.8
[WARNING]: Collection amazon.aws does not support Ansible version 2.10.8
PLAY [DNS - Listing Domains] *************************************************************************************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************************************************************************************************
ok: [localhost]
TASK [List all hosted zones] *******************************************************************************************************************************************************************************
[DEPRECATION WARNING]: The 'CamelCase' return values with key 'HostedZones' and 'list' are deprecated and will be replaced by 'snake_case' return values with key 'hosted_zones'. Both case values are
returned for now. This feature will be removed from amazon.aws in a release after 2025-01-01. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost]
TASK [Debug Hosted Zones] **********************************************************************************************************************************************************************************
ok: [localhost] => {
"hosted_zones": {
"HostedZones": [
{
"CallerReference": "8d943433e0fa60b3",
"Config": {
"Comment": "",
"PrivateZone": false
},
"Id": "8d943433e0fa60b3",
"Name": "apubliczone.com.",
"ResourceRecordSetCount": 1
}
],
"changed": false,
"deprecations": [
{
"collection_name": "amazon.aws",
"date": "2025-01-01",
"msg": "The 'CamelCase' return values with key 'HostedZones' and 'list' are deprecated and will be replaced by 'snake_case' return values with key 'hosted_zones'. Both case values are returned for now."
}
],
"failed": false,
"hosted_zones": [
{
"caller_reference": "8d943433e0fa60b3",
"config": {
"comment": "",
"private_zone": false
},
"id": "8d943433e0fa60b3",
"name": "apubliczone.com.",
"resource_record_set_count": 1
}
],
"list": [
{
"CallerReference": "8d943433e0fa60b3",
"Config": {
"Comment": "",
"PrivateZone": false
},
"Id": "8d943433e0fa60b3",
"Name": "apubliczone.com.",
"ResourceRecordSetCount": 1
}
]
}
}
PLAY RECAP *************************************************************************************************************************************************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Terraform - Pending
You can see detailed expected output here Terraform Output
$ cd terraform
$ terraform plan
$ terraform apply
AWS CLI
You can see detailed expected output here AWSCLI Output
$ cd awscli/
$ source ../../../providers/aws/setup.bash
$ ./dns-list-domains.bash
+ aws route53 list-hosted-zones-by-name --profile=alphatest --region=eu-west-2 --endpoint-url=https://aws.piranha.sh
{
"HostedZones": [
{
"Id": "8d943433e0fa60b3",
"Name": "apubliczone.com.",
"CallerReference": "8d943433e0fa60b3",
"Config": {
"Comment": "",
"PrivateZone": false
},
"ResourceRecordSetCount": 1
}
],
"IsTruncated": false,
"MaxItems": "100"
}
+ sleep 10s