[SOLVED] How to configure the systemd DNS resolver?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I admit that one of the reasons I am asking this question is frustration. So yes, I'm venting, but not only. Venting: I am happy with systemd's service management features, but Bionic also uses it for managing the DNS client. I don't understand the benefit of that, but more importantly, after spending countless hours trying to become knowledgeable about service management, I feel that I am back at square one, having to read through countless man pages and Poettering blogs to cut through the systemd-resolve thicket.
So here is my real question. I run a DNS server at home, at IP address 192.168.1.16. This is what I get on my Xubuntu VM (based on Bionic):
Code:
$ host odroid.home 192.168.1.16
Using domain server:
Name: 192.168.1.16
Address: 192.168.1.16#53
Aliases:
odroid.home has address 192.168.1.16
The above is expected. The below is not:
Code:
$ host odroid.home
Host odroid.home not found: 3(NXDOMAIN)
$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
...
nameserver 127.0.0.53
options edns0
What confuses me: My name server 192.168.1.16 seems to be configured:
Code:
$ systemd-resolve --status
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
... stuff...
home
internal
intranet
lan
local
private
test
Link 2 (enp0s3)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.16
1.1.1.1
Basically, I want to know how I can tell the systemd resolver to actually use what I configured. Yes, there are ways to take ownership of /etc/resolv.conf back from systemd, but what is the intended method?
I admit that one of the reasons I am asking this question is frustration. So yes, I'm venting, but not only. Venting: I am happy with systemd's service management features, but Bionic also uses it for managing the DNS client. I don't understand the benefit of that, but more importantly, after spending countless hours trying to become knowledgeable about service management, I feel that I am back at square one, having to read through countless man pages and Poettering blogs to cut through the systemd-resolve thicket.
So here is my real question. I run a DNS server at home, at IP address 192.168.1.16. This is what I get on my Xubuntu VM (based on Bionic):
Code:
$ host odroid.home 192.168.1.16
Using domain server:
Name: 192.168.1.16
Address: 192.168.1.16#53
Aliases:
odroid.home has address 192.168.1.16
The above is expected. The below is not:
Code:
$ host odroid.home
Host odroid.home not found: 3(NXDOMAIN)
$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
...
nameserver 127.0.0.53
options edns0
What confuses me: My name server 192.168.1.16 seems to be configured:
Code:
$ systemd-resolve --status
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
... stuff...
home
internal
intranet
lan
local
private
test
Link 2 (enp0s3)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.1.16
1.1.1.1
Basically, I want to know how I can tell the systemd resolver to actually use what I configured. Yes, there are ways to take ownership of /etc/resolv.conf back from systemd, but what is the intended method?
Check your listeners on your client machine. I suspect it is running a local "cache only" dns server and is forwarding to your network DNS server. This is pretty common on some of the *buntu based distributions these days. As long as it is forwarding and working properly, I do not see that as a problem. Is it resolving external hosts properly?
Check your listeners on your client machine. I suspect it is running a local "cache only" dns server and is forwarding to your network DNS server. This is pretty common on some of the *buntu based distributions these days. As long as it is forwarding and working properly, I do not see that as a problem. Is it resolving external hosts properly?
It's only now that I am getting around looking at it again. Short version: It works. Longer version: The good people at the Archlinux wiki have, once again, made it easy to understand what happens. In my case, /etc/resolv.conf was symlinked to /run/systemd/resolve/stub-resolv.conf, which points to the local resolver from my question. This local resolver turns out to be systemd-resolve.
Now the million-dollar question is: To which DNS server does systemd-resolve forward requests? Simple: This is configured in /etc/systemd/resolved.conf.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.