1// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
2
3package org.xbill.DNS;
4
5/**
6 * CNAME Record  - maps an alias to its real name
7 *
8 * @author Brian Wellington
9 */
10
11public class CNAMERecord extends SingleCompressedNameBase {
12
13private static final long serialVersionUID = -4020373886892538580L;
14
15CNAMERecord() {}
16
17Record
18getObject() {
19	return new CNAMERecord();
20}
21
22/**
23 * Creates a new CNAMERecord with the given data
24 * @param alias The name to which the CNAME alias points
25 */
26public
27CNAMERecord(Name name, int dclass, long ttl, Name alias) {
28	super(name, Type.CNAME, dclass, ttl, alias, "alias");
29}
30
31/**
32 * Gets the target of the CNAME Record
33 */
34public Name
35getTarget() {
36	return getSingleName();
37}
38
39/** Gets the alias specified by the CNAME Record */
40public Name
41getAlias() {
42	return getSingleName();
43}
44
45}
46