Single dot domain/DNS root zone query issue with containerized wireguard

One idea sprung to mind, maybe you can localise more closely where the truncating is happening in the chain.
You just have to query a DNS server for a record that is local to the DNS server (doenst need to be forwarded) and see if it gets truncated.

For me, my router is @10.0.0.1:

pi@ph5b:~ $ dig +notcp @10.0.0.1 -x 10.0.0.1
[..]
router.asus.com.

And Pi-hole is @10.0.0.4:

pi@ph5b:~ $ dig +notcp @10.0.0.4 -x 10.0.0.4
[..]
pi.hole.

My ISP DNS servers:

pi@ph5b:~ $ dig +notcp @195.121.1.34 -x 195.121.1.34
[..]
ns1.wxs.nl.

Cloudflare:

pi@ph5b:~ $ dig +notcp @1.1.1.1 -x 1.1.1.1
[..]
one.one.one.one.

Not sure though and maybe another type of query instead of PTR is better suited bc maybe PTR queries dont get truncated like the NS one does :wink:

For all 4 cases dig command is working fine. only nslookup with . is being truncated. I have also run those nslookups in some AWS VM that is another country and of course isn't using pihole. Note that nslooup of dot domain is still being truncated with cloudflare

ubuntu@someAWSinstance:~$ nslookup -type=NS . 1.1.1.1
;; Truncated, retrying in TCP mode.
Server:		1.1.1.1
Address:	1.1.1.1#53

.	nameserver = a.root-servers.net.
.	nameserver = b.root-servers.net.
.	nameserver = c.root-servers.net.
.	nameserver = d.root-servers.net.
.	nameserver = e.root-servers.net.
.	nameserver = f.root-servers.net.
.	nameserver = g.root-servers.net.
.	nameserver = h.root-servers.net.
.	nameserver = i.root-servers.net.
.	nameserver = j.root-servers.net.
.	nameserver = k.root-servers.net.
.	nameserver = l.root-servers.net.
.	nameserver = m.root-servers.net.

ubuntu@someAWSinstance:~$ nslookup -type=NS .
Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
.	nameserver = a.root-servers.net.
.	nameserver = d.root-servers.net.
.	nameserver = c.root-servers.net.
.	nameserver = b.root-servers.net.
.	nameserver = j.root-servers.net.
.	nameserver = k.root-servers.net.
.	nameserver = g.root-servers.net.
.	nameserver = m.root-servers.net.
.	nameserver = f.root-servers.net.
.	nameserver = e.root-servers.net.
.	nameserver = h.root-servers.net.
.	nameserver = l.root-servers.net.
.	nameserver = i.root-servers.net.

Authoritative answers can be found from:

ubuntu@someAWSinstance:~$ nslookup -type=NS . 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
.	nameserver = a.root-servers.net.
.	nameserver = b.root-servers.net.
.	nameserver = c.root-servers.net.
.	nameserver = d.root-servers.net.
.	nameserver = e.root-servers.net.
.	nameserver = f.root-servers.net.
.	nameserver = g.root-servers.net.
.	nameserver = h.root-servers.net.
.	nameserver = i.root-servers.net.
.	nameserver = j.root-servers.net.
.	nameserver = k.root-servers.net.
.	nameserver = l.root-servers.net.
.	nameserver = m.root-servers.net.

Authoritative answers can be found from:


You can also try nslookup -type=NS . 1.1.1.1 and it should truncate. So issue is specific to cloudflare's DNS

Yes I get the same results as you with nslookup.
But am not sure what nslookup does under the hood.

Where 1.1.1.1 is different compared to the others is that it supplies ADDITIONAL records:

pi@ph5b:~ $ dig +notcp @1.1.1.1 . ns

; <<>> DiG 9.16.22-Raspbian <<>> +notcp +additional @1.1.1.1 . ns
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7181
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 27

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       511735  IN      NS      a.root-servers.net.
.                       511735  IN      NS      b.root-servers.net.
.                       511735  IN      NS      c.root-servers.net.
.                       511735  IN      NS      d.root-servers.net.
.                       511735  IN      NS      e.root-servers.net.
.                       511735  IN      NS      f.root-servers.net.
.                       511735  IN      NS      g.root-servers.net.
.                       511735  IN      NS      h.root-servers.net.
.                       511735  IN      NS      i.root-servers.net.
.                       511735  IN      NS      j.root-servers.net.
.                       511735  IN      NS      k.root-servers.net.
.                       511735  IN      NS      l.root-servers.net.
.                       511735  IN      NS      m.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.     511735  IN      A       198.41.0.4
a.root-servers.net.     511735  IN      AAAA    2001:503:ba3e::2:30
b.root-servers.net.     511735  IN      A       199.9.14.201
b.root-servers.net.     511735  IN      AAAA    2001:500:200::b
c.root-servers.net.     511735  IN      A       192.33.4.12
c.root-servers.net.     511735  IN      AAAA    2001:500:2::c
d.root-servers.net.     511735  IN      A       199.7.91.13
d.root-servers.net.     511735  IN      AAAA    2001:500:2d::d
e.root-servers.net.     511735  IN      A       192.203.230.10
e.root-servers.net.     511735  IN      AAAA    2001:500:a8::e
f.root-servers.net.     511735  IN      A       192.5.5.241
f.root-servers.net.     511735  IN      AAAA    2001:500:2f::f
g.root-servers.net.     511735  IN      A       192.112.36.4
g.root-servers.net.     511735  IN      AAAA    2001:500:12::d0d
h.root-servers.net.     511735  IN      A       198.97.190.53
h.root-servers.net.     511735  IN      AAAA    2001:500:1::53
i.root-servers.net.     511735  IN      A       192.36.148.17
i.root-servers.net.     511735  IN      AAAA    2001:7fe::53
j.root-servers.net.     511735  IN      A       192.58.128.30
j.root-servers.net.     511735  IN      AAAA    2001:503:c27::2:30
k.root-servers.net.     511735  IN      A       193.0.14.129
k.root-servers.net.     511735  IN      AAAA    2001:7fd::1
l.root-servers.net.     511735  IN      A       199.7.83.42
l.root-servers.net.     511735  IN      AAAA    2001:500:9f::42
m.root-servers.net.     511735  IN      A       202.12.27.33
m.root-servers.net.     511735  IN      AAAA    2001:dc3::35

;; Query time: 19 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sun Oct 02 03:31:06 CEST 2022
;; MSG SIZE  rcvd: 811

Vs Google @8.8.8.8:

pi@ph5b:~ $ dig +notcp @8.8.8.8 . ns

; <<>> DiG 9.16.22-Raspbian <<>> +notcp +additional @8.8.8.8 . ns
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54956
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       64927   IN      NS      a.root-servers.net.
.                       64927   IN      NS      b.root-servers.net.
.                       64927   IN      NS      c.root-servers.net.
.                       64927   IN      NS      d.root-servers.net.
.                       64927   IN      NS      e.root-servers.net.
.                       64927   IN      NS      f.root-servers.net.
.                       64927   IN      NS      g.root-servers.net.
.                       64927   IN      NS      h.root-servers.net.
.                       64927   IN      NS      i.root-servers.net.
.                       64927   IN      NS      j.root-servers.net.
.                       64927   IN      NS      k.root-servers.net.
.                       64927   IN      NS      l.root-servers.net.
.                       64927   IN      NS      m.root-servers.net.

;; Query time: 9 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Oct 02 03:41:52 CEST 2022
;; MSG SIZE  rcvd: 239

Quad9 (9.9.9.9) and Level3 (4.2.2.1) reply the same as Google.

And I can reproduce the truncating with dig if I tell it to drop EDNS support (+noedns) which limits UDP packet size to 512 bytes max:

pi@ph5b:~ $ dig +notcp +noedns @1.1.1.1 . ns
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.16.22-Raspbian <<>> +notcp +additional +noedns @1.1.1.1 . ns
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5891
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 26

;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       510468  IN      NS      a.root-servers.net.
.                       510468  IN      NS      b.root-servers.net.
.                       510468  IN      NS      c.root-servers.net.
.                       510468  IN      NS      d.root-servers.net.
.                       510468  IN      NS      e.root-servers.net.
.                       510468  IN      NS      f.root-servers.net.
.                       510468  IN      NS      g.root-servers.net.
.                       510468  IN      NS      h.root-servers.net.
.                       510468  IN      NS      i.root-servers.net.
.                       510468  IN      NS      j.root-servers.net.
.                       510468  IN      NS      k.root-servers.net.
.                       510468  IN      NS      l.root-servers.net.
.                       510468  IN      NS      m.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.     510468  IN      A       198.41.0.4
a.root-servers.net.     510468  IN      AAAA    2001:503:ba3e::2:30
b.root-servers.net.     510468  IN      A       199.9.14.201
b.root-servers.net.     510468  IN      AAAA    2001:500:200::b
c.root-servers.net.     510468  IN      A       192.33.4.12
c.root-servers.net.     510468  IN      AAAA    2001:500:2::c
d.root-servers.net.     510468  IN      A       199.7.91.13
d.root-servers.net.     510468  IN      AAAA    2001:500:2d::d
e.root-servers.net.     510468  IN      A       192.203.230.10
e.root-servers.net.     510468  IN      AAAA    2001:500:a8::e
f.root-servers.net.     510468  IN      A       192.5.5.241
f.root-servers.net.     510468  IN      AAAA    2001:500:2f::f
g.root-servers.net.     510468  IN      A       192.112.36.4
g.root-servers.net.     510468  IN      AAAA    2001:500:12::d0d
h.root-servers.net.     510468  IN      A       198.97.190.53
h.root-servers.net.     510468  IN      AAAA    2001:500:1::53
i.root-servers.net.     510468  IN      A       192.36.148.17
i.root-servers.net.     510468  IN      AAAA    2001:7fe::53
j.root-servers.net.     510468  IN      A       192.58.128.30
j.root-servers.net.     510468  IN      AAAA    2001:503:c27::2:30
k.root-servers.net.     510468  IN      A       193.0.14.129
k.root-servers.net.     510468  IN      AAAA    2001:7fd::1
l.root-servers.net.     510468  IN      A       199.7.83.42
l.root-servers.net.     510468  IN      AAAA    2001:500:9f::42
m.root-servers.net.     510468  IN      A       202.12.27.33
m.root-servers.net.     510468  IN      AAAA    2001:dc3::35

