Electronic device and method for DNS processing
First Claim
1. A method for a Domain Name System (DNS) processing between a DNS server and an electronic device, wherein the electronic device comprises a processor and a local DNS cache, and the method is executed by the processor of the electronic device, comprising:
- receiving a DNS query from an application;
generating and storing a plurality of time-to-live (TTL) values corresponding to a first entry in the local DNS cache based on a first response which is provided by the DNS server, wherein each of the TTL values respectively corresponds to one of a plurality of operating states of the electronic device;
identifying a current operating state of the electronic device, wherein the current operating state is one of the plurality of operating states of the electronic device;
identifying a TTL value corresponding to the identified current operating state of the electronic device, wherein the identified TTL value is one of the plurality of TTL values;
determining whether to remove the first entry from the local DNS cache in the electronic device or not according to the identified TTL value corresponding to the identified current operating state of the electronic device;
if the first entry is determined not to be removed, returning a result to the DNS query according to the first entry in the local DNS cache,if the first entry is determined to be removed, sending the DNS query to the DNS server;
receiving a second response to the sent DNS query from the DNS server; and
adding a second entry into the local DNS cache according to the second response, and returning a result of the DNS query to the application according to the received second response,wherein the step of determining whether to remove the first entry from the local DNS cache or not comprises;
calculating a first expiration time of the first entry in the local DNS cache according to the identified TTL value corresponding to the identified current operating state of the electronic device, wherein the first expiration time of the entry corresponds to the identified current operating state of the electronic device;
determining whether a current time is later than the first expiration time of the entry; and
removing the first entry from the local DNS cache if the current time is later than the first expiration time of the entry.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for DNS processing is provided. The method is executed by an electronic device and includes the following steps: determining a plurality of TTL values, wherein each of the TTL values corresponds to one of a plurality of operating states of the electronic device, and determining whether to remove an entry from a local DNS cache in the electronic device or not according to the TTL value corresponding to the current state among the operating states of the electronic device.
-
Citations
20 Claims
-
1. A method for a Domain Name System (DNS) processing between a DNS server and an electronic device, wherein the electronic device comprises a processor and a local DNS cache, and the method is executed by the processor of the electronic device, comprising:
-
receiving a DNS query from an application; generating and storing a plurality of time-to-live (TTL) values corresponding to a first entry in the local DNS cache based on a first response which is provided by the DNS server, wherein each of the TTL values respectively corresponds to one of a plurality of operating states of the electronic device; identifying a current operating state of the electronic device, wherein the current operating state is one of the plurality of operating states of the electronic device; identifying a TTL value corresponding to the identified current operating state of the electronic device, wherein the identified TTL value is one of the plurality of TTL values; determining whether to remove the first entry from the local DNS cache in the electronic device or not according to the identified TTL value corresponding to the identified current operating state of the electronic device; if the first entry is determined not to be removed, returning a result to the DNS query according to the first entry in the local DNS cache, if the first entry is determined to be removed, sending the DNS query to the DNS server; receiving a second response to the sent DNS query from the DNS server; and adding a second entry into the local DNS cache according to the second response, and returning a result of the DNS query to the application according to the received second response, wherein the step of determining whether to remove the first entry from the local DNS cache or not comprises; calculating a first expiration time of the first entry in the local DNS cache according to the identified TTL value corresponding to the identified current operating state of the electronic device, wherein the first expiration time of the entry corresponds to the identified current operating state of the electronic device; determining whether a current time is later than the first expiration time of the entry; and removing the first entry from the local DNS cache if the current time is later than the first expiration time of the entry. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. An electronic device for a Domain Name System (DNS) processing between a DNS server and an electronic device, comprising:
-
a storage device, storing a local DNS cache; and a controller, coupled to the storage device, wherein the controller is configured to receive a DNS query from an application, wherein the controller is configured to generate and store a plurality of time-to-live (TTL) values corresponding to a first entry in the local DNS cache based on a first response which is provided by the DNS server, wherein each of the TTL values respectively corresponds to one of a plurality of operating states of the electronic device, identify a current operating state of the electronic device, wherein the current operating state is one of the plurality of operating states of the electronic device, identify a TTL value corresponding to the identified current operating state of the electronic device, wherein the identified TTL value is one of the plurality of TTL values, wherein the controller is further configured to determine whether to remove the first entry from the local DNS cache or not according to the identified TTL value corresponding to the identified current operating state of the electronic device, wherein if the first entry is determined not to be removed, the controller is further configured to return a result to the DNS query according to the first entry in the local DNS cache, wherein if the first entry is determined to be removed from the local DNS cache, the controller is further configured to send the DNS query to the DNS server, wherein the controller is further configured to receive a response to the sent DNS query from the DNS server, wherein the controller is further configured to add a second entry into the local DNS cache, and return a result of the DNS query to the application according to the received response, wherein the in the operation of determining whether to remove the first entry from the local DNS cache or not, the controller calculates a first expiration time of the first entry in the local DNS cache according to the identified TTL value corresponding to the identified current operating state of the electronic device, wherein the first expiration time of the entry corresponds to the identified current operating state of the electronic device, and the controller determines whether a current time is later than the first expiration time of the entry, wherein the controller removes the first entry from the local DNS cache if the current time is later than the first expiration time of the entry. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
-
Specification