Is there a way to pagination the cli command : aws lightsail get-domain



I have a domain on AWS Lightsail with more than 311 entries. I can continue to create more entries, but it looks like the "aws lightsail get-domain --domain-name" returns a maximum of 311 domainEntries and does not provide pagination (like the get-domains or other command).

Lightsail console also will list that maximum of 311 entries with no pagination. We can figure that we have more than that number by deleting some entries. Entries not displayed before will then be listed (in the lightsail console or in the result of a CLI ok SDK query) after the deletion, up to the maximum of 311.

Is it a bug or I am doing something wrong ? If it is a bug, is it the right place to report it here ?

Thank you

3 Answers

Not sure if you've seen this doc page or not for the AWS CLI: Using AWS CLI Pagination

It sounds like it might be server-side pagination, so you can try these flags in your CLI command:


In case it's some weird client-side pagination, try this:

answered a year ago
profile pictureAWS
reviewed a year ago
  • Hi,

    I have seen that.

    While they work for other commands, all those options don't help for the specific "aws lightsail get-domain" : --max-items and --page-size return errors : "Unknown options: --max-items", "Unknown options: --page-size" --no-paginate is without effect --starting-token cannot be used because no token is provide in results --no-cli-pager is woking, but the result is still limited to a maximum of 311 entries. So if I have more than that, I can't get them.

    This is why I think it may be a bug.

    To reproduce, create dummy entries like for index = 1 to 320 : aws lightsail create-domain-entry --region us-east-1 --domain-name --domain-entry name=subdom-[index],type=CNAME, endfor

    aws lightsail get-domain --domain-name --region us-east-1 >domainentries.txt

    We have only 311 entries in the domainentries.txt file. We have the same limitation in the lightsail web console listing. But we can confirm that more than 311 entries exists by successfully deleting the created entries or by trying to recreate non visible entries (we get an error for existing entry)



Thanks for the idea, but it won't work for our specific use case where mosts of the records are subdomains corresponding to tenants and we have a limit of 6 DNS zone in AWS Lightsail.

Our use case is to update an existing entry (renaming, changing target...) Since an entry update require the entry id, we need to get it first (get-domain) in order to make the update.

We implemented a workaround as follow : instead of an update of an existing entry, we delete then recreate a new one with desired information

2 suggestions :

  1. implement the pagination for the get-domain command as for many others command
  2. allow to get entries by name (probably should return an array, since many entries could share the same name) with a command like "get-domain-entry" or filters to "get-domain". With that, we won't need to get all existing entries of a DNS Zone and loop on the result set if we are interested only in a single or a few entries
answered a year ago
  • Glad you found a workaround. Your use-case and suggestions have been noted. Thank you.


This is a known current limitation. Thank you for reporting it.

For an experience without this limitation, you could split your DNS zones into delegated sub-domains each with no more than 305 entries like :

  • DNS zone 1 -> has NS records for DNS zones and
  • DNS zone 2 -> and records related to this subdomain
  • DNS zone 3 -> and records related to this subdomain

Or use Route 53 hosted-zones with your Lightsail resources.

Or else if the partial view works for you, continue using Lightsail DNS zones with more entries.

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions