As per suggestion of @jgeewax, change ttl in DnsRecord to accept duration as a number and TimeUnit. For an example, see e.g. here: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java#L1475