}
List<DnsRecordsetSpec> dnsRecordsets = Lists.newArrayList();
for (String host : hosts) {
if (!ipv4.isEmpty()) {
DnsRecordsetSpec dnsRecord = new DnsRecordsetSpec();
dnsRecord.fqdn = host;
dnsRecord.type = "A";
dnsRecord.records = Lists.newArrayList(ipv4);
dnsRecordsets.add(dnsRecord);
}
if (!ipv6.isEmpty()) {
DnsRecordsetSpec dnsRecord = new DnsRecordsetSpec();
dnsRecord.fqdn = host;
dnsRecord.type = "AAAA";
dnsRecord.records = Lists.newArrayList(ipv6);
dnsRecordsets.add(dnsRecord);