diff --git a/meson.build b/meson.build index fb900775631..bfd708cb4c2 100644 --- a/meson.build +++ b/meson.build @@ -1302,6 +1302,16 @@ conf.set('DEFAULT_DNS_OVER_TLS_MODE', 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper()) substs.set('DEFAULT_DNS_OVER_TLS_MODE', default_dns_over_tls) +default_mdns = get_option('default-mdns') +conf.set('DEFAULT_MDNS_MODE', + 'RESOLVE_SUPPORT_' + default_mdns.to_upper()) +substs.set('DEFAULT_MDNS_MODE', default_mdns) + +default_llmnr = get_option('default-llmnr') +conf.set('DEFAULT_LLMNR_MODE', + 'RESOLVE_SUPPORT_' + default_llmnr.to_upper()) +substs.set('DEFAULT_LLMNR_MODE', default_llmnr) + want_repart = get_option('repart') if want_repart != 'false' have = (conf.get('HAVE_OPENSSL') == 1 and @@ -3354,6 +3364,8 @@ status = [ 'default DNSSEC mode: @0@'.format(default_dnssec), 'default DNS-over-TLS mode: @0@'.format(default_dns_over_tls), + 'default mDNS mode: @0@'.format(default_mdns), + 'default LLMNR mode: @0@'.format(default_llmnr), 'default cgroup hierarchy: @0@'.format(default_hierarchy), 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme), 'default KillUserProcesses setting: @0@'.format(kill_user_processes), diff --git a/meson_options.txt b/meson_options.txt index 3962565091f..30cf1477184 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -230,6 +230,14 @@ option('default-dns-over-tls', type : 'combo', description : 'default DNS-over-TLS mode', choices : ['yes', 'opportunistic', 'no'], value : 'no') +option('default-mdns', type : 'combo', + choices : ['yes', 'resolve', 'no'], + description : 'default MulticastDNS mode', + value : 'yes') +option('default-llmnr', type : 'combo', + choices : ['yes', 'resolve', 'no'], + description : 'default LLMNR mode', + value : 'yes') option('dns-over-tls', type : 'combo', choices : ['auto', 'gnutls', 'openssl', 'true', 'false'], description : 'DNS-over-TLS support') option('dns-servers', type : 'string', diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index df25907a4c5..94590e30386 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -581,8 +581,8 @@ int manager_new(Manager **ret) { .dns_stub_tcp_fd = -1, .hostname_fd = -1, - .llmnr_support = RESOLVE_SUPPORT_YES, - .mdns_support = RESOLVE_SUPPORT_YES, + .llmnr_support = DEFAULT_LLMNR_MODE, + .mdns_support = DEFAULT_MDNS_MODE, .dnssec_mode = DEFAULT_DNSSEC_MODE, .dns_over_tls_mode = DEFAULT_DNS_OVER_TLS_MODE, .enable_cache = DNS_CACHE_MODE_YES, diff --git a/src/resolve/resolved.conf.in b/src/resolve/resolved.conf.in index 6898c7848be..85822e316c1 100644 --- a/src/resolve/resolved.conf.in +++ b/src/resolve/resolved.conf.in @@ -15,10 +15,10 @@ #DNS= #FallbackDNS=@DNS_SERVERS@ #Domains= -#LLMNR=yes -#MulticastDNS=yes #DNSSEC=@DEFAULT_DNSSEC_MODE@ #DNSOverTLS=@DEFAULT_DNS_OVER_TLS_MODE@ +#MulticastDNS=@DEFAULT_MDNS_MODE@ +#LLMNR=@DEFAULT_LLMNR_MODE@ #Cache=yes #DNSStubListener=yes #ReadEtcHosts=yes