Method, device, equipment and storage medium for accessing addresses in IPv6 private network

The AAAA record query function is enabled according to the operating system through the preset policy library, which solves the problem of inability to access the IPv6 private network, improves system flexibility and user experience, and ensures address access capabilities under the IPv6 private network.

CN118802838BActive Publication Date: 2024-12-03WUHAN LAZYMAO WEIFU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411281474.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-03
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

When the operating system detects that the IPv6 public network cannot be accessed, the automatic disabling of AAAA record query results in the inability to access services in the IPv6 private network. The technical bottlenecks brought by different operating systems have defects in the existing solution and cannot effectively solve this problem.

Method used

Determine the target policy according to different operating systems through the preset policy library, enable the AAAA record query function, including using Scutil to configure network information in MacOS, adding static routing rules through VPN services in Android, and setting the IPv6 DNS server address in iOS to Enable AAAA record query.

Benefits of technology

It realizes that when the IPv6 public network is unable to access, the AAAA record query function is adaptively enabled, which improves system flexibility and user experience, enables users to access services under the IPv6 private network, and ensures the reliability and stability of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802838B_ABST
    Figure CN118802838B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and storage medium for accessing addresses in an IPv6 private network, and relates to the field of data communication. The method comprises: determining the current state of the query function of the AAAA record when it is determined that the current network cannot access the IPv6 public network; determining the target policy corresponding to the current operating system from a preset policy library when it is determined that the current state is a disabled state; executing the target policy, enabling the query function of the AAAA record in the current operating system, and accessing the current service in the IPv6 private network through the current domain name; the preset policy library includes the corresponding relationship between the operating system MacOS and the MacOS execution policy, the corresponding relationship between the operating system Android and the Android execution policy, and the corresponding relationship between the operating system iOS and the iOS execution policy. The method of the present invention for accessing IPv6 private network services by enabling the AAAA record query function improves system flexibility and user experience, and enables users to access IPv6 in a specific network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] A method, device, equipment and storage medium for accessing addresses in an IPv6 private network. Background Art

[0002] When the operating system detects that the current network does not have the ability to access the IPv6 public network, it will disable the query of AAAA records to save network traffic. This automatic disabling of AAAA record queries is intended to optimize network performance and reduce traffic consumption. However, this may lead to a problem: even if the current network cannot directly access the IPv6 public network, users may still need to access addresses under the IPv6 private network through VPN and other methods.

[0003] In this case, since AAAA record query is disabled, users will not be able to access services deployed in the IPv6 private network through domain names. This restriction may cause trouble for users who need to access IPv6 private networks, because they will not be able to obtain access rights to services in the IPv6 private network through conventional domain name resolution methods. At the same time, due to different operating systems, when facing the problem of AAAA record query being disabled, it is also necessary to consider the technical bottlenecks brought by different operating systems. Application developers can bypass the problem of the system disabling AAAA record query by performing address queries on their own without relying on the resolver provided by the system. However, this solution may have some defects, including the problem that applications in some restricted environments cannot perform DNS queries on their own, such as firewalls may restrict applications from using the UDP protocol for communication. In addition, performing address queries on your own is only effective for specific applications, and most applications in the system will still use the resolver provided by the system.

[0004] However, there is currently no technical solution that can solve the above technical problems, and there is no method, device, equipment or storage medium for accessing addresses in an IPv6 private network. Summary of the invention

[0005] The present invention provides a method, device, equipment and storage medium for accessing addresses in an IPv6 private network, and solves the problem in the prior art that addresses in an IPv6 private network cannot be accessed by using different target strategies corresponding to different operating systems.

[0006] In a first aspect, the present invention provides a method for accessing an address in an IPv6 private network, comprising:

[0007] When it is determined that the current network cannot access the IPv6 public network, determine the current state of the query function of the AAAA record;

[0008] When it is determined that the current state is a disabled state, determining a target policy for enabling a query function of an AAAA record corresponding to the current operating system from a preset policy library;

[0009] Execute the target policy, enable the query function of the AAAA record in the current operating system, and access the current service in the IPv6 private network through the current domain name;

[0010] The preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0011] According to the method for accessing an address in an IPv6 private network provided by the present invention, when the current operating system is the operating system MacOS, executing the target policy and enabling the query function of the AAAA record in the current operating system includes:

