01: // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: /**
06: * CNAME Record - maps an alias to its real name
07: *
08: * @author Brian Wellington
09: */
10:
11: public class CNAMERecord extends SingleCompressedNameBase {
12:
13: CNAMERecord() {
14: }
15:
16: Record getObject() {
17: return new CNAMERecord();
18: }
19:
20: /**
21: * Creates a new CNAMERecord with the given data
22: * @param alias The name to which the CNAME alias points
23: */
24: public CNAMERecord(Name name, int dclass, long ttl, Name alias) {
25: super (name, Type.CNAME, dclass, ttl, alias, "alias");
26: }
27:
28: /**
29: * Gets the target of the CNAME Record
30: */
31: public Name getTarget() {
32: return getSingleName();
33: }
34:
35: /** Gets the alias specified by the CNAME Record */
36: public Name getAlias() {
37: return getSingleName();
38: }
39:
40: }
|