Alfis
Alfis copied to clipboard
Fix some errors in resolving
A report shows that ALFIS' resolver is not so consistent at times:
# dig ya.ru @318:1a0f:f6fd:77c::53
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> ya.ru @318:1a0f:f6fd:77c::53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 290
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 4
;; QUESTION SECTION:
;ya.ru. IN A
;; ANSWER SECTION:
ya.ru. 600 IN A 87.250.250.242
;; AUTHORITY SECTION:
ya.ru. 345600 IN NS ns2.yandex.ru.
ya.ru. 345600 IN NS ns1.yandex.ru.
;; ADDITIONAL SECTION:
ns1.yandex.ru. 345600 IN A 213.180.193.1
ns2.yandex.ru. 345600 IN A 93.158.134.1
ns1.yandex.ru. 345600 IN AAAA 2a02:6b8::1
ns2.yandex.ru. 345600 IN AAAA 2a02:6b8:0:1::1
;; Query time: 301 msec
;; SERVER: 318:1a0f:f6fd:77c::53#53(318:1a0f:f6fd:77c::53)
;; WHEN: Wed Apr 14 18:35:20 UTC 2021
;; MSG SIZE rcvd: 170
# dig ya.ru @318:1a0f:f6fd:77c::53
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> ya.ru @318:1a0f:f6fd:77c::53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3749
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ya.ru. IN A
;; ANSWER SECTION:
ya.ru. 600 IN A 87.250.250.242
;; Query time: 0 msec
;; SERVER: 318:1a0f:f6fd:77c::53#53(318:1a0f:f6fd:77c::53)
;; WHEN: Wed Apr 14 18:35:26 UTC 2021
;; MSG SIZE rcvd: 39
But there is another possible solution - change DNS code to some decent library instead of Hermes DNS server.
I've checked it thoroughly, and it seems to me, that dig has some sort of cache.
Subsequent requests by nslookup are showing consistent results.
Can it be that reason is DNS cookies?
# dig ya.ru
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> ya.ru
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38901
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 463290231e49e8a03f1280c66079e58d9d0e7fe945bd9e64 (good)
;; QUESTION SECTION:
;ya.ru. IN A
;; ANSWER SECTION:
ya.RU. 600 IN A 87.250.250.242
;; AUTHORITY SECTION:
ya.RU. 345600 IN NS ns1.yandex.ru.
ya.RU. 345600 IN NS ns2.yandex.ru.
;; ADDITIONAL SECTION:
ns1.yandex.RU. 345600 IN A 213.180.193.1
ns2.yandex.RU. 345600 IN A 93.158.134.1
ns1.yandex.RU. 345600 IN AAAA 2a02:6b8::1
ns2.yandex.RU. 345600 IN AAAA 2a02:6b8:0:1::1
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Apr 16 19:29:17 UTC 2021
;; MSG SIZE rcvd: 229
# dig ya.ru
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> ya.ru
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42698
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: e66f4cf3c7363f302c21cda46079e592377074d046ffaccd (good)
;; QUESTION SECTION:
;ya.ru. IN A
;; ANSWER SECTION:
ya.ru. 600 IN A 87.250.250.242
;; AUTHORITY SECTION:
YA.RU. 345600 IN NS ns1.yandex.RU.
YA.RU. 345600 IN NS ns2.yandex.RU.
;; ADDITIONAL SECTION:
ns1.yandex.RU. 345595 IN A 213.180.193.1
ns2.yandex.RU. 345595 IN A 93.158.134.1
ns1.yandex.RU. 345595 IN AAAA 2a02:6b8::1
ns2.yandex.RU. 345595 IN AAAA 2a02:6b8:0:1::1
;; Query time: 303 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Apr 16 19:29:22 UTC 2021
;; MSG SIZE rcvd: 214