Knowledge Base

|
Using the VMware vCenter Server Heartbeat Utility DNSUpdate.exe (DNS)
Purpose
This article describes using the VMware vCenter Server Heartbeat DNSUpdate.exe tool.
Resolution
Background
DNSUpdate runs each time a switchover or failover occurs. The DNSUpdate tool operates by first going to Active-Directory to get a list of all the DNS servers, then attempts to update the records for the protected server based on the command line arguments.
The following are the steps performed by DNSUpdate:
- Self-test (check that VMware vCenter Server Heartbeat is installed and the 3rd party tools are compatible).
- Get machine and environment identities.
- Get the list of Name Servers from Active Directory (if the -ns option is not used).
- For each Name Server check that it is contactable.
- For each contactable Name Server, identify if it is a Primary or Secondary (Slave) DNS.
- For each contactable Primary DNS extract the list of zones.
- For each IP Addresses that is to be removed:
- For each contactable Primary DNS that has a forward zone for the machine domain, attempt to remove the Forward record.
- For each contactable Primary DNS that has a reverse zone for the machine domain, attempt to remove the Reverse record.
- For each IP Addresses that is to be added:
- For each contactable Primary DNS that has a forward zone for the machine domain, attempt to add a Forward record.
- For each contactable Primary DNS that has a reverse zone for the machine domain, attempt to add a Reverse record.
- Update Secondary Servers.
For each contactable Secondary DNS request a Zone Refresh.
- Tidy up temporary storage.
The utility removes the A and PTR records for the protected server and replaces them with records for the new IP addresses. When it is run on a server, it checks the registry for the identity of the server. If it is running on the Primary server it removes the Secondary addresses, identified by -s switch and add the Primary addresses identified by the -p switch. When run on the VMware vCenter Server Heartbeat Secondary Server it does the reverse.
Enhanced Features:
-
The DNSUpdate tool can be run after initial install, as it handles DNS configurations that have changed since then.
-
Multiple IP addresses can be handled at the same time using multiple -s and/or -p.
-
The DNSUpdate.exe handles failures and continues to attempt to update the DNS servers even when a server is unavailable or when a specific zone update fails.
-
It has a self-test feature that checks that the system tools that it uses (dnscmd and ping) are compatible.
-
Can specify name servers (if required) rather than query Active Directory.
Procedure
Usage of V01.05.05
Note: With V01.05.05 ,the requirement to have a Domain Controller is lifted, a Domain Controller is not required if the Server (host) Name, Domain, and the Name Servers are passed in the command line.
DNSUpdate [-h] [-v] [-d] [-ci] [[-selftest] | [[-cc appName Domain Destination] -r ipaddress -a ipaddress [-ns ipaddress] -p ipaddress -s ipaddress [ -name compname] [ -domain domain]]
If no parameters are passed, a self-test runs.
General Parameters:
-h : Displays this usage information.
-v : Displays the version of this program.
-selftest : Self tests the program.
-d : Debug (traces the program).
-t time : Number of Seconds that the Address can be held.
-r ipaddress : Remove this IP address.
-a ipaddress : Add this IP address.
-cc appName Domain Output : Run as if NFDNS Scripter for the given App and Domain and put the script in Output.
-p ipaddress : This is a Primary IP address.
-s ipaddress : This is a Secondary IP address which address is removed/added is dependant on if the machine is the Primary or Secondary.
-ns : Specify the IP Addresses of the DNS’s that are to be updated.
-ci : This parameter is used to allow zone/domain matching when the case is different. For example WAN1.qa does not normally match wan1.qa, this parameter allows them to match.
-name compname : Name of the server.
-domain domain : Domain Name.
Return Codes
0: Success : This returns if there have not been any errors that can cause DNSUpdate to be unable to complete its calls of DNSCMD. If any of the DNSCMD calls fail or if there are no contactable Name Servers, the Success return code is returned. This is intentional to allow the known situations where the DNS topology is inconsistent and/or flawed.
-
Incorrect Usage
-
Invalid Parameters
-
Self-test error
-
Fatal Windows error
-
Incompatible DNSCMD.exe
-
Heartbeat not correctly installed
-
Invalid IP Address
-
Ran out of memory
-
No normal Zones on any DNS have had IP Address's added. This is returned when there has been no successful attempt to update a zone (not reverse zones).
-
Domain Controller cannot be contacted
With VMware vCenter Server Heartbeat V5.5
Checking whether there are secondary DNS servers in the infrastructure
When VMware vCenter Server Heartbeat is configured for a WAN during installation, VMware vCenter Server Heartbeat automatically creates the required DNSUpdate tasks under the Tasks tab of the VMware vCenter Server Heartbeat Console. If VMware vCenter Server Heartbeat is initially installed in a LAN and later stretched to WAN or problems are encountered when DNSUpdate executes, the DNSUpdate tasks must be created manually.
-
Determine detected Secondary servers using the DNSUpdate -d switch (the -d switch enables the debug mode) and look in the output for the below section:
UpdateSecondaries
Update secondary DNS servers -
If you see /zonerefresh commands on various DNS servers, you need to add Network Configuration tasks to both servers manually.
Creating a network configuration task that runs DNSUpdate in environments without secondary DNS servers
To create DNSUpdate tasks manually:
-
Launch VMware vCenter Server Heartbeat Console.
-
Click Application.
-
Click the Tasks tab.
-
Click User Accounts.
-
Click Add.
-
Enter the credentials for an account with rights to update the DNS (a member of the Administrators or Server Operators group on the target server).
-
Click OK, then Close.
-
Click Add to add a new task.
-
Provide a descriptive name for the Task.
-
Choose Network Configuration for Task type.
-
Select either Primary or Secondary for the server the task needs to run on as appropriate.
-
In the Command field, run the dnscmd command with appropriate flags as shown in the example.
-
In the Run As field choose the user appropriate user account from the drop down and click OK.
Note: The DNSUpdate tool detects if it is being run on Primary or Secondary server by checking the registry.
For example, Dnsupdate -p <primary public IP address> -s secondary public IP address>
Creating a network configuration task that runs DNSUpdate in environments with secondary DNS servers
To create DNSUpdate tasks manually:
-
Launch the VMware vCenter Server Heartbeat Console.
-
Click on the Application.
-
Click Tasks.
-
Click User Accounts.
-
Click Add.
-
Enter the credentials for an account with rights to update the DNS (a member of the Administrators or Server Operators group on the target server).
-
Click OK, then Close.
-
Click Add to add a new task.
-
Provide a descriptive name for the Task.
-
Choose Network Configuration for Task type.
-
Select either Primary or Secondary for the server the task needs to run on as appropriate.
-
In the Command field, run the dnscmd command with appropriate flags as shown in the example.
-
In the Run As field select the user appropriate user account from the drop down and click OK.
Note: To simplify the DNS update process, a batch file can be created to include all dnscmd instances, then a single network configuration task can be configured to run newly created batch files.
Example: Add the following 4 commands as separate Network Configuration tasks in the sequence listed for each detected Secondary DNS server replacing {…} with the appropriate value:
dnscmd {DNS server IP} /RecordDelete {fqdn} {netbios machine name} A {machine IP to remove} /f
dnscmd {DNS server IP} /RecordDelete {reverse zone name} {server IP truncated} PTR {fully qualified machine name} /f
dnscmd {DNS server IP} /RecordAdd {fqdn} {netbios machine name} {TTL} A {machine IP to add}
dnscmd {DNS server IP} /RecordAdd {reverse zone name} {server IP truncated} {TTL} PTR {fully qualified machine name}
DNSCMD Calls
-
/RecordAdd - Used to add both Forward (A) and Reverse (PTR) records.
-
/RecordDelete - Used to remove both Forward (A) and Reverse (PTR) records.
-
/Zonerefresh - Used to instruct a Secondary (Slave) DNS to refresh its zones.
-
-? - Used to extract the usage of DNSCMD so that its compatibility can be determined.
-
/EnumZones - Used to retrieve the list of zones.
-
/Info IsSlave - Used to identify Secondary (Slave) DNS’s.
Additional Information
Request a Product Feature
- KB Article:
- Updated:
- Categories:
- Product Family:
- Products:
- Product Versions:

