4

In RHEL 8, systemctl list-unit-files|grep resolved reports that systemd-resolved is both present and running by default. However, systemd-resolve --statistics shows no name:ip mappings are being cached locally: caching statistics remain "0" even when I force resolution doing something with ping www.redhat.com or systemd-resolve www.redhat.com 127.0.0.1

Why is resolved not caching previously resolved name:ip mappings locally?!?!?

Caching tests annotated screenshot PRE changes

1 Answer 1

4

The fix is simple: you need to reference resolved as a source of DNS resolution in /etc/nsswitch.

Add "resolve" to the hosts directive, making it first in the list. So the hosts entry in /etc/nsswitch should look as below:

hosts: resolve files dns myhostname 

Let's see what happens after we make the change to /etc/nsswitch:

Caching tests annotated screenshot POST Changes

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.