]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolvectl: suppress warning about --type for names with a dot 19131/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 Mar 2021 13:14:38 +0000 (14:14 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 Mar 2021 20:24:36 +0000 (21:24 +0100)
People don't generally type the trailing dot by mistake, so let's treat this as
indication that they want to resolve this particular hostname.

src/resolve/resolvectl.c

index 269151b9b1df593a84b20ec0a730524d3e2b08f8..52bbae3293b8283f5e25468e6e7f3dccc4029b45 100644 (file)
@@ -476,7 +476,7 @@ static int resolve_record(sd_bus *bus, const char *name, uint16_t class, uint16_
 
         log_debug("Resolving %s %s %s (interface %s).", name, dns_class_to_string(class), dns_type_to_string(type), isempty(arg_ifname) ? "*" : arg_ifname);
 
-        if (single_label_nonsynthetic(name))
+        if (dns_name_dot_suffixed(name) == 0 && single_label_nonsynthetic(name))
                 log_notice("(Note that search domains are not appended when --type= is specified. "
                            "Please specify fully qualified domain names, or remove --type= switch from invocation in order to request regular hostname resolution.)");