• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

AWS CLI Route53 Query

June 7, 2023 by Mister PKI Leave a Comment

The purpose of this article is to demonstrate how to use the AWS CLI Route53 Query functionality to search your DNS managed in Route53. This article will demonstrate two specific types of searches based on a single query parameter. One example for an IP based search and one example for a DNS name search.

AWS CLI Route53 DNS name search

To search for any DNS record by name, run the following aws cli route53 command.

aws route53 list-resource-record-sets --hosted-zone-id $HOSTED_ZONE --query "ResourceRecordSets[?Name == '$value.']"

Note the period after the $value parameter. It is required when searching by DNS name.

AWS CLI Route53 IP address search

To search for any DNS record by IP address, run the following aws cli route53 command.

aws route53 list-resource-record-sets --hosted-zone-id $HOSTED_ZONE --query "ResourceRecordSets[?ResourceRecords[?Value == '$value']]"

Take note of the different syntax of the DNS name search vs the IP address search.

AWS CLI Route53 Options

Here is a breakdown of each option in the route53 commands.

OptionDescription
list-resource-record-setsLists the DNS records
–hosted-zone-idThe hosted zone id you are searching in
–queryThe query including the IP Address or name. Note the difference in syntax between the two different queries.

Notably, the query is not intuitive and rather difficult to memorize. For that reason we have written a convenience bash script for searching route53 DNS by zone.

This example bash script simply checks the first digit of the value to determine the correct query syntax. To better validate the IP address consider this article: https://www.linuxjournal.com/content/validating-ip-address-bash-script

Additionally, you must populate the HOSTED_ZONE variable with your hosted zone id. The hosted zone id can be found using both the aws cli and in the aws console.

Conclusion

In conclusion, this article has demonstrated how to use the AWS CLI Route53 Query functionality to search your Amazon hosted DNS. If you would like to see more examples or have any questions, please leave us a comment. If you found this article, read more of our content.

AWS,  linux

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.