[0012] In MacOS, use the terminal command line tool Scutil to start a temporary session for interactive operations.

[0013] Adding preset parameters in the temporary session, setting the IPv6 address, interface name, and routing information to configure network information;

[0014] Use parameter setting commands to apply the configured network information to the network service.

[0015] According to the method for accessing an address under an IPv6 private network provided by the present invention, after applying the configured network information to the network service using a parameter setting command, the method further includes:

[0016] Execute the query command of DNS configuration information and obtain the returned result;

[0017] When it is determined that the Flags field of the returned result contains preset information Request AAAA records, it is determined that the query function of the AAAA records has been enabled in the current operating system.

[0018] According to the method for accessing an address in an IPv6 private network provided by the present invention, when the current operating system is an Android operating system, executing the target policy and enabling a query function of an AAAA record in the current operating system include:

[0019] Create a VPN service class in the Android application to implement the addRouter method;

[0020] In the addRouter method, the addRoute method of VpnService is called to add a static routing rule to enable the query function of the AAAA record in the current operating system;

[0021] The target address of the static routing rule is the IPv6 DNS server address, and the subnet mask is 128.

[0022] According to the method for accessing an address in an IPv6 private network provided by the present invention, after calling the addRoute method of VpnService to add a static routing rule, the method further includes:

[0023] When it is determined that the current network can access the IPv6 public network, the addRoute method of VpnService is called to delete the static routing rule.

[0024] According to the method for accessing an address in an IPv6 private network provided by the present invention, when the current operating system is an iOS operating system, executing the target policy and enabling a query function of an AAAA record in the current operating system include:

[0025] Calling a network setting page in the operating system iOS, and inputting a preset address in the address of the DNS server in the network setting page to enable a query function of the AAAA record in the current operating system;

[0026] The preset address is the address of the IPv6 DNS server.

[0027] According to the method for accessing an address in an IPv6 private network provided by the present invention, after a preset address is input in the address of the DNS server on the network setting page, the method further comprises:

[0028] Create a DNS forwarder in the iOS operating system to listen to the IPv6 address and forward DNS requests to the upstream DNS server obtained by DHCP;

[0029] In the VPN process of the operating system iOS, the DNS address of the operating system iOS is set as the listening address of the DNS forwarder;

[0030] The server address of the upstream DNS server is obtained at preset time intervals, and when the server address changes, the server address is updated.

[0031] In a second aspect, a device for accessing an address in an IPv6 private network is provided, comprising:

[0032] A first determining unit is used to determine the current state of the query function of the AAAA record when it is determined that the current network cannot access the IPv6 public network;

[0033] A second determining unit is used to determine, when determining that the current state is a disabled state, a target policy for enabling a query function of an AAAA record corresponding to the current operating system from a preset policy library;

[0034] An execution unit, configured to execute the target policy, enable a query function of an AAAA record in a current operating system, and access a current service in an IPv6 private network through a current domain name;

[0035] The preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0036] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for accessing an address under an IPv6 private network when executing the program.

[0037] In a fourth aspect, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for accessing an address under an IPv6 private network is implemented.

[0038] The present invention provides corresponding solutions to the problem that the AAAA record query function of different operating systems is disabled, and can adaptively execute different target strategies according to different operating systems, thereby enabling the query function of the AAAA record, and accessing the current service under the IPv6 private network through the current domain name; the present invention provides a method for accessing the IPv6 private network service by enabling the AAAA record query function when the IPv6 public network cannot be accessed, thereby improving the system flexibility and user experience, enabling users to access IPv6 under a specific network environment, and aiming to solve the problem that the IPv6 private network cannot be accessed under the current system restrictions, thereby realizing access to the address under the IPv6 private network;

[0039] In the operating system MacOS, the present invention executes a DNS configuration information query command after the configuration is completed to ensure that the configuration is successful, thereby improving the reliability and stability of the method; in the operating system Android, a method for enabling the AAAA record query function through a VPN service is provided, and the setting of static routing rules ensures that the DNS query can correctly point to the IPv6 DNS server. When the network can access the IPv6 public network, the previously added static routing rules are deleted to avoid the problem of being unable to access the IPv6 DNS server; in the operating system iOS, it is ensured that the AAAA record query function can still be effectively enabled when using a self-set IPv6 DNS server, and at the same time, the upstream DNS server obtained by DHCP is used as a forwarding path to avoid the problem of network performance delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a flow chart of a method for accessing an address in an IPv6 private network provided by the present invention;

