resolve: adjust message for NXDOMAIN lookup result
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Feb 2023 13:43:48 +0000 (14:43 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Feb 2023 13:49:58 +0000 (14:49 +0100)
commitbbb86efa7c668fa79331aa9a7f0567d89a3af50f
treeb4c704c86944ddf2d5e078bc7fdedc80b5ae1a24
parent03e80572a71c65833ccca7b9ef06c5d86322e2ed
resolve: adjust message for NXDOMAIN lookup result

Previously, we reported:
  nx.example.org: resolve call failed: 'nx.example.org' not found
But the call did succeed, and in fact all communication with the upstream
servers was successful, and we got an authoritative negative answer.
So instead of saying that the call fail, just say that the host doesn't exist:
  nx.example.org: Name 'nx.example.org' not found

I wanted to keep the prefix of "<name>: ", to keep the output uniform. But
it'd look a bit strange to say "<name>: <name> not found", so I added "Name "
to make the output more readable. (Another option would be to not display
the error string received from resolved, but that seems risky: even if right
now resolved uses just one message format, it could start doing something else
in the future, so it's better to display the error as received.)

Fixes #26233.
src/resolve/resolvectl.c
src/resolve/resolved-bus.c