diff --git a/KeyVault.Acmebot/Providers/GoogleDnsProvider.cs b/KeyVault.Acmebot/Providers/GoogleDnsProvider.cs index 5c9e247..bbcf5c4 100644 --- a/KeyVault.Acmebot/Providers/GoogleDnsProvider.cs +++ b/KeyVault.Acmebot/Providers/GoogleDnsProvider.cs @@ -35,10 +35,23 @@ public GoogleDnsProvider(GoogleDnsOptions options) public async Task> ListZonesAsync() { - var zones = await _dnsService.ManagedZones.List(_credsParameters.ProjectId).ExecuteAsync(); + var zones = new List(); - return zones.ManagedZones - .Select(x => new DnsZone(this) { Id = x.Name, Name = x.DnsName.TrimEnd('.'), NameServers = x.NameServers.ToArray() }) + ManagedZonesListResponse response = null; + + do + { + var request = _dnsService.ManagedZones.List(_credsParameters.ProjectId); + + request.PageToken = response?.NextPageToken; + + response = await request.ExecuteAsync(); + + zones.AddRange(response.ManagedZones); + + } while (!string.IsNullOrEmpty(response.NextPageToken)); + + return zones.Select(x => new DnsZone(this) { Id = x.Name, Name = x.DnsName.TrimEnd('.'), NameServers = x.NameServers.ToArray() }) .ToArray(); }