LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-21-2019, 07:24 PM   #1
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
How to configure the systemd DNS resolver?


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?
 
Old 08-21-2019, 08:01 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Quote:
Originally Posted by berndbausch View Post
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?
 
Old 08-26-2019, 01:47 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Original Poster
Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by wpeckham View Post
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.
Code:
$ cat /etc/systemd/resolved.conf
...
[Resolve]
DNS=192.168.1.16
FallbackDNS=1.1.1.1
Domains=home
...
And that's all there is to it, at least as far as I am concerned.

Thanks wpeckham and the Archlinux team.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i have a question over resolver and DNS jonhanna Linux - Newbie 6 01-26-2009 06:14 AM
strange thing with dns resolver Barq Linux - Networking 12 12-14-2007 09:11 PM
DNS Resolver Cache shipon_97 Linux - Newbie 4 04-25-2006 09:06 AM
The DNS-resolver doesn't work in my live-distro maxxflow Linux - Networking 9 05-23-2005 01:35 AM
dns client resolver Fraudulent SUSE / openSUSE 2 05-17-2005 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration