Dnsmasq - interface enp13s0 does not currently exist

Hi,

I installed dnsmasq today, but when I start the PC I get the following warning:

journalctl -xeu dnsmasq.service

warning: interface enp13s0 does not currently exist

the interface exists, as can be seen from ip a

How do I remove the warning?

Thank you

my config file is


no-resolv
server=10.0.26.128
server=10.0.26.254
local=/fritz.box/
domain=fritz.box
interface=enp13s0
listen-address=127.0.0.1,10.0.26.12
cache-size=1500
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp13s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 4c:ed:fb:73:7d:3a brd ff:ff:ff:ff:ff:ff
    inet 10.0.26.12/24 brd 10.0.26.255 scope global noprefixroute enp13s0
       valid_lft forever preferred_lft forever
3: wlp19s0f3u4i2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 6a:7e:ca:16:06:6d brd ff:ff:ff:ff:ff:ff permaddr d0:c0:bf:ba:61:01
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:2a:72:91:ac brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
5: br-570ab0f842ef: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:85:8c:b3:8f brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-570ab0f842ef
       valid_lft forever preferred_lft forever

… maybe not at the time the dnsmasq service is started - but only later on?

What do you use dnsmasq for?
I have it - integrated into NetworkManager - to provide caching - to speed things up …

EDIT: Noticed now that this procedure is for systemd-networkd network manager (I have now remembered that I used it with Arch, not Manjaro). OP is probably using NetworkManager. I don’t know if there is something similar for it. Anyway I’m going to leave the post, in case it can help somehow.

You can force the dnsmasq service to wait for the network interface with the following steps:

  1. Create an override for the dnsmasq service with:
sudo systemctl edit dnsmasq
  1. That will open a text editor, where you have to add the following lines:
[Unit]
Wants=systemd-networkd-wait-online.service
After=systemd-networkd-wait-online.service
  1. Save the file and exit the text editor
  2. Optionally rename the override file to something more descriptive:
sudo /etc/systemd/system/dnsmasq.service.d/{override.conf,wait_for_network.conf}
  1. Restart your computer to test the changes

Hope it helps!

I use it for caching. What do you mean integrated into networkmanager? Can it only be done with networkmanager without dnsmasq?

I apologize for my ignorance, but using the “edit” command the dnsmasq.service file remained unchanged. The modification (if I made it) did not result in any change.
Then I directly edited the file. The result was as expected, but booting took about two minutes longer. Why?

I guess the problem is due to virtual cards, but I’m not sure. To avoid making the post too heavy I only put the logs to highlight the time, but tell me if you need something more specific.
I don’t see any errors.

However, the warning indicated in the post is resolved, even if there is another problem.

The new dnsmasq.service is

[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Documentation=man:dnsmasq(8)
Wants=systemd-networkd-wait-online.service
After=systemd-networkd-wait-online.service
Before=network-online.target nss-lookup.target

[Service]
Type=dbus
BusName=uk.org.thekelleys.dnsmasq
ExecStartPre=/usr/bin/dnsmasq --test
ExecStart=/usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
PrivateDevices=true
ProtectSystem=full

[Install]
WantedBy=multi-user.target

The Logs are


dic 30 16:47:11 pc01 NetworkManager[928]: <info>  [1703951231.1444] manager: NetworkManager state is now CONNECTED_SITE
dic 30 16:47:11 pc01 NetworkManager[928]: <info>  [1703951231.1446] device (enp13s0): Activation: successful, device activated.
dic 30 16:47:15 pc01 NetworkManager[928]: <info>  [1703951235.1101] manager: startup complete
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.3603] manager: (br-570ab0f842ef): new Bridge device (/org/freedesktop/NetworkManager/Devices/4)
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4088] device (br-570ab0f842ef): state change: unmanaged -> unavailable (reason 'connection-assumed', sys-iface-state: 'ext>
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4092] device (br-570ab0f842ef): state change: unavailable -> disconnected (reason 'connection-assumed', sys-iface-state: '>
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4097] device (br-570ab0f842ef): Activation: starting connection 'br-570ab0f842ef' (c8c64086-5a46-47f0-a97a-9237cd5a8e61)
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4098] device (br-570ab0f842ef): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'external')
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4100] device (br-570ab0f842ef): state change: prepare -> config (reason 'none', sys-iface-state: 'external')
dic 30 16:49:05 pc01 NetworkManager[928]: <info>  [1703951345.4101] device (br-570ab0f842ef): state change: config -> ip-config (reason 'none', sys-iface-state: 'external')

dic 30 16:49:04 pc01 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
░░ Subject: L'unità dnsmasq.service inizia la fase di avvio
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ L'unità dnsmasq.service ha iniziato la fase di avvio.
dic 30 16:49:04 pc01 dnsmasq[1138]: dnsmasq: syntax check OK.
dic 30 16:49:04 pc01 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
░░ Subject: L'unità dnsmasq.service ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ L'unità dnsmasq.service ha terminato la fase di avvio.
░░ 
░░ La fase di avvio è done.
dic 30 16:49:04 pc01 dnsmasq[1141]: started, version 2.89 cachesize 1500
dic 30 16:49:04 pc01 dnsmasq[1141]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inoti>
dic 30 16:49:04 pc01 dnsmasq[1141]: DBus support enabled: connected to system bus
dic 30 16:49:04 pc01 dnsmasq[1141]: using nameserver 10.0.26.128#53
dic 30 16:49:04 pc01 dnsmasq[1141]: using nameserver 10.0.26.254#53
dic 30 16:49:04 pc01 dnsmasq[1141]: using only locally-known addresses for fritz.box
dic 30 16:49:04 pc01 dnsmasq[1141]: read /etc/hosts - 12 names

Pretty sure it says so in the editor it opens, but check in the directory /etc/systemd/system/dnsmasq.service.d/

This indicates to me you need to study more.
You can use dnsmasq in combination. But depending on what you actually want to achieve very different things have to be done.
You are a bit vague so…

https://wiki.archlinux.org/title/Domain_name_resolution

https://wiki.archlinux.org/title/NetworkManager#DNS_management

You can use router for that. If you have the right router. I’d guess most of them cache entries.

As far as I know - no.
But: you don’t need to configure anything as far as dnsmasq is concerned.
Just install it and leave everything default - NetworkManager will supply it’s own configuration.
All you need to do is:
create a file in the
/etc/NetworkManager/conf.d directory and give it a decent name
for instance:
/etc/NetworkManager/conf.d/dns.conf
with the following content:

[main]
dns=dnsmasq

There are different ways to do it, to place this configuration - this is how I did it.
I think this is how the Arch wiki described it - it has been a long time since I implemented this and this is how it currently is on my system.

Thank you! It worked. It is now fast both in use and at startup.
Thank you all

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