I've run some database queries for the domain ctldl.windowsupdate.com.
You have a copy of my database (see PM), so you can run the same queries on a (renamed) database file.
There are 3 windows machines (2x win10, 1xwin7) in use. On al the devices, the OS apparently requests info for ctldl.windowsupdate.com. The problem (sometimes blocked, sometimes allowed) exists on all devices, so I assume it is not device related.
On the pihole-FTL.db, queries table, I ran the following database query:
select * from queries where domain="ctldl.windowsupdate.com";
The type field indicates both A (type 1) and AAAA (type 2) queries are registred.
The status field indicates two results, Permitted + forwarded (status 2) and unknown status 9 (The documentation isn't up to date yet). I assume this value indicates blocked due to CNAME. The status 9 entries always have NULL as the forward value, I assume this means the query is never forwarded to unbound and pihole-FTL returns 0.0.0.0.
FIRST CONCLUSION (but I may be wrong):
I assume the domain ctldl.windowsupdate.com always triggers CNAME detection, in fact I assume ALL domains trigger CNAME detection, if the domain passes the whitelist, blacklist, gravity and regex tests. Since the status is sometimes 2 (Permitted and forwarded) and sometimes 9 (blocked due to CNAME), This would mean the CNAME logic is NOT always comming up with the same result.
I've checked the dig results for the domain ctldl.windowsupdate.com, resolved using unbound, thus bypassing pihole-FTL. The result for the A and AAAA queries are different:
- A query: audownload.windowsupdate.nsatc.net. 0 IN CNAME au.download.windowsupdate.com.hwcdn.net.
- AAAA query: audownload.windowsupdate.nsatc.net. 0 IN CNAME au.download.windowsupdate.com.edgesuite.net.
however, the result is always an A or AAAA address, none of the domains are in a blocklist (I don't really know if pihole -q also checks the regex entries, to determine if a domain is blocked or allowed)
pi@raspberrypi:~ $ dig @fdaa:bbcc:ddee:2::5552 -p 5552 A ctldl.windowsupdate.com
; <<>> DiG 9.11.5-P4-5.1-Raspbian <<>> @fdaa:bbcc:ddee:2::5552 -p 5552 A ctldl.windowsupdate.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41440
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;ctldl.windowsupdate.com. IN A
;; ANSWER SECTION:
ctldl.windowsupdate.com. 2484 IN CNAME audownload.windowsupdate.nsatc.net.
audownload.windowsupdate.nsatc.net. 0 IN CNAME au.download.windowsupdate.com.hwcdn.net.
au.download.windowsupdate.com.hwcdn.net. 2484 IN CNAME cds.d2s7q6s2.hwcdn.net.
cds.d2s7q6s2.hwcdn.net. 0 IN A 205.185.216.42
cds.d2s7q6s2.hwcdn.net. 0 IN A 205.185.216.10
;; Query time: 6 msec
;; SERVER: fdaa:bbcc:ddee:2::5552#5552(fdaa:bbcc:ddee:2::5552)
;; WHEN: Mon Feb 03 10:04:01 CET 2020
;; MSG SIZE rcvd: 209
pi@raspberrypi:~ $ dig @fdaa:bbcc:ddee:2::5552 -p 5552 AAAA ctldl.windowsupdate.com
; <<>> DiG 9.11.5-P4-5.1-Raspbian <<>> @fdaa:bbcc:ddee:2::5552 -p 5552 AAAA ctldl.windowsupdate.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21451
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;ctldl.windowsupdate.com. IN AAAA
;; ANSWER SECTION:
ctldl.windowsupdate.com. 2463 IN CNAME audownload.windowsupdate.nsatc.net.
audownload.windowsupdate.nsatc.net. 0 IN CNAME au.download.windowsupdate.com.edgesuite.net.
au.download.windowsupdate.com.edgesuite.net. 0 IN CNAME a767.dscg3.akamai.net.
a767.dscg3.akamai.net. 0 IN AAAA 2a02:26f0:ed::5c7a:352b
a767.dscg3.akamai.net. 0 IN AAAA 2a02:26f0:ed::5c7a:3512
;; Query time: 6 msec
;; SERVER: fdaa:bbcc:ddee:2::5552#5552(fdaa:bbcc:ddee:2::5552)
;; WHEN: Mon Feb 03 10:04:22 CET 2020
;; MSG SIZE rcvd: 242
I than checked wheter any of the CNAME entries are on a blacklist:
For the A query, the result is:
pi@raspberrypi:~ $ pihole -q ctldl.windowsupdate.com
[i] No results found for ctldl.windowsupdate.com within the block lists
pi@raspberrypi:~ $ pihole -q audownload.windowsupdate.nsatc.net
[i] No results found for audownload.windowsupdate.nsatc.net within the block lists
pi@raspberrypi:~ $ pihole -q au.download.windowsupdate.com.hwcdn.net
[i] No results found for au.download.windowsupdate.com.hwcdn.net within the block lists
pi@raspberrypi:~ $ pihole -q cds.d2s7q6s2.hwcdn.net
[i] No results found for cds.d2s7q6s2.hwcdn.net within the block lists
For the AAAA query, the result is:
pi@raspberrypi:~ $ pihole -q ctldl.windowsupdate.com
[i] No results found for ctldl.windowsupdate.com within the block lists
pi@raspberrypi:~ $ pihole -q audownload.windowsupdate.nsatc.net
[i] No results found for audownload.windowsupdate.nsatc.net within the block lists
pi@raspberrypi:~ $ pihole -q au.download.windowsupdate.com.edgesuite.net
[i] No results found for au.download.windowsupdate.com.edgesuite.net within the block lists
pi@raspberrypi:~ $ pihole -q a767.dscg3.akamai.net
[i] No results found for a767.dscg3.akamai.net within the block lists
Since none of the CNAME entries are blocked, pihole-FTL should always permit the domain(s).
This is probably very hard to read, so I've send you a PM to allow you to download my files.
content:
pihole.log (todays pihole log)
pihole.log.1.gz (yesterdays pihole log, starting from 22h10)
pihole-FTL.log (todays pihole-FTL log DEBUG_QUERIES enabled)
pihole-FTL.log.1.gz (yesterdays pihole-FTL log DEBUG_QUERIES enabled, starting from 22h10)
pihole-FTL.db
cnames.csv (the result of select * from queries where status=9;)
pi-hole-teleporter_2020-02-03_12-24-38.tar.gz (teleporter export)
pihole_debug.log (included or https://tricorder.pi-hole.net/p3n7nibpfq)
There are a lot of entries in cnames.csv, however, a lot of duplicate domains, very few actual unique domains.
In order to check for a possible problem, I use the web interface / Long Term Data / query log, select a time frame and enter the domain name from the csv into the seach box. All green OR all red -> no problem. Mixed green and red -> that's the problem.
Really hopes this info assists to identify the problem.