Creating a DNS A Record Using the PowerShell Commands

Create a floating CommServe name before setting up the production and standby CommServe hosts for a CommServe Failover configuration.

This can done by creating a DNS A record in the DNS server with a virtual host name and IP address of the active CommServe host.

Use the following step to create an A Record in Windows 2012 Server. For Windows 2008 Server, refer to Creating a DNS A Record Using the DNS Commands .

Before You Begin

  • Use an account with full permissions to create and delete A records in the DNS Server for the floating CommServe name.

  • Enable DNS Server Tools.

  • Obtain the virtual / floating host name and IP address for the active CommServe host.

  • In addition, also obtain the computer name of the DNS Server .

  • If the CommServe host is not on the same domain as the DNS server, enable dynamic updates on the DNS controller using the following command:

    dnscmd.exe /Config myrootdns.com /AllowUpdate 1

    where, myrootdns is the primary DNS zone.

  • If you have multiple NICs, determine the IP address that must be used for populating the Floating CommServe name.

Procedure

To add an A record on the Domain Name Server, at the Windows PowerShell command prompt, type the following command:

Powershell.exe Add-DnsServerResourceRecordA [-Name] <String> [-ComputerName] <String> [-ZoneName] <String> -AllowUpdateAny <IPAddress[]> [-TimeToLive] <TimeSpan>

Where:

  • Name - Specifies a virtual / floating host name.

  • ComputerName - Specifies a DNS Server. If you do not specify this parameter the command runs on local system.

  • ZoneName - Specifies the name of DNS Zone (generally primary DNS zone since it is A record).

  • AllowUpdateAny - Indicates that any authenticated user can update the resource record that has the same owner name.

  • IPAddress - Specifies the IPV4 Address for A record of the active CommServe host.

  • TimeToLive - Specifies the Time to Live (TTL) value in seconds, (generally this is the time taken by other DNS servers to cache the record and to use it).

Note

Generally entities present in forward lookup zone are called A records, and entities present in reverse lookup zone are called as PTR Records.

Refer to Microsoft documentation for more information on these commands.

Example

For adding a record:

powershell.exe "Add-DnsServerResourceRecordA -Name " machinename " -ComputerName " 111.11.11.111 " -ZoneName " testcs.company.com " -AllowUpdateAny -IPv4Address " 111.11.10.110 " -TimeToLive " 00:00:10

For removing a record

Powershell.exe “Remove-DnsServerResourceRecord -Force -Name " advanced "-ZoneName" testcs.company.com "-ComputerName" 111.11.10.110 " –RRType” A

Where:

  • Force - Removes a Record Without prompting user for confirmation, If we do not specify this the cmdlet will prompt the user for confirmation

  • Name - specifies a virtual / floating host name.

  • ZoneName - Specifies the name of DNS Zone (generally primary DNS zone since it is A record).

  • Computer Name - Specifies a DNS Server. If you do not specify this parameter the command runs on local system.

  • RRType - Specifies the Type of Resource Record:

What To Do Next

  • To make sure that the CommServe hosts use the new DNS record added above, run the ipconfig/flushdns command from the command line.

  • Make sure that the floating CommServe name is resolvable from both the production and standby CommServe hosts, using the "ping" or any other name resolution commands / tools.

  • If you have multiple NICs, make sure that the Floating CommServe name resolves to the correct IP.

Loading...