# Queries for local DNS records exploding

**URL:** <https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347>\
**Category:** Community Help\
**Tags:** v5-0\
**Created:** [July 5, 2022, 4:20pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347 "2022-07-05T16:20:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [July 5, 2022, 4:20pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347/1 "2022-07-05T16:20:30Z")

</div>

**The issue I am facing:**

Anyone else noticed the TTL for local DNS records being zero seconds with one of the later updates?

```auto
pi@ph5b:~ $ dig @localhost nas.home.dehakkelaar.nl a

; <<>> DiG 9.16.22-Raspbian <<>> @localhost nas.home.dehakkelaar.nl a
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54957
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;nas.home.dehakkelaar.nl. IN A

;; ANSWER SECTION:
nas.home.dehakkelaar.nl. 0 IN A 10.0.0.3

;; Query time: 9 msec
;; SERVER: ::1#53(::1)
;; WHEN: Tue Jul 05 17:18:14 CEST 2022
;; MSG SIZE rcvd: 63

```

The current release is missing the **local-ttl=2** directive that used to exist before.  
When adding that directive in again:

```auto
pi@ph5b:~ $ sudo nano /etc/dnsmasq.d/99-my-settings.conf
local-ttl=2

```

```auto
pi@ph5b:~ $ pihole-FTL --test
dnsmasq: syntax check OK.

```

```auto
pi@ph5b:~ $ sudo service pihole-FTL reload
pi@ph5b:~ $

```

I get a non zero TTL returned again:

```auto
pi@ph5b:~ $ dig @localhost nas.home.dehakkelaar.nl a

; <<>> DiG 9.16.22-Raspbian <<>> @localhost nas.home.dehakkelaar.nl a
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51186
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;nas.home.dehakkelaar.nl. IN A

;; ANSWER SECTION:
nas.home.dehakkelaar.nl. 2 IN A 10.0.0.3

;; Query time: 89 msec
;; SERVER: ::1#53(::1)
;; WHEN: Tue Jul 05 17:33:01 CEST 2022
;; MSG SIZE rcvd: 63

```

Client hostnames that are advertised via DHCP seems not effected regardless of that added directive:

```auto
pi@ph5b:~ $ dig @localhost avr.home.dehakkelaar.nl a

; <<>> DiG 9.16.22-Raspbian <<>> @localhost avr.home.dehakkelaar.nl a
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13571
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;avr.home.dehakkelaar.nl. IN A

;; ANSWER SECTION:
avr.home.dehakkelaar.nl. 2 IN A 10.0.0.9

;; Query time: 9 msec
;; SERVER: ::1#53(::1)
;; WHEN: Tue Jul 05 17:39:58 CEST 2022
;; MSG SIZE rcvd: 63

```

I noticed these DNS queries exploding when logged into my Syno NAS web GUI.

**Details about my system:**

```auto
pi@ph5b:~ $ cat /proc/device-tree/model
Raspberry Pi Model B Rev 2

```

```auto
pi@ph5b:~ $ lsb_release -d
Description: Raspbian GNU/Linux 11 (bullseye)

```

```auto
pi@ph5b:~ $ pihole -v
  Pi-hole version is v5.10 (Latest: v5.10)
  AdminLTE version is v5.12 (Latest: v5.12)
  FTL version is v5.15 (Latest: v5.15)

```

Pi-hole DHCP service active.  
Created below DNS record via the web GUI:

```auto
pi@ph5b:~ $ cat /etc/pihole/custom.list
[..]
10.0.0.3 nas.home.dehakkelaar.nl

```

**What I have changed since installing Pi-hole:**

Added Unbound using the offical guide.  
Added my own directive to advertise two Pi-hole DNS servers via DHCP:

```auto
pi@ph5b:~ $ sudo grep -v '#\|^$' -R /etc/dnsmasq.*
[..]
/etc/dnsmasq.d/10-dhcp-dns.conf:dhcp-option=option:dns-server,10.0.0.2,10.0.0.4

```

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [July 5, 2022, 4:56pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347/2 "2022-07-05T16:56:32Z")

</div>

> [@deHakkelaar](#):
>
> Anyone else noticed the TTL for local DNS records being zero seconds with one of the later updates?

I'm puzzled that didn't hit you earlier, as that should have been the case since [Pi-hole FTL v5.10.1, Web v5.7 and Core v5.5 released](https://discourse.pi-hole.net/t/pi-hole-ftl-v5-10-1-web-v5-7-and-core-v5-5-released/50009) from September 2021 (emphasis mine):

> [@Pi-hole FTL v5.10.1, Web v5.7 and Core v5.5 released](https://discourse.pi-hole.net/t/pi-hole-ftl-v5-10-1-web-v5-7-and-core-v5-5-released/50009/1):
>
> **Handle TTL for blocked queries separately**  
> You can now set your own `local-ttl` value if you want to.  
> **Note that this changes the default TTL for local hostnames from two seconds to _“do not cache”_** (`dnsmas`q’s default). If you want to avoid this, create a file like `/etc/dnsmasq.d/99-local-ttl.conf` and add a line like `local-ttl=60` for one minute TTL on local hostnames.

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [July 5, 2022, 5:27pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347/3 "2022-07-05T17:27:29Z")

</div>

Ahahaha, I didnt update for a while and recently hastily updated without reading the release notes because I was working on supporting someone else and had to reply quickly with my versions being up to date.  
My mistake 😉

EDIT: Ow and maybe it happened already before but didnt notice 😋

```auto
pi@ph5b:~ $ dig @localhost nas.home.dehakkelaar.nl a

; <<>> DiG 9.16.22-Raspbian <<>> @localhost nas.home.dehakkelaar.nl a
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8052
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;nas.home.dehakkelaar.nl. IN A

;; ANSWER SECTION:
nas.home.dehakkelaar.nl. 60 IN A 10.0.0.3

;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Tue Jul 05 19:35:19 CEST 2022
;; MSG SIZE rcvd: 63

```

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [July 6, 2022, 12:08pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347/4 "2022-07-06T12:08:47Z")

</div>

Some feedback, after about 24 hours I dont observer those queries exploding anymore when accessing my NAS GUI with the TTL set to 60 seconds.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [July 27, 2022, 12:09pm UTC](https://discourse.pi-hole.net/t/queries-for-local-dns-records-exploding/56347/5 "2022-07-27T12:09:35Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
