[go: up one dir, main page]

TWI738253B - Client connection method of domain name ststem - Google Patents

Client connection method of domain name ststem Download PDF

Info

Publication number
TWI738253B
TWI738253B TW109108992A TW109108992A TWI738253B TW I738253 B TWI738253 B TW I738253B TW 109108992 A TW109108992 A TW 109108992A TW 109108992 A TW109108992 A TW 109108992A TW I738253 B TWI738253 B TW I738253B
Authority
TW
Taiwan
Prior art keywords
server
processing module
name
servers
communication module
Prior art date
Application number
TW109108992A
Other languages
Chinese (zh)
Other versions
TW202137741A (en
Inventor
甘孟勳
Original Assignee
華南商業銀行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 華南商業銀行股份有限公司 filed Critical 華南商業銀行股份有限公司
Priority to TW109108992A priority Critical patent/TWI738253B/en
Application granted granted Critical
Publication of TWI738253B publication Critical patent/TWI738253B/en
Publication of TW202137741A publication Critical patent/TW202137741A/en

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

A client connection method of Domain Name Systeem (DNS) connecting to servers is adapted to a client end and a server end of a Domain Name System, wherein a communication module of the client end communicably connects to one or more name servers of the server end. The method comprises: obtaining a number of one or more name servers of the server end by a processing module of the client end; selectively activating a parallel mode according to the number by the processing module; controling the communication module to perform a health monitoring procedure according to the number by the processing module; setting a mark on the name server that fails the health monitoring procedure by the processing module when at least one name server fails the health monitoring procedure, and updating the number according to the name server that fails the health monitoring procedure and controlling the communication module to performs a service procedure on unmarked name servers of the server end by the processing module.

Description

網域名稱系統服務之客戶端連線方法Client connection method of domain name system service

本發明係關於網域名稱系統,特別是一種網域名稱系統之客戶端連線至伺服器端的方法。The invention relates to a domain name system, in particular to a method for a client of the domain name system to connect to a server.

網域名稱系統(Domain Name System,DNS)為網際網路上的必備服務,而大部分的企業均有架設DNS伺服器的需求與必要,其中BIND(Berkeley Internet Name Domain)為目前市面上常用的DNS服務程式。由於企業或金融機構對於DNS服務都具有高頻率的使用度,所以DNS服務程式可適應性地自動進行調整著實有其必要。現有的DNS服務程式如BIND由於無法自行動態地調整其中的參數設定值,因此經常導致DNS 伺服器端回應DNS客戶端之時間過長,進而使得客戶端因為查詢DNS回應時間過長而導致DNS服務程式之資源耗盡。即使現有的DNS服務具有超時設定的機制,仍無法改善上述的問題。此外,現有的DNS服務程式如BIND也不具備任何監控功能,所以無法將當前DNS伺服器端的狀態即時通知給DNS客戶端的系統管理員,導致整體服務效能的降低。Domain Name System (DNS) is an essential service on the Internet, and most companies have the need and need to set up a DNS server. Among them, BIND (Berkeley Internet Name Domain) is the commonly used DNS on the market. Service program. Since enterprises or financial institutions have high-frequency usage of DNS services, it is really necessary for DNS service programs to adapt and automatically adjust. Existing DNS service programs such as BIND cannot dynamically adjust the parameter settings on its own, so it often takes too long for the DNS server to respond to the DNS client, which in turn causes the client to query the DNS for a long response time and cause DNS service The program's resources are exhausted. Even if the existing DNS service has a time-out setting mechanism, it still cannot improve the above-mentioned problems. In addition, the existing DNS service programs such as BIND do not have any monitoring function, so the current status of the DNS server cannot be notified to the system administrator of the DNS client in real time, resulting in a decrease in overall service performance.

有鑑於此,目前確實有需要一種改良的DNS服務程式及其調控方法,以便改善上述之缺失。In view of this, there is indeed a need for an improved DNS service program and its control method in order to improve the above-mentioned shortcomings.

有鑑於此,本發明提出一種網域名稱系統服務之客戶端連線方法,可動態地調整網域名稱系統服務中的設定參數,並對現有的網域名稱系統服務程式增加監控機制,因此可減少由於等待伺服器端回應而降低的系統效能。此外,本發明提出的網域名稱系統服務之客戶端連線方法可針對每一個名稱伺服器是否即時回應而動態地標記,因此可提升客戶端執行網域名稱系統服務時的整體效能。In view of this, the present invention proposes a client connection method of the domain name system service, which can dynamically adjust the setting parameters in the domain name system service, and add a monitoring mechanism to the existing domain name system service program, so that it can Reduce system performance that is degraded by waiting for response from the server. In addition, the client connection method of the domain name system service proposed by the present invention can dynamically mark whether each name server responds in real time, so the overall performance of the client when executing the domain name system service can be improved.

依據本發明一實施例提出的一種網域名稱系統服務之客戶端連線方法,適用於網域名稱系統之客戶端及伺服器端,其中客戶端具有處理模組及通訊模組,通訊模組通訊連接伺服器端,且伺服器端具有一或多個名稱伺服器,所述網域名稱系統服務之客戶端連線方法包括:處理模組取得伺服器端之一或多個名稱伺服器之伺服器數量;處理模組依據伺服器數量選擇性啟用並行模式;處理模組依據伺服器數量控制通訊模組執行健康檢查程序;其中當一或多個名稱伺服器中存在至少一者未通過健康檢查程序時,處理模組對未通過健康檢查程序之至少一名稱伺服器設定標記;以及處理模組依據未通過健康檢查程序之名稱伺服器更新伺服器數量,並控制通訊模組對伺服器端中未被設定標記之一或多名稱伺服器執行服務程序。According to an embodiment of the present invention, a client connection method of a domain name system service is suitable for the client and server sides of the domain name system, wherein the client has a processing module and a communication module, and the communication module The communication is connected to the server side, and the server side has one or more name servers. The client connection method of the domain name system service includes: the processing module obtains one or more name servers on the server side The number of servers; the processing module selectively enables the parallel mode according to the number of servers; the processing module controls the communication module to perform health check procedures according to the number of servers; among them, when at least one of one or more name servers fails to pass health During the check procedure, the processing module sets a flag for at least one name server that has failed the health check procedure; and the processing module updates the number of servers based on the name server that has failed the health check procedure, and controls the communication module to the server side One or more name servers are running service procedures that are not set in the flags.

以上之關於本揭露內容之說明及以下之實施方式之說明係用以示範與解釋本發明之精神與原理,並且提供本發明之專利申請範圍更進一步之解釋。The above description of the disclosure and the following description of the embodiments are used to demonstrate and explain the spirit and principle of the present invention, and to provide a further explanation of the scope of the patent application of the present invention.

以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。以下之實施例係進一步詳細說明本發明之觀點,但非以任何觀點限制本發明之範疇。The detailed features and advantages of the present invention will be described in detail in the following embodiments. The content is sufficient to enable anyone familiar with the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the scope of patent application and the drawings. Anyone who is familiar with relevant skills can easily understand the purpose and advantages of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention by any viewpoint.

金融機構或企業中經常被採用的AIX/Linux系統可透過客戶端電腦運行的BIND(Berkeley Internet Name Domain)軟體連線至網域名稱系統(Domain Name Server,DNS)伺服器,藉此實現DNS客戶端及伺服器端之服務功能。The AIX/Linux system often used in financial institutions or enterprises can be connected to the Domain Name Server (DNS) server through the BIND (Berkeley Internet Name Domain) software running on the client computer, thereby realizing DNS clients The service function of the end and the server end.

請參考圖1。圖1繪示依據本發明一實施例的網域名稱系統服務之客戶端連線方法所適用的系統架構圖。Please refer to Figure 1. FIG. 1 is a diagram of a system structure applicable to a client connection method of a domain name system service according to an embodiment of the present invention.

本發明一實施例敘述的網域名稱系統服務之客戶端連線方法,適用於網域名稱系統100之客戶端10及伺服器端30,其中客戶端10具有處理模組12及通訊模組14。通訊模組14通訊連接伺服器端30,且伺服器端30具有多個名稱伺服器(name server),例如圖1作為範例所繪示的伺服器32、伺服器34及伺服器36。本發明並不限制可供連線的名稱伺服器的數量The client connection method of the domain name system service described in an embodiment of the present invention is applicable to the client 10 and the server 30 of the domain name system 100, wherein the client 10 has a processing module 12 and a communication module 14 . The communication module 14 is communicatively connected to the server terminal 30, and the server terminal 30 has a plurality of name servers, such as the server 32, the server 34, and the server 36 shown in FIG. 1 as an example. The present invention does not limit the number of name servers that can be connected

客戶端10例如為運行AIX系統或Linux作業系統的電腦。本發明對於客戶端10的硬體類型不予限制。在一實施例中,客戶端10的處理模組12可運行BIND(Berkeley Internet Name Domain)軟體並透過通訊模組14連線至伺服器端30。The client 10 is, for example, a computer running an AIX system or a Linux operating system. The present invention does not limit the type of hardware of the client 10. In one embodiment, the processing module 12 of the client 10 can run BIND (Berkeley Internet Name Domain) software and connect to the server 30 through the communication module 14.

請參考圖2,其繪示本發明一實施例的網域名稱系統服務之客戶端連線方法的流程圖。整體而言,在本實施例中,可透過在客戶端10作業系統下的Shell介面載入預先設定好的腳本檔(script file)以實現如下所述的各步驟。Please refer to FIG. 2, which illustrates a flowchart of a client connection method of a domain name system service according to an embodiment of the present invention. In general, in this embodiment, a preset script file can be loaded through the Shell interface under the operating system of the client 10 to implement the steps described below.

請參考步驟S1,處理模組12取得伺服器端30之名稱伺服器(如伺服器32、伺服器34及伺服器36)之一伺服器數量。本步驟S1係客戶端10判斷當前可供連線的伺服器數量。以圖1繪示的範例而言,所述的伺服器數量為3。具體來說,處理模組12可讀取etc目錄底下的設定檔resolv.conf,並透過撰寫在腳本檔中的Shell指令查找此檔案中nameserver的關鍵字數量,藉此取得伺服器數量。Please refer to step S1, the processing module 12 obtains the number of one of the name servers (such as the server 32, the server 34, and the server 36) of the server end 30. In this step S1, the client 10 determines the number of servers currently available for connection. Taking the example shown in FIG. 1, the number of said servers is three. Specifically, the processing module 12 can read the configuration file resolv.conf under the etc directory, and find the number of nameserver keywords in the file through the Shell command written in the script file, thereby obtaining the number of servers.

請參考步驟S3,處理模組12依據伺服器數量選擇性啟用一並行模式。所述的並行模式代表客戶端10可在執行後面的步驟時同時連線至伺服器端的多個名稱伺服器32、34及36。在一實施例中,並行模式代表處理模組12允許通訊模組14同時發送複數個封包至伺服器30端中的一或多個名稱伺服器32、34及36。若處理模組12選擇不啟用並行模式,則處理模組12啟用單一傳輸模式,所述的單一模式代表客戶端10只對單一個名稱伺服器發送封包(當步驟S1取得的伺服器數量小於等於1時)。Please refer to step S3, the processing module 12 selectively activates a parallel mode according to the number of servers. The aforementioned parallel mode means that the client 10 can simultaneously connect to multiple name servers 32, 34, and 36 on the server side when performing the following steps. In one embodiment, the parallel mode represents that the processing module 12 allows the communication module 14 to simultaneously send multiple packets to one or more name servers 32, 34, and 36 in the server 30. If the processing module 12 chooses not to enable the parallel mode, the processing module 12 enables the single transmission mode. The single mode means that the client 10 only sends packets to a single name server (when the number of servers obtained in step S1 is less than or equal to 1 o'clock).

具體來說,透過撰寫在腳本檔中的Shell指令,設定option rotate這個參數。設定option rotate這個參數代表處理模組12可使用resolv.conf中的所有名稱服務器,而不只是第一個。換言之,在啟動option rotate功能後,可減輕原本位於resolv.conf中第一個名稱伺服器的負載,讓處理模組12 的每個實例輪流使用resolv.conf中列舉的名稱伺服器。Specifically, through the Shell command written in the script file, set the option rotate parameter. Setting option rotate means that processing module 12 can use all name servers in resolv.conf, not just the first one. In other words, after enabling the option rotate function, the load of the first name server originally located in resolv.conf can be reduced, and each instance of the processing module 12 can use the name servers listed in resolv.conf in turn.

請參考圖3,其繪示步驟S3的細部流程圖。在圖2的步驟S1完成後,繼續執行步驟S31。Please refer to FIG. 3, which shows a detailed flowchart of step S3. After step S1 in FIG. 2 is completed, step S31 is continued.

請參考步驟S31,判斷伺服器數量是否小於或等於1。若判斷結果為「是」,則執行步驟S32及步驟S33。若判斷結果為「否」,則執行步驟S34及步驟S35。需注意的是,本發明無需就步驟S32及步驟S33的執行先後順序予以限制。同理,步驟S34及步驟S35的執行先後順序亦無須予以限制。Please refer to step S31 to determine whether the number of servers is less than or equal to one. If the judgment result is "Yes", step S32 and step S33 are executed. If the judgment result is "No", step S34 and step S35 are executed. It should be noted that the present invention does not need to limit the execution sequence of step S32 and step S33. Similarly, the execution sequence of step S34 and step S35 does not need to be limited.

當伺服器數量小於等於1時,請參考步驟S32,處理模組12禁止通訊模組14對伺服器端30中的一或多個名稱伺服器32、34及36的每一者分別發送一封包。具體來說,處理模組12移除option rotate這個參數設定。When the number of servers is less than or equal to 1, please refer to step S32, the processing module 12 prohibits the communication module 14 from sending a packet to each of the one or more name servers 32, 34, and 36 in the server 30 . Specifically, the processing module 12 removes the parameter setting option rotate.

請參考步驟S33,處理模組降低通訊模組14之等待時間及通訊模組14之重傳次數。具體來說,處理模組降低etc/environment設定檔中代表等待時間的RES_TIMEOUT的設定值,並且降低代表重傳次數RES_RETRY的設定值。實務上,若resolv.conf中只有一個名稱伺服器,且其回應時間過長,透過步驟S33降低等待時間及重傳次數的設定值,可避免客戶端10運作的業務服務程式因漫長等待耗盡資源的問題。Please refer to step S33, the processing module reduces the waiting time of the communication module 14 and the number of retransmissions of the communication module 14. Specifically, the processing module reduces the setting value of RES_TIMEOUT representing the waiting time in the etc/environment configuration file, and reduces the setting value of RES_RETRY representing the number of retransmissions. In practice, if there is only one name server in resolv.conf and its response time is too long, reducing the waiting time and retransmission times through step S33 can prevent the business service program operated by the client 10 from being exhausted due to long waiting The problem of resources.

當該伺服器數量大於1時,請參考步驟S34,處理模組12允許通訊模組14對伺服器端30中的一或多個名稱伺服器32、34及36的每一者分別發送一封包。具體來說,處理模組12加入option rotate這個參數設定。When the number of servers is greater than 1, please refer to step S34. The processing module 12 allows the communication module 14 to send a packet to each of the one or more name servers 32, 34, and 36 in the server 30. . Specifically, the processing module 12 adds the option rotate parameter setting.

請參考步驟S35,處理模組12恢復通訊模組14之等待時間之預設值及通訊模組14之重傳次數之預設值。詳言之,當可供查詢的名稱伺服器數量足夠,則可適應性地恢復RES_TIMEOUT及RES_RETRY兩個參數的預設值。然而本發明並不以上述舉例為限。Please refer to step S35, the processing module 12 restores the default value of the waiting time of the communication module 14 and the default value of the number of retransmissions of the communication module 14. In detail, when the number of name servers available for query is sufficient, the default values of the two parameters RES_TIMEOUT and RES_RETRY can be restored adaptively. However, the present invention is not limited to the above examples.

在圖3的步驟S32及步驟S33完成後,或是步驟S34及步驟S35完成後,將繼續執行圖2的步驟S5。After step S32 and step S33 in FIG. 3 are completed, or after step S34 and step S35 are completed, step S5 in FIG. 2 will continue to be executed.

請參考步驟S5,處理模組12依據伺服器數量控制通訊模組14執行一健康檢查程序。請一併參考圖4,其繪示步驟S5的細部流程圖。Please refer to step S5, the processing module 12 controls the communication module 14 to execute a health check procedure according to the number of servers. Please also refer to FIG. 4, which shows a detailed flowchart of step S5.

請參考步驟S51,處理模組12選擇伺服器端30中的一或多個名稱伺服器32、34及36其中一者。在一實施例中,選擇名稱伺服器32、34及36的順序可按照resolv.conf設定檔中nameserver關鍵字出現的順序,然而本發明並不以此為限。舉例來說,在本步驟S51第一次執行時,處理模組12選擇伺服器32。Please refer to step S51, the processing module 12 selects one or more of the name servers 32, 34, and 36 in the server end 30. In one embodiment, the order of selecting the name servers 32, 34, and 36 may follow the order in which the nameserver keywords appear in the resolv.conf configuration file, but the invention is not limited to this. For example, when this step S51 is executed for the first time, the processing module 12 selects the server 32.

請參考步驟S53,處理模組12控制通訊模組14發送封包至被選擇的名稱伺服器(如伺服器32)並累計等待時間。承前例,從通訊模組14開始發出封包至伺服器32,處理模組12便啟動計時器開始累計等待時間。Please refer to step S53, the processing module 12 controls the communication module 14 to send packets to the selected name server (such as the server 32) and accumulate the waiting time. Following the previous example, when the communication module 14 starts to send packets to the server 32, the processing module 12 starts a timer to start accumulating the waiting time.

在執行步驟S53之後,若客戶端10未收到來自被選擇的名稱伺服器(如伺服器32)的回應,則執行步驟S55。反之,若客戶端10收到來自被選擇的名稱伺服器(如伺服器32)的回應,則執行步驟S57。After step S53 is executed, if the client terminal 10 does not receive a response from the selected name server (such as the server 32), step S55 is executed. Conversely, if the client 10 receives a response from the selected name server (such as the server 32), step S57 is executed.

請參考步驟S55,當通訊模組14未接收到被選擇的名稱伺服器(如伺服器32)發送之回應封包且等待時間達到閾值時,處理模組12指示此伺服器32對應的健康檢查程序為「未通過」。Please refer to step S55. When the communication module 14 does not receive the response packet sent by the selected name server (such as server 32) and the waiting time reaches the threshold, the processing module 12 instructs the server 32 to perform a health check procedure It is "Failed".

請參考步驟S57,當通訊模組14接收到被選擇的名稱伺服器(如伺服器32)發送之回應封包時且等待時間未到達閾值時,處理模組12指定健康檢查程序為「通過」。Please refer to step S57. When the communication module 14 receives the response packet sent by the selected name server (such as the server 32) and the waiting time has not reached the threshold, the processing module 12 designates the health check procedure as "pass".

承上所述,圖4所繪示的流程可採用平行執行策略,且執行緒的數量與伺服器數量相等。藉此,客戶端10實現對於伺服器端30所有名稱伺服器32、34及36的健康狀態檢查,並且可以在伺服器數量較大時節省整體運作時間。在另一實施例中,客戶端可採用串列執行策略,對每一個名稱伺服器先後執行健康狀態檢查。In summary, the process shown in FIG. 4 can adopt a parallel execution strategy, and the number of threads is equal to the number of servers. In this way, the client 10 realizes the health status check of all the name servers 32, 34, and 36 of the server 30, and can save the overall operation time when the number of servers is large. In another embodiment, the client can adopt a serial execution strategy to sequentially perform health checks on each name server.

請參考步驟S7,判斷是否有名稱伺服器未通過健康檢查程序。換言之,在步驟S5被平行執行多次之後,或步驟S5被連續執行多次之後,處理模組12判斷一或多個名稱伺服器32、34及36中是否存在至少一者未通過健康檢查程序。如果判斷結果為「是」,則處理模組12對未通過健康檢查程序之名稱伺服器設定一標記(Mark Down)。在一實施例中,所述的標記係處理模組12產生一記錄檔。此記錄檔用以記載未通過健康檢查程序之名稱伺服器之識別號。假設未通過健康檢查程序的名稱伺服器為伺服器36,則識別號可以是伺服器36的虛擬編號,或伺服器36的網際網路協定位址,或伺服器36的MAC位址,本發明對於標記中記錄資料的形式不予限制。在另一實施中,處理模組12更控制通訊模組14發送記錄檔至一監控設備。藉此,讓外部的監控設備得以即時掌握目前有哪些無法使用的名稱伺服器(如伺服器36)。Please refer to step S7 to determine whether any name servers have failed the health check procedure. In other words, after step S5 is executed multiple times in parallel, or after step S5 is executed multiple times in succession, the processing module 12 determines whether at least one of the one or more name servers 32, 34, and 36 has failed the health check procedure. . If the judgment result is "Yes", the processing module 12 sets a mark (Mark Down) for the name server that has not passed the health check procedure. In one embodiment, the marking processing module 12 generates a log file. This log file is used to record the identification number of the name server that failed the health check procedure. Assuming that the name server that failed the health check procedure is server 36, the identification number can be the virtual number of server 36, or the Internet protocol address of server 36, or the MAC address of server 36. The present invention There is no restriction on the form of the data recorded in the mark. In another implementation, the processing module 12 further controls the communication module 14 to send the log file to a monitoring device. In this way, the external monitoring equipment can instantly know which name servers are currently unavailable (such as server 36).

請參考步驟S8,處理模組12依據未通過健康檢查程序之名稱伺服器(如伺服器36)更新伺服器數量。舉例來說,因為伺服器36未通過健康檢查程序,因此處理模組12將步驟S1取得的伺服器數值,由3更新為2。另一方面,若處理模組12判斷名稱伺服器中未通過健康檢查程序的伺服器數量與步驟S1取得的伺服器數量相等時,換言之,可用的名稱伺服器的伺服器數量為0時,也就是當前所有名稱伺服器皆不正常時,處理模組12產生一警示訊號,並控制通訊模組14發送警示訊號。在一實施例中,警示訊號為發送到系統管理員手機的推播或簡訊。在另一實施例中,警示訊號為發送給系統館理員的電子郵件。Please refer to step S8. The processing module 12 updates the number of servers based on the name servers (such as server 36) that have failed the health check procedure. For example, because the server 36 has not passed the health check procedure, the processing module 12 updates the server value obtained in step S1 from 3 to 2. On the other hand, if the processing module 12 determines that the number of servers in the name server that have not passed the health check procedure is equal to the number of servers obtained in step S1, in other words, when the number of available name servers is 0, it is also That is, when all current name servers are abnormal, the processing module 12 generates a warning signal and controls the communication module 14 to send the warning signal. In one embodiment, the warning signal is a push or short message sent to the mobile phone of the system administrator. In another embodiment, the warning signal is an email sent to a system librarian.

請參考步驟S9,處理模組12控制通訊模組14對伺服器端30中未被設定標記之名稱伺服器(如伺服器32及伺服器34)執行DNS服務程序。另一方面,對於已被設定標記之名稱伺服器(如伺服器36),處理模組36禁止將執行DNS服務程序時發送的查詢指令發送到此伺服器36Please refer to step S9, the processing module 12 controls the communication module 14 to execute the DNS service procedure on the name servers (such as the server 32 and the server 34) that are not marked in the server end 30. On the other hand, for a name server (such as server 36) that has been set with a flag, the processing module 36 prohibits the query command sent during the execution of the DNS service program from being sent to this server 36

在一實施例中,步驟S5~S9將週期性地重複執行。舉例來說,在步驟S9對未被設定標記之名稱伺服器(如伺服器32及伺服器34)執行DNS服務程序並經過一指定時間之後,將返回步驟S5,處理模組12依據伺服器數量控制通訊模組14對伺服器端30的每一個名稱伺服器32、34及36執行健康檢查程序。上述的檢查程序仍包含將先前被設定標註的名稱伺服器36。若被設定標記之名稱伺服器36通過健康檢查程序,則處理模組12取消其標記,待後續執行到步驟S9時,處理模組12控制通訊模組14對伺服器端30之被取消標記之名稱伺服器36執行服務程序。In one embodiment, steps S5 to S9 will be periodically repeated. For example, in step S9, after executing the DNS service procedure on the name servers (such as server 32 and server 34) that have not been marked with a set flag, and after a specified time has elapsed, it will return to step S5, and the processing module 12 will depend on the number of servers The control communication module 14 performs a health check procedure on each of the name servers 32, 34, and 36 of the server end 30. The above-mentioned checking procedure still includes the name server 36 that will be previously set and labeled. If the name server 36 for which the mark is set passes the health check procedure, the processing module 12 cancels its mark. When the subsequent execution reaches step S9, the processing module 12 controls the communication module 14 to cancel the mark of the server 30 The name server 36 executes the service program.

綜上所述,本發明在上述實施例中提出的網域名稱系統服務之客戶端連線方法,基於載入到客戶端作業系統的腳本檔,實現下列兩項主要功能,改善並優化DNS客戶端的查詢效能。本發明之第一項主要功效為動態調整BIND軟體中的多項參數,藉此達到DNS查詢最優化的效果。詳言之,本發明透過讓DNS客戶端向名稱伺服器查詢現況,藉此動態調整BIND軟體中的多項參數。被動態調整的參數包括options rotate、RES_RETRY、RES_TIMEOUT參數等。當DNS客戶端業務服務需要向名稱伺服器發起大量詢問時,若依照RES_RETRY、RES_TIMEOUT的預設值執行,恐容易發生回應時間過長的問題。尤其是在當名稱伺服器只有一個可用的時候,更容易發生上述的狀況。因此,本發明動態調整options rotate、RES_RETRY、RES_TIMEOUT的設定值,可緩解回應時間過長的問題,並確保DNS客戶端業務服務程式,不會因為查詢DNS回應時間過長,進而導致業務服務程式耗盡資源。In summary, the client connection method of the domain name system service proposed in the above embodiment of the present invention implements the following two main functions based on the script file loaded into the client operating system to improve and optimize the DNS client End query performance. The first main effect of the present invention is to dynamically adjust multiple parameters in the BIND software, thereby achieving the effect of DNS query optimization. In detail, the present invention dynamically adjusts multiple parameters in the BIND software by allowing the DNS client to query the name server for the current status. The parameters that are dynamically adjusted include options rotate, RES_RETRY, and RES_TIMEOUT parameters. When the DNS client business service needs to initiate a large number of queries to the name server, if it is executed according to the default values of RES_RETRY and RES_TIMEOUT, the problem of too long response time may easily occur. Especially when there is only one name server available, the above situation is more likely to occur. Therefore, the present invention dynamically adjusts the setting values of options rotate, RES_RETRY, and RES_TIMEOUT, which can alleviate the problem of too long response time, and ensure that the DNS client business service program will not cause the business service program to consume too long response time due to the query DNS. Exhaust resources.

本發明之第二項主要功效係實現標記(Mark Down) 不可用的名稱伺服器,並提供客戶端即時通知及監控的機制。本發明透過定期的健康檢查程序,可確認當前的每一個名稱伺服器是否有回應。若某一個名稱伺服器不存在或故障,原本的DNS客戶端程式並不會知道此名稱伺服器不存在,進而導致發送無效的詢問,影響整體的詢問效能。而本發明的網域名稱系統服務之客戶端連線方法,係實現標記機制,使客戶端詢問的封包不再發送到不可用的名稱伺服器。此外,本發明的網域名稱系統服務之客戶端連線方法可產生一個記錄檔,用於讓監控設備,作為示警的條件。同一時間,本發明的網域名稱系統服務之客戶端連線方法可發出電子信件即時通知客戶端的系統管理員進行處理。本發明之另一優勢在於可定期偵測先前被標記的名稱伺服器是否已恢復,如果判斷該名稱伺服器已可使用,本發明將自動恢復DNS客戶端向此名稱伺服器端詢問的服務。The second main effect of the present invention is to realize a name server where Mark Down is unavailable, and to provide a mechanism for instant notification and monitoring by the client. The present invention can confirm whether each current name server has a response through a regular health check procedure. If a certain name server does not exist or fails, the original DNS client program will not know that the name server does not exist, which will cause invalid queries to be sent and affect the overall query performance. The client connection method of the domain name system service of the present invention implements a marking mechanism so that the packet inquired by the client is no longer sent to an unavailable name server. In addition, the client connection method of the domain name system service of the present invention can generate a log file for the monitoring device as a warning condition. At the same time, the client connection method of the domain name system service of the present invention can send an e-mail to immediately notify the system administrator of the client to proceed. Another advantage of the present invention is that it can periodically detect whether the previously marked name server has been restored. If it is determined that the name server is ready for use, the present invention will automatically restore the service that the DNS client asks the name server.

整體而言,本發明提出的一種網域名稱系統服務之客戶端連線方法,可動態地調整網域名稱系統服務中的設定參數,並對現有的網域名稱系統服務程式增加監控機制,因此可減少由於等待伺服器端回應而降低的系統效能。此外,本發明提出的網域名稱系統服務之客戶端連線方法可針對每一個名稱伺服器是否即時回應而動態地標記,因此可提升客戶端執行網域名稱服務時的整體效能。On the whole, the client connection method of the domain name system service proposed by the present invention can dynamically adjust the setting parameters in the domain name system service and add a monitoring mechanism to the existing domain name system service program. Therefore, It can reduce the system performance that is reduced by waiting for a response from the server. In addition, the client connection method of the domain name system service proposed by the present invention can dynamically mark whether each name server responds in real time, so the overall performance of the client when executing the domain name service can be improved.

雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明。在不脫離本發明之精神和範圍內,所為之更動與潤飾,均屬本發明之專利保護範圍。關於本發明所界定之保護範圍請參考所附之申請專利範圍。Although the present invention is disclosed in the foregoing embodiments, it is not intended to limit the present invention. All changes and modifications made without departing from the spirit and scope of the present invention fall within the scope of the patent protection of the present invention. For the scope of protection defined by the present invention, please refer to the attached scope of patent application.

S1~S9:步驟 S31~S35:步驟 S51~S57:步驟 100:網域名稱系統 10:客戶端 12:處理模組 14:通訊模組 30:伺服器端 32、34、36:名稱伺服器 S1~S9: steps S31~S35: steps S51~S57: steps 100: Domain name system 10: client 12: Processing module 14: Communication module 30: server side 32, 34, 36: name server

圖1繪示依據本發明一實施例的網域名稱系統服務之客戶端連線方法所適用的系統架構圖。 圖2繪示依據本發明一實施例的網域名稱系統服務之客戶端連線方法的流程圖。 圖3係繪示圖2中步驟S3的細部流程圖。 圖4係繪示圖2中步驟S5的細部流程圖。 FIG. 1 is a diagram of a system structure applicable to a client connection method of a domain name system service according to an embodiment of the present invention. FIG. 2 shows a flowchart of a client connection method of a domain name system service according to an embodiment of the present invention. FIG. 3 is a detailed flowchart of step S3 in FIG. 2. FIG. 4 is a detailed flowchart of step S5 in FIG. 2.

S1~S9:步驟 S1~S9: steps

Claims (7)

一種網域名稱系統服務之客戶端連線方法,適用於網域名稱系統之一客戶端及一伺服器端,其中該客戶端具有一處理模組及一通訊模組,該通訊模組通訊連接該伺服器端,且該伺服器端具有一或多個名稱伺服器,所述網域名稱系統服務之客戶端連線方法包括:以該處理模組取得該伺服器端之該一或多個名稱伺服器之一伺服器數量;以該處理模組依據該伺服器數量選擇性啟用一並行模式,其中當該伺服器數量小於等於1時,以該處理模組禁止該通訊模組同時對該伺服器端中的該一或多個名稱伺服器的每一者發送一封包;並以該處理模組降低該通訊模組之一等待時間及該通訊模組之一重傳次數;以及當該伺服器數量大於1時,以該處理模組允許該通訊模組同時對該伺服器端中的該一或多個名稱伺服器的每一者發送一封包;並以該處理模組將該通訊模組之該等待時間恢復為一預設值及將該通訊模組之該重傳次數恢復為另一預設值;在以該處理模組依據該伺服器數量選擇性地啟用該並行模式之後,以該處理模組依據該伺服器數量控制該通訊模組執行一健康檢查程序;其中當該一或多個名稱伺服器中存在至少一者未通過該健康檢查程序時,以該處理模組對未通過該健康檢查程序之該至少一名稱伺服器設定一標記;以及以該處理模組依據未通過該健康檢查程序之該名稱伺服器更新該伺服器數量,並控制該通訊模組對該伺服器端中未被設定該標記之該一或多名稱伺服器執行一服務程序。 A client connection method of a domain name system service is applicable to a client and a server side of the domain name system, wherein the client has a processing module and a communication module, and the communication module is connected in communication The server side, and the server side has one or more name servers, the client connection method of the domain name system service includes: obtaining the one or more name servers of the server side by the processing module Name server, the number of servers; use the processing module to selectively enable a parallel mode based on the number of servers, where when the number of servers is less than or equal to 1, use the processing module to prohibit the communication module from simultaneously Each of the one or more name servers on the server side sends a packet; and uses the processing module to reduce the waiting time of one of the communication modules and the number of retransmissions of one of the communication modules; and when the server When the number of servers is greater than 1, the processing module allows the communication module to simultaneously send a packet to each of the one or more name servers on the server side; and uses the processing module to the communication module The waiting time of the group is restored to a preset value and the number of retransmissions of the communication module is restored to another preset value; after the processing module selectively activates the parallel mode according to the number of servers, The processing module is used to control the communication module to execute a health check procedure according to the number of servers; wherein when at least one of the one or more name servers fails the health check procedure, the processing module is used to The at least one name server that fails the health check procedure sets a flag; and the processing module updates the number of servers based on the name server that fails the health check procedure, and controls the communication module to the server The one or more name servers for which the flag is not set on the server side execute a service procedure. 如請求項1所述的網域名稱系統服務之客戶端連線方法,其中該並行模式包括:以該處理模組允許該通訊模組同時發送複數個封包至該伺服器端中的該一或多個名稱伺服器。 The client connection method of the domain name system service according to claim 1, wherein the parallel mode includes: using the processing module to allow the communication module to simultaneously send a plurality of packets to the one or Multiple name servers. 如請求項1所述的網域名稱系統服務之客戶端連線方法,其中以該處理模組依據該伺服器數量控制該通訊模組執行一健康檢查程序包括:選擇該伺服器端中的該一或多個名稱伺服器其中一者;以及以該處理模組控制該通訊模組發送一封包至被選擇的該名稱伺服器,並累計一等待時間;其中當該通訊模組未接收到被選擇的該名稱伺服器發送之一回應封包且該等待時間到達一閾值,以該處理模組指示該健康檢查程序為未通過;及當該通訊模組接收到被選擇的該名稱伺服器發送之該回應封包且該等待時間尚未到達該閾值;以該處理模組指定該健康檢查程序為通過。 The client connection method of the domain name system service according to claim 1, wherein using the processing module to control the communication module to execute a health check procedure according to the number of servers includes: selecting the server in the server One of one or more name servers; and using the processing module to control the communication module to send a packet to the selected name server, and accumulate a waiting time; wherein when the communication module does not receive the The selected name server sends a response packet and the waiting time reaches a threshold, the processing module indicates that the health check procedure is not passed; and when the communication module receives the selected name server sent The response packet and the waiting time have not yet reached the threshold; the processing module specifies that the health check procedure is passed. 如請求項1所述的網域名稱系統服務之客戶端連線方法,其中當該一或多個名稱伺服器中存在該至少一者未通過該健康檢查程序,且未通過該健康檢查程序之該至少一名稱伺服器對應之一數量與該伺服器數量相等時,以該處理模組產生一警示訊號並透過該通訊模組發送該警示訊號。 The client connection method of the domain name system service according to claim 1, wherein when the at least one of the one or more name servers fails the health check procedure, and fails the health check procedure When the number corresponding to the at least one name server is equal to the number of the server, the processing module generates a warning signal and sends the warning signal through the communication module. 如請求項4所述的網域名稱系統服務之客戶端連線方法,其中該警示訊號為一推播或一電子郵件。 The client connection method of the domain name system service according to claim 4, wherein the warning signal is a push broadcast or an email. 如請求項1所述的網域名稱系統服務之客戶端連線方法,其中在對該伺服器執行該服務程序之後,更包括:以該處理模組依據該伺服器數量控制該通訊模組執行該健康檢查程序;其中當被設定該標記之該至少一名稱伺服器通過該健康檢查程序時;以該處理模組取消該標記;以及以該處理模組控制該通訊模組對該伺服器端之被取消該標記之該至少一名稱伺服器執行該服務程序。 The client connection method of the domain name system service according to claim 1, wherein after the service procedure is executed on the server, the method further includes: controlling the communication module to execute by the processing module according to the number of servers The health check procedure; wherein when the at least one name server for which the mark is set passes the health check procedure; the processing module cancels the mark; and the processing module controls the communication module to the server side The at least one name server whose mark has been cancelled executes the service procedure. 如請求項1所述的網域名稱系統服務之客戶端連線方法,其中以該處理模組對未通過該健康檢查程序之該至少一名稱伺服器設定該標記包括:以該處理模組產生一記錄檔,該記錄檔用以記載未通過該健康檢查程序之該至少一名稱伺服器之一識別號;以及以該處理模組控制該通訊模組發送該記錄檔至一監控設備。 The client connection method of the domain name system service according to claim 1, wherein setting the mark with the processing module to the at least one name server that has failed the health check procedure includes: generating with the processing module A log file for recording an identification number of the at least one name server that fails the health check procedure; and the processing module controls the communication module to send the log file to a monitoring device.
TW109108992A 2020-03-18 2020-03-18 Client connection method of domain name ststem TWI738253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109108992A TWI738253B (en) 2020-03-18 2020-03-18 Client connection method of domain name ststem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109108992A TWI738253B (en) 2020-03-18 2020-03-18 Client connection method of domain name ststem

Publications (2)

Publication Number Publication Date
TWI738253B true TWI738253B (en) 2021-09-01
TW202137741A TW202137741A (en) 2021-10-01

Family

ID=78777839

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109108992A TWI738253B (en) 2020-03-18 2020-03-18 Client connection method of domain name ststem

Country Status (1)

Country Link
TW (1) TWI738253B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004059925A1 (en) * 2002-12-24 2004-07-15 Hajime Fukushima Communication model, signal, method, and device for confirming reachability in network where host reachability is accomplished by relating static identifier to dynamic address
EP2648117A1 (en) * 2012-04-04 2013-10-09 VeriSign, Inc. Process for redundant authoritative name servers
CN103634129A (en) * 2012-08-22 2014-03-12 腾讯科技(深圳)有限公司 Proxy server setting method and device
US20150095404A1 (en) * 2013-09-27 2015-04-02 Radia Perlman Distributed in-order load spreading resilient to topology changes
US20180124196A1 (en) * 2016-10-28 2018-05-03 Entit Software Llc Forwarding service requests from outbound proxy servers to remote servers inside of firewalls
CN108933693A (en) * 2017-05-26 2018-12-04 贵州白山云科技有限公司 A kind of Domain Name Service System fault handling method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004059925A1 (en) * 2002-12-24 2004-07-15 Hajime Fukushima Communication model, signal, method, and device for confirming reachability in network where host reachability is accomplished by relating static identifier to dynamic address
EP2648117A1 (en) * 2012-04-04 2013-10-09 VeriSign, Inc. Process for redundant authoritative name servers
CN103634129A (en) * 2012-08-22 2014-03-12 腾讯科技(深圳)有限公司 Proxy server setting method and device
US20150095404A1 (en) * 2013-09-27 2015-04-02 Radia Perlman Distributed in-order load spreading resilient to topology changes
US20180124196A1 (en) * 2016-10-28 2018-05-03 Entit Software Llc Forwarding service requests from outbound proxy servers to remote servers inside of firewalls
CN108933693A (en) * 2017-05-26 2018-12-04 贵州白山云科技有限公司 A kind of Domain Name Service System fault handling method and system

Also Published As

Publication number Publication date
TW202137741A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
JP6600373B2 (en) System and method for active-passive routing and control of traffic in a traffic director environment
CN1534947A (en) Improve the availability and scalability of messaging systems in a manner transparent to the application
US20210195000A1 (en) Method and device for data transmission
JP2007226398A (en) Database connection management method and computer system
CN106330988B (en) Method and device for reissuing hypertext transfer request and client
KR20140004653A (en) Third party initiation of communications between remote parties
CN112346899B (en) Micro-service performance optimization method and device
US7849129B2 (en) System and method for preventing throughput depression in power saving NAS system
CN109964493B (en) Network connection detection method, device, terminal and computer storage medium
CN1647482A (en) Retry technique for multi-tier network communication systems
TWI738253B (en) Client connection method of domain name ststem
JP7338435B2 (en) COMMUNICATION DEVICE AND COMPUTER PROGRAM FOR COMMUNICATION DEVICE
CN114978910B (en) Time sensitivity realization method and system of virtualization core network
CN117061071A (en) Data transmission method, device, electronic equipment and storage medium
CN114567549B (en) CPE configuration self-adaption method, device, computer equipment and storage medium
CN102006314A (en) Multiserver adaptive task scheduling method and device thereof
CN113949631B (en) Client disaster recovery processing method, system and electronic equipment
CN1909507A (en) Method and system for message transfer
US20100332681A1 (en) Communication apparatus capable of selecting a proper source address from a plurality of source addresses assigned thereto, method of controlling the same, and storage medium
TWI758179B (en) Client connection method of selecting domain name system service according to response time
CN118842739A (en) Firewall packet capturing method, device, equipment and storage medium
JP3945288B2 (en) LAN parameter matching program, LAN parameter matching method, and LAN parameter matching system
CN110166185B (en) Audio data processing method, device, storage medium and processor
CN114650283A (en) Method and device for dynamically switching cloud storage service, electronic equipment and storage medium
CN109510864B (en) A kind of forwarding method, transmission method and related device of cache request