So rather a strange problem occurred today. I woke up and heard complain that some sites aren’t accelerable from my network. Especially www.youtube.com. For some reason the dns wasn’t being resolved, but only for few domains.
dig @192.168.1.1 www.google.com
; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> @192.168.1.1 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56004
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 231 IN A 172.217.167.132
;; Query time: 1 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Jun 22 19:11:50 +06 2020
;; MSG SIZE rcvd: 48
–
dig @192.168.1.1 www.youtube.com
; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> @192.168.1.1 www.youtube.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
–
dig @8.8.8.8 www.youtube.com
; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> @8.8.8.8 www.youtube.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61986
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.youtube.com. IN A
;; ANSWER SECTION:
www.youtube.com. 21388 IN CNAME youtube-ui.l.google.com.
youtube-ui.l.google.com. 88 IN A 216.58.200.142
youtube-ui.l.google.com. 88 IN A 172.217.167.142
youtube-ui.l.google.com. 88 IN A 172.217.160.142
youtube-ui.l.google.com. 88 IN A 216.58.196.174
youtube-ui.l.google.com. 88 IN A 172.217.163.46
youtube-ui.l.google.com. 88 IN A 172.217.163.78
youtube-ui.l.google.com. 88 IN A 172.217.163.142
;; Query time: 72 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Jun 22 19:12:13 +06 2020
;; MSG SIZE rcvd: 190
192.168.1.1 is my router - RB750Gr3. What is really interesting that during this time both cache-size and cache-used in /ip dns was 2048KiB. But /ip dns cache had only 3-4 entries and reverted to empty in 1 sec interval. I tried flush cache multiple times. No avail. cache-used is still 2048KiB and no meaningful entry was being added to cache. Then I doubled cache-size to 4096KiB, and instantly cache-used became 4096KiB too. But still ip dns cache is broken.
Then I restarted the router and suddenly everything is fixed. Every domain is resolving correctly. cache-used isn’t full anymore. Right now cache has 302 items and cache-used is only 183KiB.
Now my question is what caused this problem? It was clear the dns service was somehow broken/corrupted? As cache-used being 100% size with only 3-4 entries. Is there any other way to clear/restart dns service other than router reboot? I’ve been running this router for years and never had this problem. I upgraded to 6.47 recently (I always keep up to date with stable channel). And I configured DoH.
My current DNS setting
[admin@GittuTik] /ip dns> print
servers: 8.8.8.8,8.8.4.4
dynamic-servers: 103.86.96.100,103.86.99.100
use-doh-server: https://dns.google/dns-query
verify-doh-cert: yes
allow-remote-requests: yes
max-udp-packet-size: 4096
query-server-timeout: 10s
query-total-timeout: 15s
max-concurrent-queries: 100
max-concurrent-tcp-sessions: 20
cache-size: 4096KiB
cache-max-ttl: 1w
cache-used: 183KiB