If you are using a Microsoft DNS server, when Double-Take failover occurs, DNS may or may not be automatically updated depending on your job type and job options. If the end-users use DNS to resolve server names and the source IP address was not failed over to the target, additional DNS updates will be required because the host records for the source will remain intact after failover. You can automate this process by scripting the DNS updates in the failover and failback scripts. You have two options for scripting the DNS updates.
DNS updates can be added to your failover and failback scripts by using the Windows DNSCMD command as long as dynamic updates are enabled on the DNS zone and the account running the Double-Take service is a member of the DNSAdmins security group. (See your Microsoft documentation to verify if dynamic updates are enabled.) You may want to disable the DNS registration feature of each IP address that is being changed in DNS to prevent the source from changing the record back when it comes online after a failover.
Add the following commands to your failover and failback scripts to delete the host and reverse lookup entries and add new entries associating the source to the target.
Use the following variable substitutions.
For example, suppose you had the following environment.
You would add the following to your failover script to delete the host and reverse lookup entries and add new entries associating the source to the target.
dnscmd DNSServer.domain.com /RecordDelete domain.com alpha A 192.168.1.108 /f dnscmd DNSServer.domain.com /RecordDelete 192.168.in-addr.arpa 108.1 PTR alpha.domain.com /f dnscmd DNSServer.domain.com /RecordAdd domain.com alpha A 116.123.2.47 dnscmd DNSServer.domain.com /RecordAdd 116.123.in-addr.arpa 47.2 PTR alpha.domain.com |
You would add the following to your failback script to delete the host and reverse lookup entries and add new entries associating the source with its original identity.
dnscmd DNSServer.domain.com /RecordDelete domain.com alpha A 116.123.2.47 /f dnscmd DNSServer.domain.com /RecordDelete 116.123.in-addr.arpa 47.2 PTR alpha.domain.com /f dnscmd DNSServer.domain.com /RecordAdd domain.com alpha A 192.168.1.108 dnscmd DNSServer.domain.com /RecordAdd 192.168.in-addr.arpa 108.1 PTR alpha.domain.com |
See your Windows documentation or the Microsoft web site for more details on the DNSCMD command.
DNS updates can be added to your failover and failback scripts by using the Double-Take DFO utility as long as the utility has been registered and the proper privileges are configured.
The DFO utility performs DNS resource record modifications by connecting to the DNS namespace (root\microsoftdns) on the DNS server using WMI. The WMI connection can be made using passed credentials or impersonation if the account running the DFO utility has permissions to perform all DNS-related activities. Passed credentials can be encrypted using Microsoft’s CAPICOM dynamic link library with DFO specifying the triple DES encryption algorithm with the maximum key length available (168). By providing reliable encryption, the DFO utility allows you to avoid storing secure passwords in script files.
If the source experiences a failure or an extended outage, clients will need to be redirected automatically to the target server. In these cases, the DFO utility can help make the network redirection portion of failover transparent to end users.
The DFO utility is able to modify five DNS resource record types: A, AAAA, CNAME, MX, and PTR. Here is how it works for the host record or A type.
Other record types require different queries and input parameters. Additionally, CNAME, MX, and PTR record types do not execute the Active Directory object locking routines that A and AAAA type records require for failover.
AAAA type—Except for the query difference, this record type is identical to the A type record.
SELECT * FROM MicrosoftDNS_AAAAType WHERE IPAddress=“21DA:D3:0:2F3B:2AA:FF:FE28:9C5A”
CNAME type—This type does not have Active Directory object locking to prevent updates during failover.
SELECT * from MicrosoftDNS_CNAMEType WHERE PrimaryName="sql1.doubletake.com”
MX type—This type does not have Active Directory object locking to prevent updates during failover.
SELECT * from MicrosoftDNS_MXType WHERE MailExchange="mail1.doubletake.com”
PTR type—Instead of modifying the source record, the PTR type deletes the source PTR record and create a new PTR record by using previous source PTR text record information, substituting the target FQDN for the source FQDN, and calling the CreateInstanceFromPropertyData() method on the DNS server. This type does not have Active Directory object locking to prevent updates during failover.
SELECT * from MicrosoftDNS_PTRType WHERE PTRDomainName="sql1.doubletake.com”
During failback, the same mechanisms that were used during failover are used, except that the original source-related records are modified to point to the original source. (During failover, the source records were modified to point to the target IP address or name, depending on the record type.) Also, during failover the A and AAAA type DNS resource records are modified in DNS and then locked in Active Directory; during failback, those record types are unlocked in Active Directory and then modified in DNS.
Add the appropriate DFO command to your failover script using the following syntax.
Command
DFO
Description
Used in scripts to failover DNS server name
Syntax
DFO [/DNSSRVNAME <dns_server_name>] [/SRCNAME <source_fqd_name>] [/SRCIP <source_ip>] [/TARIP <target_ip>] [/TARNAME <target_fqd_name>] [/RECORDTYPE <rec_type>] [/USERNAME <user_name>] [/PASSWORD <password>] [/DNSZONE <zone_name>] [/DNSDOMAIN <domain_name>] [/LOGFILE <file_name>] [/FAILBACK [fb_switch]] [/SETPASSWORD <user_name> <password>[machine][file]] [/GETPASSWORD] [/LOCK] [/UNLOCK] [/TRUSTEE [<trustee_name>]] [/VERBOSE] [/FLUSHDNS] [ /MACHINE <machine_fqd_name>] [/TTL <seconds>] [/ADDOMAIN <active_directory_domain_name>] [/SOURCEDN <source_domain_name>] [/TEST] [/DEBUG] [/HELP]
Options
Examples
Notes
All options are marked as optional, enclosed in brackets [ ], however, you will have to supply options to execute DFO functionality. The options to supply will depend on the functionality you are trying to complete. For example, you must supply the username and password to cache credentials, but you do not need those options to query or modify a DNS record.