summaryrefslogtreecommitdiff
path: root/src/resolve/resolvectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-11-10 23:34:40 +0100
committerLennart Poettering <lennart@poettering.net>2021-02-16 10:03:43 +0100
commit5c1790d1cec785951f16addb257bbf13d594e02b (patch)
tree3d40bd2c072f21a1a6631ce396f56b2925357720 /src/resolve/resolvectl.c
parent43fc4baa26ccf3bc5ee65d4c6fa4890084632f2b (diff)
downloadsystemd-5c1790d1cec785951f16addb257bbf13d594e02b.tar.gz
resolved: propagate source where an RR from back to client
This is extremely useful when debugging stuff: knowing whether a result was cached, came from network, or was synthesized.
Diffstat (limited to 'src/resolve/resolvectl.c')
-rw-r--r--src/resolve/resolvectl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
index c24bc4e27e..2302ca48ba 100644
--- a/src/resolve/resolvectl.c
+++ b/src/resolve/resolvectl.c
@@ -161,6 +161,16 @@ static void print_source(uint64_t flags, usec_t rtt) {
yes_no(flags & SD_RESOLVED_AUTHENTICATED),
yes_no(flags & SD_RESOLVED_CONFIDENTIAL),
ansi_normal());
+
+ if ((flags & (SD_RESOLVED_FROM_MASK|SD_RESOLVED_SYNTHETIC)) != 0)
+ printf("%s-- Data from:%s%s%s%s%s%s\n",
+ ansi_grey(),
+ FLAGS_SET(flags, SD_RESOLVED_SYNTHETIC) ? " synthetic" : "",
+ FLAGS_SET(flags, SD_RESOLVED_FROM_CACHE) ? " cache" : "",
+ FLAGS_SET(flags, SD_RESOLVED_FROM_ZONE) ? " zone" : "",
+ FLAGS_SET(flags, SD_RESOLVED_FROM_TRUST_ANCHOR) ? " trust-anchor" : "",
+ FLAGS_SET(flags, SD_RESOLVED_FROM_NETWORK) ? " network" : "",
+ ansi_normal());
}
static void print_ifindex_comment(int printed_so_far, int ifindex) {