CPC H04L 61/4511 (2022.05) [H04L 61/5053 (2022.05); H04L 61/58 (2022.05)] | 20 Claims |
1. A method for implementing a last known good (LKG) client-side cache for domain name system (DNS) resiliency, said method being performed by a local host implementing a DNS client that includes both the LKG cache and a DNS cache, said method being implemented by a dynamic link library that is embedded in an operating system of the local host and comprising:
submitting a first DNS request to a DNS server, where the first DNS request is a request for the DNS server to resolve an Internet Protocol (IP) address for a domain name that is included in the first DNS request;
receiving, from the DNS server, a first DNS resolution that resolves the IP address for the domain name;
determining that an existing DNS resolution, which resolves the IP address for the domain, is already stored in the LKG cache, wherein the existing DNS resolution is stored in the LKG cache with a timestamp;
while retaining the existing DNS resolution in the LKG cache, updating the timestamp to reflect a time when the first DNS resolution was received, wherein the LKG cache is residing on the local host, and wherein the LKG cache persistently stores the updated timestamp and the existing DNS resolution;
in addition to updating the timestamp in the LKG cache, storing the first DNS resolution in the DNS cache, which is also residing on the local host, wherein the DNS cache non-persistently stores the first DNS resolution;
preparing a second DNS request, where the second DNS request is a subsequent request to again resolve the IP address for the domain name, which is included in the second DNS request;
querying the DNS cache to determine whether the DNS cache still includes the first DNS resolution;
determining that the DNS cache currently does not include the first DNS resolution;
submitting the second DNS request to the DNS server;
in response to determining that a second DNS resolution for the second DNS request has not been received from the DNS server, obtaining the IP address for the domain name from the LKG cache, which persistently stored the existing DNS resolution, wherein the IP address is obtained using the existing DNS resolution, wherein the IP address is obtained based on a determination that the existing DNS resolution is fresh based on the updated timestamp, and wherein determining that the existing DNS resolution is fresh based on the updated timestamp includes determining that an age of the timestamp does not exceed an age as specified by an eviction policy; and
using the IP address, which was obtained from the LKG cache, to connect the local host with a system associated with the IP address.
|