# Network nightmare (nah, not really)

**URL:** <https://forums.rockylinux.org/t/network-nightmare-nah-not-really/13244>\
**Category:** Rocky Linux Help & Support\
**Created:** [March 17, 2024, 1:44pm UTC](https://forums.rockylinux.org/t/network-nightmare-nah-not-really/13244 "2024-03-17T13:44:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [March 18, 2024, 9:48am UTC](https://forums.rockylinux.org/t/network-nightmare-nah-not-really/13244/6 "2024-03-18T09:48:31Z")

</div>

> [@pseud](#):
>
> default `dnsmasq` config files (which don’t work)?

There is nothing wrong with the “default files” approach.

The `dnsmasq.service` starts `/usr/sbin/dnsmasq` – no command-line options, so it goes with defaults and reads the `/etc/dnfmasq.conf` that contains:

```auto
user=dnsmasq
group=dnsmasq
interface=lo
bind-interfaces
conf-dir=/etc/dnsmasq.d,.rpmnew,.rpmsave,.rpmorig

```

One should not edit that file, but add a file with your options into `/etc/dnsmasq.d/`

* * *

When you tell `NetworkManager.service` to use `dns=dnsmasq`, it will start its own instance of dnsmasq, with some options:

```auto
/usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

```

Just like with the `dnsmasq.service` one can add custom config by adding into directory, but now the `conf-dir` points to directory `/etc/NetworkManager/dnsmasq.d/`

Note also that “all” files in the conf-dir are read – I had Emacs leave \*~ files in there to mess up.

* * *

Another difference is that NetworkManager passes DNS-options that it has for connections to the dnsmasq (via DBus), but for standalone `dnsmasq.service` you do pass the upstream DNS server addresses by other means.

It is thus more convenient to use the NetworkManager, since you most probably want the dnsmasq to both resolve names for this host _and_ provide DNS/DHCP/TFTP service for others.

If the “fedora howto” does show config for instance of dnsmasq started by NetworkManager, then it is probably more approriate to start from.

* * *

The `man dnsmasq` tells that there is option `--test` that one can use to hunt syntax errors from config files:

```auto
dnsmasq --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d --test

```

---

_[View the full topic](https://forums.rockylinux.org/t/network-nightmare-nah-not-really/13244)._