[0042] Figure 2 It is a schematic diagram of the structure of a device for accessing an address in an IPv6 private network provided by the present invention;

[0043] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] Figure 1 The present invention provides a method for accessing an address in an IPv6 private network, wherein the method for accessing an address in an IPv6 private network comprises:

[0046] Step 101: When it is determined that the current network cannot access the IPv6 public network, determine the current state of the query function of the AAAA record;

[0047] Step 102: When it is determined that the current state is a disabled state, determine a target policy corresponding to the current operating system for enabling the query function of the AAAA record from a preset policy library;

[0048] Step 103: Execute the target policy, enable the query function of the AAAA record in the current operating system, and access the current service in the IPv6 private network through the current domain name;

[0049] The preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0050] In step 101, a network diagnostic tool is used to check the current network configuration, including querying the DNS server settings and whether the AAAA record is effective. By confirming that the network cannot access the IPv6 public network, problems with the network itself can be ruled out. When it is determined that the current network cannot access the IPv6 public network, the current state of the AAAA record query function is determined to provide accurate background information for subsequent activation of the function. The current state of the AAAA record query function includes a disabled state and an enabled state.

[0051] In step 102, a correspondence between the operating system MacOS and the MacOS execution policy, a correspondence between the operating system Android and the Android execution policy, and a correspondence between the operating system iOS and the iOS execution policy are pre-constructed, and the preset policy library is constructed according to the above correspondences. According to the information in the preset policy library, the target policy corresponding to the query function of enabling AAAA records of the current operating system is found.

[0052] In step 103, according to the target policy, the corresponding operation is performed in the current operating system to enable the AAAA record query function, and ensure that the domain name resolution can successfully access the services under the IPv6 private network, thereby improving the accessibility and flexibility of the network connection. By gradually checking the current network status, determining the target policy and performing the operation, the current problem of being unable to access the IPv6 public network is effectively solved, and the AAAA record query function is successfully enabled.

[0053] The present invention provides corresponding solution strategies for the problem that the AAAA record query function of different operating systems is disabled, and can adaptively execute different target strategies according to different operating systems, thereby enabling the query function of the AAAA record, and accessing the current service under the IPv6 private network through the current domain name; the present invention provides a general method for accessing the IPv6 private network service by enabling the AAAA record query function when the IPv6 public network cannot be accessed, thereby improving the system flexibility and user experience, enabling the user to access the IPv6 private resources in a specific network environment, and aiming to solve the problem that the IPv6 private network cannot be accessed under the current system limitation, thereby realizing the access to the address under the IPv6 private network.

[0054] Optionally, when the current operating system is an operating system MacOS, executing the target policy to enable a query function of an AAAA record in the current operating system includes:

[0055] In MacOS, use the terminal command line tool Scutil to start a temporary session for interactive operations.

[0056] Adding preset parameters in the temporary session, setting the IPv6 address, interface name, and routing information to configure network information;

[0057] Use parameter setting commands to apply the configured network information to the network service.

[0058] Optionally, the present invention uses the terminal command line tool Scutil to start a temporary session, open the terminal application, and enter the command "scutil" to enter the Scutil command line environment, which is used to configure network information; add preset parameters in the temporary session, set the IPv6 address, interface name and routing information; use the command "set" to set various parameters, such as setting the IPv6 address, interface name and routing information. In an optional embodiment, the IPv6 address, interface name and routing information are set respectively by the commands "d.add Address *fc00::2 / 7", "d.add InterfaceName gif0", and "d.add Router fc00::1" to ensure that the information is accurate.

[0059] Optionally, in this embodiment, the configured network information is applied to the network service using a parameter setting command. The command "d.init" is used to initialize the network configuration; the command "d.add" is used to add the configured network information; and the command "set State: / Network / Service / utun0 / IPv6" is used to apply the IPv6 settings to the global network configuration to ensure that the IPv6 address and routing information take effect correctly. In this embodiment, the Scutil command-line tool is used to configure the IPv6 address, interface name, and routing information in the MacOS system and apply them to the network service to enable the IPv6 address query function, allowing users to access services under the IPv6 private network.

[0060] Optionally, "set State: / Network / Service / utun0 / IPv6" is used to set the IPv6-related parameters of a specific network service in the MacOS system. Specifically, this command uses the scutil tool to set the IPv6 status of a network service "utun0" to a specific value or status. In this case, "utun0" represents a virtual network interface (tun device) used to establish a VPN connection or other types of network tunnels. By setting the value of "State: / Network / Service / utun0 / IPv6", the status of the IPv6 protocol of this virtual network interface can be configured, including enabling or disabling IPv6, setting the IPv6 address, etc.

[0061] Optionally, at the beginning of the query, enter "$ scutil<<EOF", which is a terminal command used to start a shell session in the MacOS system and execute a series of commands in this session until EOF (End of File) is encountered. During this process, the user can enter a series of commands, and these commands will be executed in sequence and the session will end at EOF.

[0062] Optionally, after applying the configured network information to the network service using the parameter setting command, the method further includes:

[0063] Executing a query command for DNS configuration information and obtaining the return result;

[0064] When it is determined that the Flags field of the return result contains the preset information "Request AAAA records", it is determined that the query function for AAAA records is enabled in the current operating system.

[0065] Optionally, in addition to being able to apply the configured network information to the network service, thereby determining that the query function of the AAAA record has been enabled in the current operating system, the present invention also includes executing a query command for the DNS configuration information and analyzing the returned result to confirm whether the query function of the AAAA record has been successfully enabled. Specifically, by executing the "scutil --dns" command, the current DNS configuration information can be queried and the corresponding returned result can be obtained. The returned result will contain detailed information about the DNS configuration, including the identification of the DNS server, the domain name search list, and the request type, etc., and confirm that the Flags field in the returned result contains the preset information "Request AAAA records". If this information exists, it means that the query function of the AAAA record has been successfully enabled. "Request AAAA records" means that the operating system will request the AAAA record corresponding to the IPv6 address when performing a DNS query, thereby achieving access to the IPv6 private network. By executing the DNS configuration information query command and confirming that the Flags field of the returned result contains the "Request AAAA records" information, it can be effectively verified whether the query function of the AAAA record has been successfully enabled in the current operating system, which is an important link to ensure the effectiveness and correctness of the network settings and verify the real-time effectiveness of the network configuration.

[0066] Optionally, when the current operating system is an Android operating system, executing the target policy to enable a query function of an AAAA record in the current operating system includes:

[0067] Create a VPN service class in the Android application to implement the addRouter method;

[0068] In the addRouter method, the addRoute method of VpnService is called to add a static routing rule to enable the query function of the AAAA record in the current operating system;

[0069] The target address of the static routing rule is the IPv6 DNS server address, and the subnet mask is 128.

[0070] Optionally, it can be seen from the AOSP source code that Android enables / disables AAAA record queries by detecting whether there are routing rules to the Google IPv6DNS server. The present invention creates a VPN service class inherited from VpnService in the Android application to handle VPN connections and network routing settings. The addRouter method is implemented in the created VPN service class. The method is used to add static routing rules to enable the query function of the AAAA record. In the addRouter method, static routing rules are added by calling the addRoute method of the VpnService class. The addRoute method is used to add the target address as the IPv6 DNS server address and the subnet mask as 128 to ensure that all IPv6 traffic passes through the static route. Through the above steps, a VPN service class is created and enabled in the Android operating system, and the addRouter method is implemented therein to add static routing rules, so that the query function of enabling the AAAA record can be realized.

[0071] Optionally, after calling the addRoute method of VpnService to add a static routing rule, the method further includes:

[0072] When it is determined that the current network can access the IPv6 public network, the addRoute method of VpnService is called to delete the static routing rule.

[0073] Optionally, the VPN program needs to implement a monitoring mechanism for changes in the network environment so as to monitor changes in the user's network status in real time, including changes in the IPv6 public network access capability. When the network status changes, the VPN program needs to detect whether the current network has the ability to access the IPv6 public network, which can be detected by sending a Ping request to the IPv6 DNS server. If the current network environment confirms that it has the ability to access the IPv6 public network, that is, the user actually has the ability to access IPv6, the VPN program should delete the previously added static routing rules to avoid problems such as accessing the IPv6 DNS server. By implementing the above technical solution, the VPN program can dynamically add or delete static routing rules according to the user's actual IPv6 public network access capability, thereby ensuring that the user can normally access services such as the IPv6 DNS server when he has the IPv6 access capability, avoiding access problems caused by static routing rules, and enabling the VPN program to have network adaptability and intelligent processing capabilities, and can better adapt to IPv6 access requirements under different network environments.

[0074] Optionally, when the current operating system is an iOS operating system, executing the target policy to enable a query function of an AAAA record in the current operating system includes:

[0075] Calling a network setting page in the operating system iOS, and inputting a preset address in the address of the DNS server in the network setting page to enable a query function of the AAAA record in the current operating system;

[0076] The preset address is the address of the IPv6 DNS server.

[0077] Optionally, in response to the need to enable the AAAA record query function under the iOS operating system, the target strategy can be achieved by calling the network settings page in iOS and entering the preset address of the IPv6 DNS server address in the DNS server address. In an optional embodiment, the user can manually open the settings page of the iOS device, find the Wi-Fi option, and then click on the currently connected Wi-Fi network. In the detailed information page of the Wi-Fi network, the user can find the input box of the DNS server address for configuring a specific DNS server address. In the input box of the DNS server address, the user can enter the preset IPv6 DNS server address, so that the system will enable the AAAA record query function when performing DNS resolution. Make sure to save the settings after entering the IPv6 DNS server address, and perform some network operations to test whether the system has successfully enabled the AAAA record query function. By setting the preset IPv6 DNS server address in the iOS device, the AAAA record query function can be enabled, thereby improving the utilization of IPv6 network resources and user experience.

[0078] Optionally, after inputting a preset address in the address of the DNS server on the network setting page, the method further includes:

[0079] Create a DNS forwarder in the iOS operating system to listen to the IPv6 address and forward DNS requests to the upstream DNS server obtained by DHCP;

[0080] In the VPN process of the operating system iOS, the DNS address of the operating system iOS is set as the listening address of the DNS forwarder;

[0081] The server address of the upstream DNS server is obtained at preset time intervals, and when the server address changes, the server address is updated.

[0082] This embodiment aims to solve the problem of network performance loss that may be caused by setting up a DNS server by yourself by implementing a simple DNS Forwarder on an iOS device. The DNS Forwarder will monitor the IPv6 address and forward the DNS request to the upstream DNS server obtained through DHCP. At the same time, within the VPN process, the system's DNS address is set to the monitored address. At the same time, the address of the upstream DNS server is obtained regularly so that it can be updated in time when the address changes.

[0083] Specifically, it monitors the IPv6 address and forwards the DNS request to the upstream DNS server obtained by DHCP after receiving it. In the VPN process, the system's DNS address is set as the listening address of the DNS Forwarder to ensure that all DNS requests are processed by the DNS Forwarder. The acquisition mechanism is preset, that is, the address of the upstream DNS server is obtained at regular intervals and updated in time when the address changes, so as to realize the function of monitoring changes in the network environment. When the network environment changes, the address of the upstream DNS server is updated in time and the forwarding process of the DNS Forwarder is adjusted accordingly.

[0084] The present invention avoids the performance loss caused by the self-set DNS server by using a self-implemented DNS Forwarder, thereby improving network access efficiency; regularly obtains and updates the address of the upstream DNS server, ensuring that the most suitable DNS server is always used, thereby improving DNS resolution efficiency; and monitors changes in the network environment and dynamically updates the DNS server address, so that the system can better adapt to changes in different network environments and improve the stability and reliability of network connections.

[0085] The present invention provides a method for enabling or disabling the query function of AAAA records in different operating systems, thereby realizing address access in IPv6 private networks.

[0086] The target policies under different operating systems are determined by the preset policy library. By defining the preset policy library and corresponding execution policies of different operating systems, unified behavior can be achieved on multiple operating systems, which improves the cross-platform applicability. By enabling the query function of the AAAA record, users can access the services under the IPv6 private network more smoothly, which improves the overall network experience. Through the guidance of the preset policy library and the target policy, the operation process of enabling the AAAA record query function by the user is simplified, and the complexity of the configuration is reduced. The present invention combines the preset policy library and the target policy to make it easier and more effective to enable the AAAA record query function for different operating systems in the IPv6 private network environment, improve the access efficiency and network experience, and also enhance the reliability and continuity of the service.

