diff --git a/org/xbill/DNS/Record.java b/org/xbill/DNS/Record.java
index <HASH>..<HASH> 100644
--- a/org/xbill/DNS/Record.java
+++ b/org/xbill/DNS/Record.java
@@ -523,25 +523,41 @@ hashCode() {
 	return array.hashCode();
 }
 
+private Record
+cloneRecord() {
+	try {
+		return (Record) clone();
+	}
+	catch (CloneNotSupportedException e) {
+		throw new IllegalStateException();
+	}
+}
+
 /**
  * Creates a new record identical to the current record, but with a different
  * name.  This is most useful for replacing the name of a wildcard record.
  */
 public Record
 withName(Name name) {
-	Record rec = null;
 	if (!name.isAbsolute())
 		throw new RelativeNameException(name);
-	try {
-		rec = (Record) clone();
-	}
-	catch (CloneNotSupportedException e) {
-	}
+	Record rec = cloneRecord();
 	rec.name = name;
 	return rec;
 }
 
 /**
+ * Creates a new record identical to the current record, but with a different
+ * class.  This is most useful for dynamic update.
+ */
+Record
+withDClass(short dclass) {
+	Record rec = cloneRecord();
+	rec.dclass = dclass;
+	return rec;
+}
+
+/**
  * Compares this Record to another Object.
  * @param o The Object to be compared.
  * @return The value 0 if the argument is a record equivalent to this record;
Add a method to create a clone of a record with a different class.


git-svn-id: <URL>