knadh / dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.
https://www.dns.toys
MIT License
2.5k stars 137 forks source link

Wrong data on the first query for weather #68

Closed rozie closed 10 months ago

rozie commented 10 months ago

Today (Sun Jan 07 2024) I performed two queries about weather. The first one showed data for Wed/Thu. The second one, made several seconds later, showed proper data. I checked several other cities - all seem to have the same issue. Looks like some kind of cache issue for me.

First one:

dig poznan.weather @dns.toys

; <<>> DiG 9.19.19-1-Debian <<>> poznan.weather @dns.toys
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52372
;; flags: qr rd; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;poznan.weather.            IN  A

;; ANSWER SECTION:
poznan.         1   IN  TXT "Poznan (PL)" "0.40C (32.72F)" "98.10% hu." "cloudy" "22:00, Wed"
poznan.         1   IN  TXT "Poznan (PL)" "0.50C (32.90F)" "96.30% hu." "cloudy" "00:00, Thu"
poznan.         1   IN  TXT "Poznan (PL)" "0.40C (32.72F)" "95.50% hu." "cloudy" "02:00, Thu"
poznan.         1   IN  TXT "Poznan (PL)" "0.20C (32.36F)" "95.20% hu." "lightsnow" "04:00, Thu"
poznan.         1   IN  TXT "Poznan (PL)" "0.00C (32.00F)" "94.80% hu." "snow" "06:00, Thu"

;; Query time: 136 msec
;; SERVER: 204.48.19.68#53(dns.toys) (UDP)
;; WHEN: Sun Jan 07 09:04:55 CET 2024
;; MSG SIZE  rcvd: 403

Second one:

dig poznan.weather @dns.toys

; <<>> DiG 9.19.19-1-Debian <<>> poznan.weather @dns.toys
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9946
;; flags: qr rd; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;poznan.weather.            IN  A

;; ANSWER SECTION:
poznan.         1   IN  TXT "Poznan (PL)" "-6.20C (20.84F)" "63.40% hu." "cloudy" "10:00, Sun"
poznan.         1   IN  TXT "Poznan (PL)" "-6.20C (20.84F)" "59.70% hu." "cloudy" "12:00, Sun"
poznan.         1   IN  TXT "Poznan (PL)" "-6.70C (19.94F)" "59.10% hu." "cloudy" "14:00, Sun"
poznan.         1   IN  TXT "Poznan (PL)" "-7.60C (18.32F)" "61.80% hu." "cloudy" "16:00, Sun"
poznan.         1   IN  TXT "Poznan (PL)" "-8.00C (17.60F)" "62.20% hu." "cloudy" "18:00, Sun"

;; Query time: 104 msec
;; SERVER: 204.48.19.68#53(dns.toys) (UDP)
;; WHEN: Sun Jan 07 09:05:18 CET 2024
;; MSG SIZE  rcvd: 407
knadh commented 10 months ago

Hi @rozie. The weather data is cached based on queries to be under the weather service's API rate limits. If there are many regular queries for a certain location, it's data will be up-to-date. Ponzan wouldn't have received any queries in the last few days, which is why it showed you the last fetched data when you queried (and updated it in the background).