diff --git a/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java b/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java index c6dba6db..bc9c7626 100644 --- a/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java +++ b/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java @@ -133,6 +133,36 @@ public class BammBammClient { sendRequest("clear-txt", jb.toString()); } + /** + * Adds a CNAME Record to the DNS. Only one CNAME Record is supported per domain. If + * another CNAME Record is set, it will replace the existing one. + * + * @param domain + * Domain to add the CNAME Record to + * @param cname + * CNAME Record to add + * @since 2.9 + */ + public void dnsAddCnameRecord(String domain, String cname) throws IOException { + JSONBuilder jb = new JSONBuilder(); + jb.put("host", domain); + jb.put("target", cname); + sendRequest("set-cname", jb.toString()); + } + + /** + * Removes a CNAME Record from the DNS. + * + * @param domain + * Domain to remove the CNAME Record from + * @since 2.9 + */ + public void dnsRemoveCnameRecord(String domain) throws IOException { + JSONBuilder jb = new JSONBuilder(); + jb.put("host", domain); + sendRequest("clear-cname", jb.toString()); + } + /** * Adds a certificate for TLS-ALPN tests. *