The officially official Devuan Forum!

You are not logged in.

#1 2026-11-22 19:17:25

webman
Member
Registered: 2022-08-27
Posts: 71  

Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

Hello!

DNS resolution in devuan-based lxc-containers does not work for container to container
network, so there is NO dns server and the containers talk only together using hosts file.
The hosts file has some entries and effected containers can communicate and ping
works fine - even the host command fails.
dig and nslookup failing miserably, they ignore the settings in nsswitch.conf (where
my containers have only "files") and this can be easily verified using the inotify tools.
On systemd, at least I've heart, its running a stub-resolver on 127.0.0.53, which
is told to solve the problem.
Whats about non-systemd- systems?

Thanks,
Manfred

Offline

#2 2026-11-22 21:02:36

kaiyel
Member
Registered: 2019-10-16
Posts: 46  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

@webman, after spinning up the new lxc container, did you configure the IP address of your local network's DNS resolver in its /etc/resolv.conf file (e.g. nameserver 10.1.1.1) ?
--K

Offline

#3 2026-11-23 00:06:00

webman
Member
Registered: 2022-08-27
Posts: 71  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

Hi!

Thanks for your reply!

I mentioned explicitely, that there is NO local network's DNS resolver,
(for the containers) but the Hosts file
and containers(!) nsswitch.conf says explicitely: files, NO dns.
And networking and ping work as usual with names, because they follow the
rules of nsswitch.conf and lookup the hosts file.
There seems to be NO dns-stub-resolver
which allows the usual address lookup.
nslookup and dig DO NOT WORK, because they
IGNORE nsswitch.
systemd handles this smartly using the dns-stub-resolver,
provided by systemd itself.

Regards,
Manfred

Offline

#4 2026-11-23 02:30:13

viptux
Member
Registered: 2025-05-06
Posts: 14  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

Depends on the objective and use case for the containers.
Running an unbound daemon on the container host or even from within the container itself should provide an equivalence to systemd-resolve.

Regards

Offline

#5 2026-11-23 17:11:55

kaiyel
Member
Registered: 2019-10-16
Posts: 46  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

Hello @webman,

Though I understand systemd's "dns-stub-resolver" listens on 127.0.0.53 port 53 and does the work of a caching local dns resolver, I do not know what makes this "bind" replacement smarter or necessary.

I've not had experiences to suggest I shouldn't continue to prefer "bind" configured as a caching DNS resolver listening on 127.0.0.1 port 53, as I've done for decades on production equipment.  It "just works" and I have many LXC containers in use now with a local caching DNS resolver on each of them.

I'm afraid I can't help you mimic the systemd way of doing things.  But I can show you what has worked for me and hope it helps.

Using IPv4 networking after an "apt-get install -y bind9 bind9-utils", my config looks like this inside the LXC container :

# cat /etc/default/named
RESOLVCONF=no
OPTIONS="-u bind -4"

# cat /etc/bind/named.conf.options
acl "trusted_clients" {
  127.0.0.0/24;
};
options {
  directory "/var/cache/bind";
  listen-on port 53 { 127.0.0.1; };
  listen-on-v6 { none; };
  recursion yes;
  allow-query       { trusted_clients; };
  allow-recursion   { trusted_clients; };
  allow-query-cache { trusted_clients; };
  dnssec-validation auto;
  version none;
  minimal-responses yes;
  allow-transfer { none; };
  max-cache-size 1024m;
};
logging {
  category lame-servers { null; };
};

# cat /etc/resolv.conf
nameserver 127.0.0.1

# cat /etc/nsswitch.conf
passwd:         files
group:          files
shadow:         files
gshadow:        files
hosts:          files dns
networks:       files
protocols:      db files
services:       db files
ethers:         db files
rpc:            db files
netgroup:       nis

Then to test :

# /etc/init.d/named restart
Stopping domain name service...: namedwaiting for pid 1017978 to die
.
Starting domain name service...: named.
# dig +short @127.0.0.1 www.google.com
142.251.154.119
142.251.153.119
142.251.150.119
142.251.157.119
142.251.152.119
142.251.151.119
142.251.156.119
142.251.155.119

@viptux, I have only a passing exposure to "unbound" and have wondered if it provides local dns caching with simpler configuration and using less resources while being equally secure.  What are your thoughts as there are many ways to accomplish the same task?

Cheers,
--K

Offline

#6 2026-11-23 19:27:05

viptux
Member
Registered: 2025-05-06
Posts: 14  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

hi @kaiyel

unbound is configurable as both a stub and recursive caching resolver, long before systemd added resolved functionality.
Haven't used the bind server and utilities for a long time.. unbound is a lighter footprint for my use case.

Best Regards.

Offline

#7 Today 10:29:08

webman
Member
Registered: 2022-08-27
Posts: 71  

Re: Alternative dns-stub resolver with no-systemd (has 127.0.0.53)

Hi !

This is not a systemd thing or whatever dns-programs are possible, it is the thing, that
EACH host should have a dns-cache (like windows hat > 20(??) years) and EACH
container is a host. The other side of this coin is, that this cache shoudl resolve
local names!
If a one container is running a webbrowser and another one a webserver (for that
seprate network only), many queries would be issued, caching is a big speeup.
I do not want to setup unbound into every container to have a cache inside the
container, thats the most important point. It has bee not the question to have
a lan-local dns to cache internet queries, but local queries in an isolated network
(which is also a big privacy-plus).
But in Linux, I see, this is not possible (and there are other problems with isolated
networks) and I do not want to use systemd.
If, at all, I would install some dns, then in another container inside that network.
But this is not speedy - even dnsmasq (on the host) has a bad responsetime for
cached(!) queries and it does'nt follow dns-logging standards (it logs based on
seconds ....). You'll have to use tcpdump and measure request/response for clients.

Regards,
Manfred

Offline

Board footer