Compartilhar via


Add an Alias (CNAME) Resource Record to a Zone

Applies To: Windows Server 2008

Alias (CNAME) resource records are also sometimes called canonical name resource records. With these records, you can use more than one name to point to a single host, making it easy to do such things as host both a File Transfer Protocol (FTP) server and a Web server on the same computer. For example, the well-known server names (ftp, www) are registered using alias (CNAME) resource records that map to the Domain Name System (DNS) host name, such as server-1, for the server computer that hosts these services.

Membership in the Administrators group, or equivalent, is the minimum required to complete this procedure. Review details about using the appropriate accounts and group memberships at Local and Domain Default Groups (https://go.microsoft.com/fwlink/?LinkId=83477).

Adding an alias (CNAME) resource record to a zone

  • Using the Windows interface

  • Using a command line

To add an alias (CNAME) resource record to a zone using the Windows interface

  1. Open DNS Manager.

  2. In the console tree, right-click the applicable forward lookup zone, and then click New Alias.

  3. In Alias name, type the alias name.

  4. In Fully qualified domain name (FQDN) for target host, type the FQDN of the DNS host computer for which this alias is to be used.

    As an option, you can click Browse to search the DNS namespace for hosts in this domain that have host (A) resource records already defined.

  5. Click OK to add the new record to the zone.

Additional considerations

  • To open DNS Manager, click Start, point to Administrative Tools, and then click DNS.

To add an alias (CNAME) resource record to a zone using a command line

  1. Open a command prompt.

  2. Type the following command, and then press ENTER:

    dnscmd <ServerName>/RecordAdd <ZoneName> <NodeName> [/Aging] [/OpenAcl] [<Ttl>] CNAME <HostName>|<DomainName>

Parameter Description

dnscmd

The command-line tool for managing DNS servers.

<ServerName>

Required. Specifies the DNS host name of the DNS server. You can also type the IP address of the DNS server. To specify the DNS server on the local computer, you can also type a period (.)

/RecordAdd

Required. Adds a new resource record.

<ZoneName>

Required. Specifies the name of the zone where this alias (CNAME) resource record will be added.

<NodeName>

Required. Specifies the FQDN of the node in the DNS namespace. You can also type the node name relative to the ZoneName or @, which specifies the zone's root node.

/Aging

Specifies that this resource record is aged and scavenged. If this parameter is not used, the resource record remains in the DNS database unless it is manually updated or removed.

/OpenAcl

Specifies that new records are open to modification by any user. Without this parameter, only administrators may modify the new record.

<Ttl>

Specifies the Time To Live (TTL) setting for the resource record. (The default TTL is defined in the start of authority (SOA) resource record.)

CNAME

Required. Specifies the resource record type of the record that you are adding.

<HostName>|<DomainName>

Required. Specifies the FQDN of any valid DNS host or domain name in the namespace. For FQDNs, a trailing period (.) is used to fully qualify the name.

To view the complete syntax for this command, at a command prompt, type the following command, and then press ENTER:

dnscmd /RecordAdd /help 

Additional considerations

  • To open an elevated Command Prompt window, click Start, point to All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.