You are not logged in.
Hi,
I'm planning on using systemd-networkd in combination with systemd-resolved, but I'm not sure which mode of the following (I'm only listing 2) to use for resolved:
/ETC/RESOLV.CONF
Four modes of handling /etc/resolv.conf (see resolv.conf(5)) are supported:
•systemd-resolved maintains the /run/systemd/resolve/stub-resolv.conf file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see above) as the only DNS server. It also contains a list of search domains that are in use by systemd-resolved. The list of search domains is always kept up-to-date. Note that /run/systemd/resolve/stub-resolv.conf should not be used directly by applications, but only through a symlink from /etc/resolv.conf. This file may be symlinked from /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs to systemd-resolved with correct search domains settings. This mode of operation is recommended.
•systemd-resolved maintains the /run/systemd/resolve/resolv.conf file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf and is always kept up-to-date, containing information about all known DNS servers. Note the file format's limitations: it does not know a concept of per-interface DNS servers and hence only contains system-wide DNS server definitions. Note that /run/systemd/resolve/resolv.conf should not be used directly by applications, but only through a symlink from /etc/resolv.conf. If this mode of operation is used local clients that bypass any local DNS API will also bypass systemd-resolved and will talk directly to the known DNS servers.
What's the difference if I use the Stub or not?
Is it just caching?
I only want to use the DNS provided bij my ISP.
Thx
Last edited by chrisdb (2019-04-01 07:43:46)
Failure is success in progress.
A.E.
Offline
Did you read https://wiki.archlinux.org/index.php/Sy … solved#DNS ?
Offline
Yes I did
The second mode I was referring to is not listed on the wiki.
I can't seem tot find out what the stub listener on 127.0.0.1:53 actuallly provides extra instead of just using
/run/systemd/resolve/resolv.conf
Failure is success in progress.
A.E.
Offline
Outrageous! What a crap wiki ;-)
The difference is that clients that directly use resolve.conf won't use systemd-resolved (no caching, but a sane DNS cascade) in the second setup.
If you don't know, why you would want that, then you don't want that.
Offline
Outrageous! What a crap wiki ;-)
The difference is that clients that directly use resolve.conf won't use systemd-resolved (no caching, but a sane DNS cascade) in the second setup.
If you don't know, why you would want that, then you don't want that.
Which second setup are you referring to
Mine or the wiki...
Is it correct that system.networkd provides DNS from my ISP through DHCP and that systemd-resolved uses this to create '/run/systemd/resolve/resolv.conf' entries?
Failure is success in progress.
A.E.
Offline
Yours.
Whether and which DNS server is obtained through DHCP depends on your DHCP server - but that would be the typical behavior of an ISP issued router, yes.
It's however irrelevant to your question. systemd-resolved is a local DNS proxy that feeds itself from some actual DNS server (your ISPs)
Clients will then ask this localhost server for DNS resolution and it will either answer out of its cache or ask your ISPs DNS server.
If you want to use your ISPs server w/o any caching, dono't use system-resolved at all.
Notice that some consumer router-combos also provide DNS, typically using dnsmasq (a more capable dns proxy w/ a non-retarded DNS cascade…)
In this case your DHCP issued DNS server is some LAN address (eg. 192.168.1.1) and benefits of local dns proxys like resolved are neglectable.
Offline
Yours.
Whether and which DNS server is obtained through DHCP depends on your DHCP server - but that would be the typical behavior of an ISP issued router, yes.It's however irrelevant to your question. systemd-resolved is a local DNS proxy that feeds itself from some actual DNS server (your ISPs)
Clients will then ask this localhost server for DNS resolution and it will either answer out of its cache or ask your ISPs DNS server.
If you want to use your ISPs server w/o any caching, dono't use system-resolved at all.Notice that some consumer router-combos also provide DNS, typically using dnsmasq (a more capable dns proxy w/ a non-retarded DNS cascade…)
In this case your DHCP issued DNS server is some LAN address (eg. 192.168.1.1) and benefits of local dns proxys like resolved are neglectable.
Ok thank you it's more clear now
So if I don't use systemd-resolved, which process will get my ISP DNS addresses then and fill it in /etc/resolv.conf?
Last edited by chrisdb (2019-03-30 16:01:10)
Failure is success in progress.
A.E.
Offline
If you obtain it via dhcp, whatever you use to configure your network (and even networkmanager and netctl can/will operate on dhcpcd or dhclient)
Ultimately the file will typically be written by resolvconf from the openresolv package.
Offline
If you obtain it via dhcp, whatever you use to configure your network (and even networkmanager and netctl can/will operate on dhcpcd or dhclient)
Ultimately the file will typically be written by resolvconf from the openresolv package.
I would use systemd.networkd
Failure is success in progress.
A.E.
Offline
Sorry for the double post...
Just tried system.networkd without systemd.resolved yesterday and DNS resolving did not work...
There was nothing maintaining '/etc/resolve.conf'
I had to explicitly install resolved.
Failure is success in progress.
A.E.
Offline
Yeah, sorry - I took that for implied: systemd-networkd in particular relies on systemd-resolved to obtain the DNS servers.
The wiki btw. states *that* ;-)
Once you bite into lennarts world, you got to chew all of it.
Offline
Ok I'm getting into it
One last question, if I don't want the extra's of resolved, I can just disable systemd-resolved and use systemd-networkd in combination with openresolv instead right?
Failure is success in progress.
A.E.
Offline
You can just use dhcpcd or netctl (if you want a more dynamic setup w/ flexible wifi) - I don't think that system-network integrates very well w/ other tools.
Of course, if you just write a static resolve.conf, you don't need anything to configure your DNS - it's just not configured via dhcpcd but by you.
What is best for you, entirely depends on your network layout and use cases - there's no "right" way to configure your network.
Offline
Great, thanks for the answers seth!
Failure is success in progress.
A.E.
Offline