[0087] Figure 2 It is a structural diagram of the device for accessing an address under an IPv6 private network provided by the present invention. The device for accessing an address under an IPv6 private network includes a first determination unit 1, which is used to determine the current state of the query function of the AAAA record when it is determined that the current network cannot access the IPv6 public network. The working principle of the first determination unit 1 can refer to the aforementioned step 101 and will not be repeated again.

[0088] The device for accessing an address under an IPv6 private network also includes a second determination unit 2, which is used to determine, when it is determined that the current state is a disabled state, a target policy for enabling the query function of the AAAA record of the current operating system from a preset policy library. The working principle of the second determination unit 2 can refer to the aforementioned step 102 and will not be repeated here.

[0089] The device for accessing the address under the IPv6 private network also includes an execution unit 3, which is used to execute the target policy, enable the query function of the AAAA record in the current operating system, and access the current service under the IPv6 private network through the current domain name. The working principle of the execution unit 3 can refer to the aforementioned step 103 and will not be repeated again.

[0090] The preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0091] The present invention provides corresponding solutions to the problem that the AAAA record query function of different operating systems is disabled, and can adaptively execute different target strategies according to different operating systems, thereby enabling the query function of the AAAA record, and accessing the current service under the IPv6 private network through the current domain name; the present invention provides a general method for accessing IPv6 private network services by enabling the AAAA record query function when the IPv6 public network cannot be accessed, thereby improving system flexibility and user experience, enabling users to access IPv6 private resources under a specific network environment, and aims to solve the problem that the IPv6 private network cannot be accessed under the current system restrictions, thereby realizing access to addresses under the IPv6 private network;

[0092] In the operating system MacOS, the present invention executes a DNS configuration information query command after the configuration is completed to ensure that the configuration is successful, thereby improving the reliability and stability of the method; in the operating system Android, a method for enabling the AAAA record query function through a VPN service is provided, and the setting of static routing rules ensures that the DNS query can correctly point to the IPv6 DNS server. When the network can access the IPv6 public network, the previously added static routing rules are deleted to avoid the problem of being unable to access the IPv6 DNS server; in the operating system iOS, it is ensured that the AAAA record query function can still be effectively enabled when using a self-set IPv6 DNS server, and at the same time, the upstream DNS server obtained by DHCP is used as a forwarding path to avoid the problem of network performance delay.

[0093] Figure 3 Schematic diagram of the structure of the electronic device provided by the present invention. Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a method for accessing an address under an IPv6 private network, the method comprising: determining the current state of the query function of the AAAA record when it is determined that the current network cannot access the IPv6 public network; determining the target policy corresponding to the current operating system for enabling the query function of the AAAA record from a preset policy library when it is determined that the current state is disabled; executing the target policy, enabling the query function of the AAAA record in the current operating system, and accessing the current service under the IPv6 private network through the current domain name; the preset policy library includes the corresponding relationship between the operating system MacOS and the MacOS execution policy, the corresponding relationship between the operating system Android and the Android execution policy, and the corresponding relationship between the operating system iOS and the iOS execution policy.

[0094] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a method for accessing an address under an IPv6 private network provided by the above-mentioned methods, the method including: when it is determined that the current network cannot access the IPv6 public network, determining the current state of the query function of the AAAA record; when it is determined that the current state is disabled, determining from a preset policy library a target policy for enabling the query function of the AAAA record corresponding to the current operating system; executing the target policy, enabling the query function of the AAAA record in the current operating system, and accessing the current service under the IPv6 private network through the current domain name; the preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for accessing an address under an IPv6 private network provided by the above-mentioned methods, the method comprising: when it is determined that the current network cannot access the IPv6 public network, determining the current state of the query function of the AAAA record; when it is determined that the current state is a disabled state, determining from a preset policy library a target policy for enabling the query function of the AAAA record corresponding to the current operating system; executing the target policy, enabling the query function of the AAAA record in the current operating system, and accessing the current service under the IPv6 private network through the current domain name; the preset policy library includes the correspondence between the operating system MacOS and the MacOS execution policy, the correspondence between the operating system Android and the Android execution policy, and the correspondence between the operating system iOS and the iOS execution policy.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for accessing an address in an IPv6 private network, characterized in that: include: When it is determined that the current network cannot access the IPv6 public network, determine the current state of the query function of the AAAA record; When it is determined that the current state is a disabled state, determining a target policy for enabling a query function of an AAAA record corresponding to the current operating system from a preset policy library; Execute the target policy, enable the query function of the AAAA record in the current operating system, and access the current service in the IPv6 private network through the current domain name; The preset policy library includes the corresponding relationship between the operating system MacOS and the MacOS execution policy, the corresponding relationship between the operating system Android and the Android execution policy, and the corresponding relationship between the operating system iOS and the iOS execution policy; In the case where the current operating system is the operating system MacOS, executing the target policy to enable the query function of the AAAA record in the current operating system includes: In MacOS, use the terminal command line tool Scutil to start a temporary session for interactive operations. Adding preset parameters in the temporary session, setting the IPv6 address, interface name, and routing information to configure network information; Use parameter setting commands to apply the configured network information to the network service.

2. The method for accessing an address in an IPv6 private network according to claim 1, characterized in that: After applying the configured network information to the network service using the parameter setting command, the method further includes: Execute the query command of DNS configuration information and obtain the returned result; When it is determined that the Flags field of the returned result contains preset information Request AAAA records, it is determined that the query function of the AAAA records has been enabled in the current operating system.

3. The method for accessing an address in an IPv6 private network according to claim 1, characterized in that: In the case where the current operating system is an Android operating system, executing the target policy to enable a query function of an AAAA record in the current operating system includes: Create a VPN service class in the Android application to implement the addRouter method; In the addRouter method, the addRoute method of VpnService is called to add a static routing rule to enable the query function of the AAAA record in the current operating system; The target address of the static routing rule is the IPv6 DNS server address, and the subnet mask is 128.

4. The method for accessing an address in an IPv6 private network according to claim 3, characterized in that: After calling the addRoute method of VpnService to add the static routing rule, the method further includes: When it is determined that the current network can access the IPv6 public network, the addRoute method of VpnService is called to delete the static routing rule.

5. The method for accessing an address in an IPv6 private network according to claim 1, characterized in that: In the case where the current operating system is an iOS operating system, executing the target policy to enable a query function of an AAAA record in the current operating system includes: Calling a network setting page in the operating system iOS, and inputting a preset address in the address of the DNS server in the network setting page to enable a query function of the AAAA record in the current operating system; The preset address is the address of the IPv6 DNS server.

6. The method for accessing an address in an IPv6 private network according to claim 5, characterized in that: After inputting a preset address in the address of the DNS server on the network setting page, the method further includes: Create a DNS forwarder in the iOS operating system to listen to the IPv6 address and forward DNS requests to the upstream DNS server obtained by DHCP; In the VPN process of the operating system iOS, the DNS address of the operating system iOS is set as the listening address of the DNS forwarder; The server address of the upstream DNS server is obtained at preset time intervals, and when the server address changes, the server address is updated.

7. A device for accessing an address in an IPv6 private network, characterized in that: include: A first determining unit is used to determine the current state of the query function of the AAAA record when it is determined that the current network cannot access the IPv6 public network; A second determining unit is used to determine, when determining that the current state is a disabled state, a target policy for enabling a query function of an AAAA record corresponding to the current operating system from a preset policy library; An execution unit, configured to execute the target policy, enable a query function of an AAAA record in a current operating system, and access a current service in an IPv6 private network through a current domain name; The preset policy library includes the corresponding relationship between the operating system MacOS and the MacOS execution policy, the corresponding relationship between the operating system Android and the Android execution policy, and the corresponding relationship between the operating system iOS and the iOS execution policy; In the case where the current operating system is the operating system MacOS, executing the target policy to enable the query function of the AAAA record in the current operating system includes: In MacOS, use the terminal command line tool Scutil to start a temporary session for interactive operations. Adding preset parameters in the temporary session, setting the IPv6 address, interface name, and routing information to configure network information; Use parameter setting commands to apply the configured network information to the network service.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for accessing an address in an IPv6 private network as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for accessing an address in an IPv6 private network as claimed in any one of claims 1 to 6 is implemented.