;; Query time: 9 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sun Oct 02 03:47:28 CEST 2022
;; MSG SIZE  rcvd: 800

As the others dont supply ADDITIONAL records, the 239 bytes answer they return is well below the 512 bytes UDP limit.
And the 800 bytes answer from 1.1.1.1, with ADDITIONAL records, exceeds the 512 bytes limit (if no EDNS support).
Thats the only thing I can think of causing the truncating when querying 1.1.1.1 if compare with the others.
Something along the path upstream to 1.1.1.1 limiting UDP packet size or doesnt support EDNS which amongst others allows larger packets.
And if I did my research correctly, ADDITIONAL records only comes with EDNS (correct me if I'm wrong pls?):

https://www.ietf.org/rfc/rfc2671.txt

I also noticed an inconsistency in number of ADDITIONAL records when flipping +noedns which I cant explain:

pi@ph5b:~ $ dig +notcp @1.1.1.1 . ns
[..]
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 27
pi@ph5b:~ $ dig +notcp +noedns @1.1.1.1 . ns
[..]
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 26

I counted them for both ouputs and it should be 26.

Am not sure if all this is related with the original issue from your OP though :wink:
Have you tried selecting another upstream DNS provider, not Cloudflare, to see if the excessive dot queries stop?

1 Like

Excessive dot queues aren't stopping even if I directly select google dns from pihole. But at least reply is now different (BLOB vs NODATA that I was getting from cloudflare).

Oct  2 13:13:28 dnsmasq[3301]: query[NS] . from 172.18.0.1
Oct  2 13:13:28 dnsmasq[3301]: forwarded . to 8.8.8.8
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:28 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: query[NS] . from 172.18.0.1
Oct  2 13:13:29 dnsmasq[3301]: forwarded . to 8.8.8.8
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>
Oct  2 13:13:29 dnsmasq[3301]: reply . is <NS>

Thats at least a small improvement :wink:

I dont know how to troubleshoot that Wireguard container though as I have little experience with Docker.
But if you post some more info like:
What HW?
Did you follow a guide?
Which container(source/link)?
How is the container created (Docker compose, YAML, Portainer etc)?
Docker networking mode (host, macvlan, bridge)?

Maybe someone else might chip in?
And oc you could also try to get help via the Wireguard container support channels.

Thanks. Yeah I will also post this in wireguard forum.
pihole docker-compse:

Old wireguard config that I was using while reporting this issue:

version: "2.1"
services:
  wireguard:
    image: ghcr.io/linuxserver/wireguard
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Karachi
      - SERVERPORT=51820 #optional
      - PEERS=something #optional
      - PEERDNS=auto #optional
    volumes:
      - ./config:/config
      - ./libmodules:/lib/modules
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    restart: unless-stopped

Newer Wireguard docker-compose that isn't even using host DNS (PEERDNS is not auto):

version: "2.1"
services:
  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Karachi
      - SERVERPORT=51820 #optional
      - PEERS=Mi11Tpro #optional
      - PEERDNS=8.8.8.8 #optional
      # - PEERDNS=auto #optional
      # - INTERNAL_SUBNET=10.13.13.0 #optional
      - ALLOWEDIPS=0.0.0.0/0 #optional
      - LOG_CONFS=true #optional
    volumes:
      - ./config:/config
      - ./libmodules:/lib/modules
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    restart: unless-stopped

HW: raspberry pi 4b 4GB
OS:

Linux raspberrypi 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

I have also linked this thread in wireguard reddit

1 Like

I got it fixed by binding the DNS listening port to the pihole node local address in the docker-compose file of Pi-hole,
in my case - "192.168.50.11:53:53/udp" instead of - "53:53/udp".

I am not sure why this solution worked. Solution was linked by someone on reddit. I have also added this in my reddit post liked above.
Related links:

Note that a user in docker-wireguard github issue is blaming pihole docker for this.

I reverted the solution because after making the change, the Pi-hole Docker container failed to restart automatically after a system reboot.

At the moment, I have stopped using the WireGuard container, and everything appears to be functioning correctly.