A hybrid cloud DNS management and failover method
By building a unified API interface and local database to manage the DNS configuration data of multiple cloud platforms, the data inconsistency and fault switching problems between multi-cloud platforms are solved, and efficient DNS configuration data management and rapid fault recovery are achieved.
Patent Information
- Application Number
- CN202211654213.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-12-22
AI Technical Summary
Existing technologies cannot effectively manage DNS configuration data backup and fault switching between multiple cloud service provider platforms, resulting in inconsistency issues when exporting and importing data, and cannot quickly respond to DNS service switching when a cloud service provider platform fails.
Build a unified API interface to obtain DNS configuration data of different cloud platforms, store it centrally in the local database, and establish a resolution line mapping relationship through regular data detection and backup mechanisms to achieve automatic conversion and fault switching of data between different cloud platforms.
It achieves unified management and fault switching of DNS configuration data on multiple cloud platforms, reduces manual operation processes, simplifies data import difficulty, and ensures data consistency and rapid fault response.
Smart Images

Figure CN115987944B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of DNS management, and in particular relates to a management and fault switching method for a hybrid cloud DNS. Background Art
[0002] DNS, or Domain Name System (DNS), is an Internet service. As a distributed database that maps domain names and IP addresses to each other, it enables people to access the Internet more conveniently. With the development of cloud computing, cloud service providers have provided a wide variety of services to meet the requirements of more and more users. Many users have gradually migrated their IT infrastructure to the cloud, and DNS service is one of them. Since users can purchase domain names directly from cloud service providers, these cloud service providers provide free domain name resolution services. At the same time, in order to meet the domain name resolution needs of different scenarios, cloud service providers provide different types of resolution records. The most common ones include A records, CNAME records, MX records, TXT records, NS records, and SRV records.
[0003] Internet companies typically own multiple platforms and domain names. They host domain name resolution configuration on various cloud service providers' platforms. However, the lack of connectivity between these platforms makes unified domain name operation and maintenance difficult. Furthermore, as cloud service providers add more and more users to their platforms, the DNS configuration data recorded by the platforms and the domain name resolution tasks undertaken by DNS servers become increasingly burdensome. This undoubtedly increases the likelihood of failure of the public DNS servers provided by cloud service providers. Therefore, it is crucial to implement DNS configuration data backup and failover across multiple cloud service provider platforms.
[0004] Currently, due to commercial interests and other factors, the DNS services provided by various cloud service providers' platforms can only set domain names to DNS servers under the cloud service provider's name. To back up and migrate DNS configuration data between multiple clouds, it is necessary to first export it from the cloud service provider's platform and then manually import it to another cloud service provider's platform. In the long run, this import method is not suitable for enterprises that need to maintain multiple domain names, and it cannot guarantee the consistency of data during export and import. In addition, different cloud service providers' platforms have inconsistent definitions of DNS configuration information, which increases the difficulty and complexity of data import. Most typically, when configuring DNS, Alibaba Cloud defines foreign DNS resolution routes as "overseas", while Tencent Cloud defines foreign DNS resolution routes as "outside the country". When importing data between different platforms, the different definition names make it impossible to efficiently complete data backup between platforms. Even worse, when a cloud service provider's platform fails, it is impossible to quickly switch the DNS service to another cloud platform.
[0005] The existing technology has proposed a related domain name switching method for solving API switching calls in a multi-computer room environment. The domain name-based API switching call needs to obtain a complete domain name list of all service providers, and call all domain name lists in advance to determine the connectivity of the domain name. The first connected domain name is obtained as the switching domain name, so that when there is a problem with the domain name, the switching is prepared, reducing the modification of the domain name mapping of the DNS server. However, this is only applicable to the problem domain name switching of one service provider, and cannot provide a basis for DNS resolution switching between multiple cloud platforms.
[0006] The existing technology also proposes a DNS service switching method, which is based on the DNS server availability and service quality score to ensure that when the DNS server availability and score are low, it is switched to a DNS server with a high score; however, for users who use cloud platform resolution services, the operating data of the DNS server cannot be obtained from the cloud platform; for users who use multiple cloud platform services, a low-cost and more convenient way is needed to manage DNS resolution data and complete DNS service switching.
[0007] The patent "DNS Management System" (application number: 202111554323.1) provides a DNS management system that includes a DNS management platform, a DNS server, and a DNS client. By using the DNS management platform to uniformly store and manage domain name resolution records, it can achieve efficient and standardized management of DNS servers, realize convenient management resolution needs, and ensure enterprise information security. However, only through a unified management tool to manage the storage and changes of DNS resolution data locally on the DNS server, the DNS resolution data is still retained on the platforms of each cloud service provider, and it cannot solve the problems of DNS configuration data backup, detection, and troubleshooting between multiple cloud service provider platforms. Summary of the Invention
[0008] To solve the existing technical problems, the present invention constructs a unified API interface that adapts to the APIs of different cloud platforms, obtains and centrally stores DNS configuration data distributed on different cloud platforms, and performs regular data anomaly detection and backup of DNS configuration data on different cloud platforms based on the stored DNS configuration data, thereby achieving timely discovery of abnormal and inconsistent data, and ensuring that when the DNS service fails, the DNS service is switched in time according to the backup data to ensure uninterrupted DNS service.
[0009] The technical solution of the present invention is as follows: a hybrid cloud DNS management and failover method, specifically comprising the following steps:
[0010] Step 1: Build a unified API interface to obtain DNS configuration data from more than one cloud platform, and store the DNS configuration data in a local database. The cloud platform is a cloud service provider that provides domain name resolution services. The cloud platform has a data table for storing DNS configuration data. The DNS configuration data includes a domain name and a domain name resolution record corresponding to the domain name. The domain name resolution record includes a host record value, a resolution record type, a resolution record value, and a resolution route name. The specific steps include:
[0011] Step 1-1: The local database sets up an account table, a domain name table, a resolution record table, and a resolution line table respectively; the table fields of the account table include the platform name, login account, and password; the login account and password are obtained from the account table and passed to the unified API interface, the unified API interface is called to access the data table of the cloud platform, the DNS configuration data is obtained from the data table of the cloud platform and stored in the domain name table, resolution record table, and resolution line table in sequence; the unified API interface integrates DNS operations, including obtaining, adding, deleting, and updating DNS configuration data
[0012] The table fields of the domain name table include platform name, domain name, data detection status and a marker. The values of the marker include primary and backup, which are used to mark the primary cloud platform and backup cloud platform corresponding to the domain name. The data detection status is used to record the data detection results, including normal and abnormal.
[0013] The table fields of the resolution record table include: platform name, domain name, domain name resolution record, and data detection status;
[0014] The table fields of the parsed line table include: platform name, parsed line name, standard name; the standard name is a uniformly defined parsed line name;
[0015] Step 1-2: Establish a mapping relationship between different cloud platforms. Obtain the name of each cloud platform's resolution line from the resolution line table, filter out the resolution line names that identify the same type of resolution line on different platforms, and establish a corresponding relationship between the resolution line names. Specifically, establish a mutual mapping relationship between resolution line names that belong to the same standard name. Step 2: Back up DNS configuration data: Select a cloud platform for data backup, obtain the DNS configuration data to be backed up from the local database, and after resolution line conversion, use the unified API interface to store the DNS configuration data in the cloud platform.
[0016] Step 3: Modify DNS configuration data: Obtain the DNS configuration data to be changed and the change type. Based on the DNS configuration data, retrieve the platform names of the primary and backup cloud platforms from the domain name table. Use the unified API interface to access the primary and backup cloud platforms based on the cloud platform login account and password recorded in the account table. Execute the DNS configuration data changes for the local database, primary and backup cloud platforms according to the change type.
[0017] Step 4: DNS fault switching: Replace the DNS configuration data in the faulty cloud platform with the DNS configuration data of the backup cloud platform; specifically: obtain the domain name where the DNS resolution failure occurs and the cloud platform where the domain name is located; based on the domain name and backup identifier, obtain the platform name corresponding to the domain name with the backup identifier value as backup from the domain name table, and record it as the platform name of the backup cloud platform; obtain the login account and password corresponding to the platform name from the account table, and use the unified API interface to access the backup platform; obtain the DNS server address provided by the backup platform; call the unified API interface, access the cloud platform where the failure is located, and modify the DNS server address of the faulty cloud platform to the DNS server address of the backup platform.
[0018] In the step 1, by comparing the domain name resolution records between the local database and the cloud platform, whether there is any abnormality in the DNS configuration data of the cloud platform is detected, specifically: using a unified API interface to access the data table of the cloud platform to obtain DNS configuration data; comparing the domain name resolution records in the DNS configuration data with the domain name resolution records in the resolution record table; after comparison, obtaining inconsistent domain name resolution records and storage locations, and storing inconsistent domain name resolution records in the abnormal data table; if the storage location of the inconsistent domain name resolution record is in the resolution record table, the abnormality type is recorded as missing resolution record on the cloud, and in the resolution record table, the data detection status corresponding to the inconsistent resolution record is updated to abnormal; if the storage location of the inconsistent domain name resolution record is in the data table of the cloud platform, the abnormality type is recorded as extra resolution record on the cloud.
[0019] The step 2 specifically includes:
[0020] Step 2-1: Based on the domain name in the DNS configuration data, obtain the domain name resolution record corresponding to the domain name from the resolution record table; store the domain name and the domain name resolution record as copied data in a temporary data table; compare the obtained domain name resolution record with the domain name resolution record in the copied data; if the comparison is inconsistent, the copy is wrong; if the comparison is consistent, execute step 2-3; the temporary data table also records the primary platform name, backup platform name and corresponding identifiers of the copied data;
[0021] Step 2-2: Obtain the resolution line name from the domain name resolution record in the copied data. Based on the primary platform name, the resolution line name, and the backup platform name, search the resolution line mapping relationship in step 1 to see if there is a matching resolution line name for the backup platform. If so, replace the resolution line name in the copied data with the matching resolution line name.
[0022] Step 2-3: Based on the backup platform name, obtain the backup platform login account and password from the account table, call the unified API interface to access the backup platform's data table, and write the copied data into the backup platform's data table; at the same time, write the copied data and the backup platform name into the resolution record table; obtain the backup platform name, domain name, and identifier from the temporary data table and write them into the domain name table;
[0023] Step 2-4: By comparing the domain name resolution records of the cloud platform, determine whether there is any abnormality in the DNS configuration data of the backup cloud platform, specifically: use the unified API interface to access the data tables of the main cloud platform and the backup cloud platform respectively, obtain the domain name resolution record of the DNS configuration data from the data table, compare the domain name resolution record of the backup cloud platform with the domain name resolution record of the main cloud platform, obtain inconsistent domain name resolution records and storage locations, and write inconsistent domain name resolution records into the abnormal data table; if the storage location is in the data table of the main cloud platform, the abnormality type is recorded as the backup cloud platform missing resolution record; if the storage location is in the data table of the backup cloud platform, the abnormality type is recorded as the backup cloud platform having extra resolution records; in the resolution record table, update the data detection status corresponding to the domain name resolution record to abnormal.
[0024] In the abnormal data detection of step 1 and step 2, the domain name resolution record comparison is automatically performed by starting the end-of-day script program every day; when the end-of-day script program obtains the resolution record from the data table of the cloud platform, the resolution record is stored in a temporary table of a Map structure, where the key value is the domain name and the value value is the domain name resolution record.
[0025] The step 3 specifically includes:
[0026] Step 3-1: Obtain the domain name and domain name resolution record of the DNS configuration data to be changed; obtain the change type, which includes adding a resolution record and deleting a resolution record;
[0027] Step 3-2: Obtain the primary cloud platform and backup cloud platform of the DNS configuration data according to the identifier in the domain name table: In the domain name table of the local database, obtain the corresponding platform name as the primary platform name or the backup platform name according to the domain name and the identifier value;
[0028] Step 3-3: Perform a change operation in the domain name resolution record table: If the change type is addition, write the domain name, the domain name resolution record in step 3-1, and the platform name in step 3-2 into the domain name resolution record table; if the change type is deletion, retrieve the corresponding record based on the domain name and the domain name resolution record and delete it;
[0029] Step 3-4: Perform change operations on the primary and backup platforms: According to the name of the primary platform, obtain the corresponding login account and password from the account table, use the unified API interface to access the data table of the primary platform, follow the change operation of the local domain name resolution record in step 3-3, and perform the DNS configuration data change in the primary platform according to the change type; according to the name of the backup platform, obtain the corresponding login account and password from the account table, use the unified API interface to access the data table of the backup platform, follow the change operation of the local domain name resolution record in step 3-3, and perform the DNS configuration data change in the backup platform according to the change type.
[0030] In step 3, the change content and change type are recorded in a change application form; the change application information includes the domain name, resolution record, change type, application status, applicant reviewer, application time, and review time; the application form status is used to record the progress of the change application, including pending review, approved review, successful change, and failed change; for change applications with an application status of pending review and failed change, the administrator is reminded to handle them.
[0031] Compared with the prior art, the technical effects of the present invention are:
[0032] 1) This invention integrates DNS operations with a unified API interface, uses the unified API to access the data tables of each cloud platform, and performs operations on the DNS configuration data within the platform. By extracting the DNS configuration data of each platform and storing it in a local database, supplemented by regular data detection between the local and cloud platforms, it can achieve the management and tracking of DNS configuration data of multiple cloud platforms.
[0033] 2) By establishing a mapping relationship between different platforms, the present invention automatically converts the backed-up DNS configuration data into a resolution path recognizable by the backup platform when backing up the DNS configuration data, and stores it in the backup platform. This reduces the tedious manual export and import process, and also reduces the difficulty and complexity of importing backup data into different cloud platforms. At the same time, regular data detection between the primary and backup cloud platforms ensures that data inconsistencies are discovered in a timely manner.
[0034] 3) The present invention stores the DNS configuration data of the main platform in the backup platform in advance. When processing a domain name resolution failure, the DNS server address of the main platform is modified to the DNS server address of the backup platform, thereby achieving rapid switching of the faulty platform and rapid recovery of the domain name resolution failure.
[0035] 4) The present invention streamlines the DNS configuration data change process by recording various states of the DNS configuration data change process, thereby enabling the historical status of the DNS configuration data change to be traced, which is beneficial to the unified configuration and management record of the DNS configuration data change operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a hybrid cloud DNS management and failover method according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of a hybrid cloud DNS resolution line mapping relationship table according to an embodiment of the present invention is shown;
[0038] Figure 3 FIG2 is a schematic diagram of a backup process of DNS configuration data of a hybrid cloud according to an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram of a change application form for adding DNS configuration data in an embodiment of the present invention;
[0040] Figure 5 This is a flow chart of changing DNS configuration data in a hybrid cloud according to an embodiment of the present invention;
[0041] Figure 6 The figure is a schematic diagram of the deployment structure of a hybrid cloud DNS management and failover system in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to solve many technical problems existing in reality, the present invention provides a hybrid cloud DNS management and failover method. In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Figure 1 This is a flow chart of a hybrid cloud DNS management and failover method according to an embodiment of the present invention. The specific process includes:
[0044] Step: 101: Construct a unified API interface to obtain DNS configuration data of each cloud platform, and centrally store the DNS configuration data in a local database; the cloud platform is a cloud service provider that provides domain name resolution services, and a data table for storing DNS configuration data is provided in the cloud platform; the DNS configuration data includes a domain name and a domain name resolution record corresponding to the domain name; the domain name resolution record includes a host record value, a resolution record type, a resolution record value, and a resolution route name; the unified API interface integrates DNS operations and can call the cloud platform's own API by obtaining a cloud platform login account, thereby accessing the cloud platform; the DNS operations include obtaining, adding, deleting, and updating DNS configuration data; step 1 specifically includes:
[0045] Step 101-1: The local database is configured with an account table, a domain name table, a resolution record table, and a resolution line table. The account table stores the cloud platform login account, and the table fields include the cloud platform name login account and password. The login account and password are obtained from the account table and transmitted to a unified API interface. The unified API interface is called to access the cloud platform's data table. DNS configuration data is obtained from the data table and stored in the domain name table, resolution record table, and resolution line table in sequence.
[0046] The table fields of the domain name table include the cloud platform name, domain name, data detection status, and primary / backup identifier; the data detection status is used to record the data detection results, including normal and abnormal; the primary / backup identifier is used to distinguish whether the cloud platform corresponding to the domain name is a backup platform, and the value of the primary / backup identifier includes primary and backup; if the value of the primary / backup identifier is backup, the cloud platform corresponding to the domain name is a backup platform; otherwise, the corresponding cloud platform is the primary platform; the table fields of the resolution record table include the cloud platform name, domain name, domain name resolution record, and data detection status; the table fields of the resolution line table include the cloud platform name, resolution line name, and standard name; the standard name is a uniformly defined resolution line name.
[0047] In an embodiment of the present invention, a standard name is defined according to the parsed line type. For example, the China Unicom type and the European type are uniformly parsed as China Telecom and Europe, respectively. When the parsed line name obtained from the cloud platform is stored in the mapping relationship record table, the standard name is assigned as shown in the following table:
[0048] Platform Name Resolve line name Standard Name Alibaba Cloud China Unicom China Unicom Tencent Cloud China Unicom China Unicom NetEase Cloud China Unicom China Unicom Alibaba Cloud Overseas_Europe Europe Tencent Cloud Europe Europe NetEase Cloud Europe Europe
[0049] Step 101-2: Establish a mapping relationship between resolution lines of different cloud platforms; obtain the resolution line name of each cloud platform from the resolution line table, screen the resolution line names of different platforms that identify the same type of resolution line, and establish a corresponding relationship between the resolution line names; specifically: use the resolution line relationship table to record the mapping relationship between the cloud platform resolution line names and standard names, the resolution line mapping table includes standard names and comparison relationships; write the resolution line names belonging to the same standard name into the comparison relationship corresponding to the standard name, so as to realize the recording of the mutual mapping relationship between the resolution line names of different cloud platforms.
[0050] like Figure 2 The diagram shows a table of resolution line mapping relationships for a hybrid cloud DNS in an embodiment of the present invention. In this embodiment of the present invention, taking the resolution line type "China Unicom" as an example, the name of the resolution line defined in the Alibaba Cloud platform is China Unicom, the name of the resolution line defined in the Tencent Cloud platform is China Unicom, and the name of the resolution line defined in the NetEase Cloud platform is China Unicom. Since the standard name of the China Unicom resolution line of Alibaba Cloud, the China Unicom resolution line of Tencent Cloud, and the China Unicom resolution line of NetEase Cloud is China Unicom, the China Unicom resolution lines of the three platforms are mutually mapped. Different cloud service providers have different definitions of the same type of resolution line, which increases the difficulty and complexity of data import. The present invention establishes a resolution line mapping relationship between different platforms. When backing up DNS configuration data, the backed-up DNS configuration data is automatically converted into a resolution line that can be identified by the backup platform and stored in the backup platform. This reduces the tedious process of manual export and import, and also reduces the difficulty and complexity of importing backup data into different cloud platforms.
[0051] Step 102: By comparing the domain name resolution records between the local database and the cloud platform, whether there is any abnormality in the DNS configuration data of the cloud platform is detected, specifically: using a unified API interface to access the data table of the cloud platform to obtain DNS configuration data; comparing the resolution records in the DNS configuration data with the domain name resolution records in the resolution record table; after comparison, obtaining inconsistent domain name resolution records and storage locations, and storing the inconsistent domain name resolution records in an abnormal data table; if the storage location of the inconsistent domain name resolution record is in the resolution record table, the abnormality type is recorded as missing resolution record on the cloud, and in the resolution record table, the data detection status corresponding to the inconsistent resolution record is updated to abnormal; the data detection status corresponding to other consistent resolution records is normal; if the storage location of the inconsistent domain name resolution record is in the data table of the cloud platform, the abnormality type is recorded as extra resolution record on the cloud; the table fields of the abnormal data table include domain name, domain name resolution record, detection time and abnormality type; the abnormal data table is pushed to the front-end visual interface;
[0052] The detection in step 102 is to automatically perform a comparison of domain name resolution records by starting a daily end-of-day script program; the daily end-of-day script program checkRecLocalAndCldByRecIds obtains DNS configuration data from the cloud platform data table and stores it in a temporary table "cldDomain" of a Map structure. In the Map structure, the Key value is the domain name and the Value value is the domain name resolution record; the domain name resolution record in the temporary table "cldDomain" is compared with the domain name resolution record in the local database. The code of the daily end-of-day script program is as follows:
[0053]
[0054]
[0055]
[0056] Step 103: Back up the DNS configuration data in the data table of the backup platform, such as Figure 3 The figure shows a schematic diagram of a hybrid cloud DNS configuration data backup process according to an embodiment of the present invention, and the specific steps include:
[0057] Step 103-1: Obtain DNS configuration data to be backed up and a cloud platform for backup; obtain a domain name resolution record corresponding to the domain name from a resolution record table based on the domain name in the DNS configuration data; store the domain name and the domain name resolution record as copied data in a temporary data table; compare the domain name resolution record obtained from the resolution record table with the domain name resolution record in the copied data; if the comparison is inconsistent, a copy error occurs;
[0058] The temporary data table also records the primary platform name, backup platform name, and primary / backup identifier of the copied data; the primary platform name is used to identify the cloud platform from which the copied data originated, and the backup platform name is used to identify the cloud platform on which the copied data is backed up;
[0059] Step 103-2: Convert the resolved line name into a name recognizable by the backup platform; obtain the resolved line name from the domain name resolution record in the copied data, and search the resolved line mapping relationship in step 1 for a matching resolved line name for the backup platform based on the primary platform name, the resolved line name, and the backup platform name; if so, replace the resolved line name in the copied data with the matching resolved line name;
[0060] Step 103-3: Access the backup platform's data table and write the DNS configuration data to be backed up; based on the backup platform name, obtain the backup platform's login account and password from the account table, call the unified API interface to access the backup platform's data table, and write the copied data into the backup platform's data table; at the same time, write the copied data and the backup platform name into the resolution record table; obtain the backup platform name, domain name, and primary / backup identifier from the temporary data table and write them into the domain name table;
[0061] Step 104: By comparing the domain name resolution records of the primary and backup cloud platforms, determine whether there is an abnormality in the DNS configuration data of the backup platform, specifically: use a unified API interface to access the data tables of the primary and backup platforms respectively, obtain the domain name resolution record of the DNS configuration data from the data tables, compare the domain name resolution record of the backup platform with the domain name resolution record of the primary platform, obtain inconsistent domain name resolution records and storage locations, and write the inconsistent domain name resolution records into the abnormal data table; if the storage location is in the data table of the primary platform, the abnormality type is recorded as a missing resolution record of the backup platform; if the storage location is in the data table of the backup platform, the abnormality type is recorded as an extra resolution record of the backup platform; in the resolution record table, update the data detection status corresponding to the domain name resolution record to abnormal; the table fields of the abnormal data table include domain name, domain name resolution record, detection time and abnormality type; the abnormal data table is pushed to the visual interface of the front end;
[0062] The abnormal data detection in step 104 is to automatically perform domain name resolution record comparison by starting a daily end-of-day script program; in an embodiment of the present invention, the detection program of checkAndCompareMasterAndBackupRec($master,$backup) is started, and DNS configuration data is obtained from the data tables of the master platform and the backup platform, and stored in a temporary table "CldDomain" of a Map structure, respectively, recorded as $master and $backup, and the domain name resolution record comparison in $master and $backup is performed.
[0063]
[0064]
[0065] Step 105: Modify the DNS configuration data according to the change application form, and track the change progress according to the status of the change application form; obtain the changed DNS configuration data and change type through the change application form; the change application form contains the domain name, resolution record, change type, application status, applicant reviewer, application time, review time, etc. Figure 4A schematic diagram of a change application form for adding DNS configuration data in an embodiment of the present invention; the application form status is used to record the progress of the change application, including pending review, approved, change successful, and change failed; for change applications with the pending review and change failed status, the administrator is reminded to handle the change application;
[0066] like Figure 5 This is a flow chart of changing DNS configuration data in a hybrid cloud according to an embodiment of the present invention. The specific steps include:
[0067] Step 105-1: Obtain the DNS configuration data to be changed and the change type from the change request form; extract the domain name and resolution record from the DNS configuration data; obtain the change type, which includes adding a resolution record and deleting a resolution record;
[0068] Step 105-2: Obtain the primary and backup platforms of the DNS configuration data based on the primary / backup identifier in the domain name table: Search and obtain the data record containing the domain name in the domain name table of the local database; for each retrieved data record, obtain the primary / backup identifier in the data record; if the primary / backup identifier is primary, obtain the cloud platform name of the primary platform from the data record; if the primary / backup identifier is backup, obtain the cloud platform name of the backup platform from the data record;
[0069] Step 105-3: Perform addition and deletion operations in the domain name resolution record table according to the change type: if the change type is addition, write the DNS configuration data to be changed and the obtained cloud platform name into the domain name resolution record table; if the change type is deletion, retrieve the corresponding data record based on the DNS configuration data; and clear the data record;
[0070] Step 105-4: Perform add and delete operations in the data tables of the primary and backup platforms according to the change type:
[0071] According to the cloud platform name of the primary platform, the corresponding login account is obtained from the account table, and the unified API interface is used to access the data table of the primary platform. According to the change method of the local domain name resolution record in step 105-3, the DNS configuration data in the data table is changed according to the change type; according to the cloud platform name of the backup platform, the corresponding login account is obtained from the account table, and the unified API interface is used to access the data table of the backup platform. According to the change method of the local domain name resolution record in step 105-3, the DNS configuration data in the data table is changed according to the change type;
[0072] Step 106: Modify the DNS server address of the faulty cloud platform and implement DNS fault switching: obtain the domain name where the DNS resolution failure occurs and the cloud platform where the domain name is located; based on the domain name and backup identifier, obtain the cloud platform name corresponding to the domain name with the backup identifier as "backup" from the domain name table, and record it as the cloud platform name of the backup platform; obtain the login account and password corresponding to the cloud platform name from the account table, and use the unified API interface to access the backup platform; obtain the DNS server address provided by the backup platform; call the unified API interface to access the cloud platform where the failure occurs, and modify the DNS server address of the cloud platform with the failure to the DNS server address of the backup platform.
[0073] Figure 6 This is a schematic diagram of the deployment structure of a hybrid cloud DNS management and failover system in an embodiment of the present invention, specifically including a cloud platform, a unified API interface, a DNS management system, and a local database connected in sequence; the number of the cloud platforms is no less than two, such as the Alibaba Cloud platform, Tencent Cloud platform, and Wangsu Cloud platform in the embodiment of the present invention; the cloud platform has data tables that store DNS configuration data, such as a domain name table and a resolution record table; the unified API interface aggregates DNS operations and can access each cloud platform by obtaining a login account for the cloud platform; the functional modules of the DNS management system include a DNS configuration data management module, a data detection module, a DNS configuration data change module, and a fault handling module;
[0074] The DNS configuration data management module is used to obtain the DNS configuration data of each cloud platform and store it in a local database, and store the DNS configuration data in each data table according to the table fields of the data table of the local database;
[0075] The data detection module is used to start the end-of-day script program, perform consistency comparison of DNS configuration data between the local database and the cloud platform, and perform consistency comparison of DNS configuration data between the primary platform and the backup platform;
[0076] The DNS configuration data change module is used to obtain the DNS configuration data to be changed and the change type through the change application form, execute the DNS configuration data change in the local database, the primary platform and the backup platform according to the change type, and follow up the change progress in real time;
[0077] The fault handling module is used to locate and obtain the domain name and cloud platform where the resolution failure occurs, and to modify the DNS server address of the primary platform to the DNS server address of the backup platform.
[0078] Compared with the prior art, the technical effects of the present invention are:
[0079] 1) This invention integrates DNS operations with a unified API interface, uses the unified API to access the data tables of each cloud platform, and performs operations on the DNS configuration data within the platform. By extracting the DNS configuration data of each platform and storing it in a local database, supplemented by regular data detection between the local and cloud platforms, it can achieve the management and tracking of DNS configuration data of multiple cloud platforms.
[0080] 2) By establishing a mapping relationship between different platforms, the present invention automatically converts the backed-up DNS configuration data into a resolution path recognizable by the backup platform when backing up the DNS configuration data, and stores it in the backup platform. This reduces the tedious manual export and import process, and also reduces the difficulty and complexity of importing backup data into different cloud platforms. At the same time, regular data detection between the primary and backup cloud platforms ensures that data inconsistencies are discovered in a timely manner.
[0081] 3) The present invention stores the DNS configuration data of the main platform in the backup platform in advance. When processing a domain name resolution failure, the DNS server address of the main platform is modified to the DNS server address of the backup platform, thereby achieving rapid switching of the faulty platform and rapid recovery of the domain name resolution failure.
[0082] 4) The present invention streamlines the DNS configuration data change process by recording various states of the DNS configuration data change process, thereby enabling the historical status of the DNS configuration data change to be traced, which is beneficial to the unified configuration and management record of the DNS configuration data change operation.
[0083] The above embodiments do not limit the present invention in any way. Any other improvements and applications made to the above embodiments in an equivalent manner fall within the scope of protection of the present invention.
Claims
1. A hybrid cloud DNS management and failover method, characterized in that: include: Step 1: Build a unified API interface to obtain DNS configuration data from more than one cloud platform, and centrally store the DNS configuration data in a local database: the cloud platform is a cloud service provider that provides domain name resolution services, and the cloud platform has a data table for storing DNS configuration data; the DNS configuration data includes a domain name and a domain name resolution record corresponding to the domain name; the domain name resolution record includes a host record value, resolution record type, resolution record value, and resolution line name; the specific steps include: Step 1-1: The local database is respectively configured with an account table, a domain name table, a resolution record table, and a resolution line table; the table fields of the account table include the platform name, login account, and password; the login account and password are obtained from the account table and passed to a unified API interface, the unified API interface is called to access the data table of the cloud platform, the DNS configuration data is obtained from the data table of the cloud platform, and the data is stored in the domain name table, the resolution record table, and the resolution line table in sequence; The unified API interface integrates DNS operations, including obtaining, adding, deleting, and updating DNS configuration data. The table fields of the domain name table include platform name, domain name, data detection status, and a marker. The values of the marker include primary and backup, which are used to mark the primary and backup cloud platforms corresponding to the domain name; The data detection status is used to record the data detection results, including normal and abnormal; The fields of the resolution record table include: platform name, domain name, domain name resolution record, and data detection status; The table fields of the parsed line table include: platform name, parsed line name, standard name; the standard name is a uniformly defined parsed line name; Step 1-2: Establishing a mapping relationship between different cloud platforms for resolution lines; obtaining the resolution line names of each cloud platform from the resolution line table, screening out the resolution line names that identify the same type of resolution line on different cloud platforms, and establishing a corresponding relationship between the resolution line names, specifically: establishing a mutual mapping relationship between resolution line names that belong to the same standard name; Step 2: Back up DNS configuration data: Select a cloud platform for backing up data, obtain the DNS configuration data to be backed up from the local database, and after parsing the line conversion, use the API unified interface to store the DNS configuration data in the cloud platform; Step 3: Modify DNS configuration data: Obtain the DNS configuration data to be changed and the change type. Based on the DNS configuration data, retrieve the platform names of the primary and backup cloud platforms from the domain name table. Use the unified API interface to access the primary and backup cloud platforms based on the cloud platform login account and password recorded in the account table. Execute the DNS configuration data changes for the local database, primary and backup cloud platforms according to the change type. Step 4: DNS fault switching: Replace the DNS configuration data in the cloud platform with the DNS configuration data of the backup cloud platform; specifically: obtain the domain name where the DNS resolution failure occurs and the cloud platform where the domain name is located; based on the domain name and backup identifier, obtain the platform name corresponding to the domain name with the backup identifier value of backup from the domain name table, and record it as the platform name of the backup cloud platform; obtain the login account and password corresponding to the platform name from the account table, and use the unified API interface to access the backup cloud platform; obtain the DNS server address provided by the backup cloud platform; call the unified API interface, access the cloud platform where the failure is located, and modify the DNS server address of the cloud platform with the failure to the DNS server address of the backup cloud platform.
2. A hybrid cloud DNS management and failover method according to claim 1, characterized in that: In step 1, by comparing the domain name resolution records between the local database and the cloud platform, whether there is any anomaly in the DNS configuration data of the cloud platform is detected, specifically: using a unified API interface to access the data table of the cloud platform to obtain the DNS configuration data; comparing the domain name resolution records in the DNS configuration data with the domain name resolution records in the resolution record table; After comparison, the inconsistent domain name resolution records and storage locations are obtained, and the inconsistent domain name resolution records are stored in the abnormal data table; If the storage location of the inconsistent domain name resolution record is in the resolution record table, the exception type is recorded as missing resolution record on the cloud platform, and in the resolution record table, the data detection status corresponding to the inconsistent resolution record is updated to abnormal; If the storage location of the inconsistent domain name resolution record is in the data table of the cloud platform, the exception type is recorded as extra resolution records on the cloud platform.
3. A hybrid cloud DNS management and failover method according to claim 2, characterized in that: The step 2 specifically includes: Step 2-1: According to the domain name of the DNS configuration data, obtain the domain name resolution record corresponding to the domain name from the resolution record table; store the domain name and the domain name resolution record as copied data in a temporary data table; Compare the obtained domain name resolution record with the domain name resolution record in the copied data. If the comparison is inconsistent, the copy is wrong; if the comparison is consistent, execute steps 2-3; the temporary data table also records the primary cloud platform name, backup cloud platform name and corresponding identifiers of the copied data; Step 2-2: Obtain the resolution line name from the domain name resolution record in the copied data. Based on the primary cloud platform name, the resolution line name, and the backup cloud platform name, search the resolution line mapping relationship in step 1 to see if there is a matching resolution line name for the backup cloud platform. If so, replace the resolution line name in the copied data with the matching resolution line name. Step 2-3: Based on the backup cloud platform name, obtain the backup cloud platform login account and password from the account table, call the unified API interface to access the backup cloud platform data table, and write the copied data into the backup cloud platform data table; at the same time, write the copied data and the backup cloud platform name into the resolution record table; obtain the backup cloud platform name, domain name, and identifier from the temporary data table and write them into the domain name table; Step 2-4: Determine whether there are any anomalies in the DNS configuration data of the backup cloud platform by comparing the domain name resolution records of the cloud platform. Specifically, use a unified API interface to access the data tables of the primary cloud platform and the backup cloud platform respectively, obtain the domain name resolution records of the DNS configuration data from the data tables, compare the domain name resolution records of the backup cloud platform with the domain name resolution records of the primary cloud platform, obtain inconsistent domain name resolution records and storage locations, and write the inconsistent domain name resolution records into the abnormal data table; If the storage location is in the data table of the main cloud platform, the exception type is recorded as the backup cloud platform has missing resolution records; if the storage location is in the data table of the backup cloud platform, the exception type is recorded as the backup cloud platform has extra resolution records; in the resolution record table, the data detection status corresponding to the updated domain name resolution record is abnormal.
4. A hybrid cloud DNS management and failover method according to claim 3, characterized in that: In the abnormal data detection of step 1 and step 2, the domain name resolution record comparison is automatically performed by starting the end-of-day script program every day; when the end-of-day script program obtains the resolution record from the data table of the cloud platform, the resolution record is stored in a temporary table of a Map structure, where the key value is the domain name and the value value is the domain name resolution record.
5. A hybrid cloud DNS management and failover method according to claim 4, characterized in that: The step 3 specifically includes: step 3-1: obtaining the domain name and domain name resolution record of the DNS configuration data to be changed; obtaining the change type, which includes adding a resolution record and deleting a resolution record; step 3-2: obtaining the primary cloud platform and the backup cloud platform of the DNS configuration data according to the identifier in the domain name table: in the domain name table of the local database, according to the domain name and the identifier value, obtaining the corresponding platform name as the primary cloud platform name or the backup cloud platform name; Step 3-3: Execute the change operation in the domain name resolution record table: If the change type is addition, write the domain name, the domain name resolution record and the platform name in step 3-2 in the domain name resolution record table; If the change type is deletion, retrieve the corresponding record according to the domain name and the domain name resolution record and delete it; Step 3-4: Execute the change operation in the main cloud platform and the backup cloud platform: According to the name of the main cloud platform, obtain the corresponding login account and password in the account table, use the unified API interface to access the data table of the main cloud platform, follow the change operation of the local domain name resolution record in step 3-3, and execute the DNS configuration data change in the main cloud platform according to the change type; According to the name of the backup cloud platform, obtain the corresponding login account and password in the account table, use the unified API interface to access the data table of the backup cloud platform, follow the change operation of the local domain name resolution record in step 3-3, and execute the DNS configuration data change in the backup cloud platform according to the change type.
6. A hybrid cloud DNS management and failover method according to claim 5, characterized in that: In step 3, the change content and change type are recorded in a change application form; the change application information includes the domain name, resolution record, change type, application status, applicant reviewer, application time, and review time; the application status of the change application form is used to record the progress of the change application, including pending review, approved, successful change, and failed change; for change applications with an application status of pending review and failed change, the administrator is reminded to handle them.
Citation Information
Patent Citations
DNS management system
CN114221935A
Master-slave DNS synchronization method and device
CN110290173A
Intelligent service fault processing method based on DNS
CN112583648A