# DNS doesn't work after modifying settings to function as a DCHP server

**URL:** <https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073>\
**Category:** Community Help\
**Created:** [November 20, 2024, 1:02am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073 "2024-11-20T01:02:56Z")\
**Posts on this page:** 8\
**Page:** 2

<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:** [November 22, 2024, 4:09pm UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/21 "2024-11-22T16:09:11Z")

</div>

> [@REz](#):
>
> ```auto
> [ipv4]
> address1=192.168.1.111/24,192.168.1.254
> method=manual
> 
> ```
> 
> it defines the default gateway for the network

Could you provide a source for that?

_`NetworkManager`_'s documentation would list explicit properties for `addressN`, `gateway` and `dns`, see [**Table 5. ipv4 setting (section)**](https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html#id-1.2.11.6.8).

---

<div class="post-metadata">

**Author:** ![REz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rez/32/44158_2.png) [@REz](https://discourse.pi-hole.net/u/REz)\
**Post date:** [November 22, 2024, 4:48pm UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/22 "2024-11-22T16:48:42Z")

</div>

Uhm... I'll look for it, this time I just copied my nmconnection configuration, but I found that way of describing the gateway somewhere when I configured my rpi a few month ago.

---

<div class="post-metadata">

**Author:** ![Faceman](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@Faceman](https://discourse.pi-hole.net/u/Faceman)\
**Post date:** [November 22, 2024, 9:00pm UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/23 "2024-11-22T21:00:13Z")

</div>

I did as you suggested, using _`nmtui`_ to set a static address. Pi-Hole still has the original error, but now I get this result from running a command you previously provided:

```auto
zed1@raspberrypi:~ $ dig @9.9.9.9 tricorder.pi-hole.net

; <<>> DiG 9.18.28-1~deb12u2-Debian <<>> @9.9.9.9 tricorder.pi-hole.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51629
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;tricorder.pi-hole.net. IN A

;; ANSWER SECTION:
tricorder.pi-hole.net. 60 IN CNAME docker-2-ny1.pi-hole.net.
docker-2-ny1.pi-hole.net. 3600 IN A 164.90.255.4

;; Query time: 31 msec
;; SERVER: 9.9.9.9#53(9.9.9.9) (UDP)
;; WHEN: Fri Nov 22 20:59:33 GMT 2024
;; MSG SIZE rcvd: 93

zed1@raspberrypi:~ $

```

---

<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:** [November 23, 2024, 7:50am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/24 "2024-11-23T07:50:05Z")

</div>

That demonstrates that your machine knows how to forward packets to public IPs now.

You could verify your IPv4 gateway by running:

```auto
ip route

```

```auto
sudo grep -A6 ipv4 /etc/NetworkManager/system-connections/BT-2RFJW3.nmconnection

```

For the latter, you may have to look for the correct .nmconnection file, as _`NM`_ may have changed the name for your connection.

Did you get rid of _`dnsmasq`_ yet?

Also, please provide a fresh debug token.

---

<div class="post-metadata">

**Author:** ![Faceman](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@Faceman](https://discourse.pi-hole.net/u/Faceman)\
**Post date:** [November 23, 2024, 8:26am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/25 "2024-11-23T08:26:19Z")

</div>

I ran the commands - see below. The directory to the _.nmonnection_ file looks fine (visually checked against File Explorer in the Pi). I've just got rid of `dnsmasq`.

```auto
zed1@raspberrypi:~ $ ip route
default via 192.168.1.254 dev wlan0 proto static metric 600
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.111 metric 600
zed1@raspberrypi:~ $ grep -A6 ipv4 /etc/NetworkManager/system-connections/BT-2RF JW3.nmconnection
grep: /etc/NetworkManager/system-connections/BT-2RFJW3.nmconnection: Permission denied

```

I restarted Pi-hole, it is now active, however there are some fresh errors in the log. It appears to be working though - I've set my laptop to use Pi-hole for DNS, and it's all good. Debug token is [https://tricorder.pi-hole.net/5l7cAHbv/](https://tricorder.pi-hole.net/5l7cAHbv/)

---

<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:** [November 23, 2024, 9:26am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/26 "2024-11-23T09:26:33Z")

</div>

It seems uninstalling _`dnsmasq`_ has removed the configuration directory:

```auto
*** [DIAGNOSING]: contents of /etc/dnsmasq.d
/etc/dnsmasq.d does not exist.

```

As Pi-hole's embedded _`pihole-FTL`_ is a tailored _`dnsmasq`_ fork, it needs that directory.

Try running `pihole -r` with _Repair_.

---

<div class="post-metadata">

**Author:** ![Faceman](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@Faceman](https://discourse.pi-hole.net/u/Faceman)\
**Post date:** [November 23, 2024, 11:51am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/27 "2024-11-23T11:51:04Z")

</div>

Thank you very much, all errors are now resolved.

---

<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:** [December 14, 2024, 11:51am UTC](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073/28 "2024-12-14T11:51:30Z")

</div>

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

[Previous page](https://discourse.pi-hole.net/t/dns-doesnt-work-after-modifying-settings-to-function-as-a-dchp-server/74073.md?page=1)
