diff options
Diffstat (limited to 'src/org/xbill/DNS/CNAMERecord.java')
-rw-r--r-- | src/org/xbill/DNS/CNAMERecord.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/org/xbill/DNS/CNAMERecord.java b/src/org/xbill/DNS/CNAMERecord.java new file mode 100644 index 0000000..8db9453 --- /dev/null +++ b/src/org/xbill/DNS/CNAMERecord.java @@ -0,0 +1,45 @@ +// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org) + +package org.xbill.DNS; + +/** + * CNAME Record - maps an alias to its real name + * + * @author Brian Wellington + */ + +public class CNAMERecord extends SingleCompressedNameBase { + +private static final long serialVersionUID = -4020373886892538580L; + +CNAMERecord() {} + +Record +getObject() { + return new CNAMERecord(); +} + +/** + * Creates a new CNAMERecord with the given data + * @param alias The name to which the CNAME alias points + */ +public +CNAMERecord(Name name, int dclass, long ttl, Name alias) { + super(name, Type.CNAME, dclass, ttl, alias, "alias"); +} + +/** + * Gets the target of the CNAME Record + */ +public Name +getTarget() { + return getSingleName(); +} + +/** Gets the alias specified by the CNAME Record */ +public Name +getAlias() { + return getSingleName(); +} + +} |