Skip to content

Provide a way to fallback to the DNS advertised by DHCP #30319

@ShellCode33

Description

@ShellCode33

Component

systemd-resolved

Is your feature request related to a problem? Please describe

I don't want to default to using the DNS received from DHCP, because I don't trust them on public networks.

Yet I I'd like to be able to use it as a last resort if my main DNS is unable to resolve a given domain (because it is a local one)

I believe that such a feature would also help with captive portals, see #29869

Describe the solution you'd like

I think the best way would be to have a FallbackAdvertisedDNS=true in the configuration file.

DNS=9.9.9.9#dns.quad9.net 
FallbackDNS=1.1.1.1#cloudflare-dns.com
FallbackAdvertisedDNS=true

DNS would be used first, then FallbackDNS, then the advertised DNS.

Because most local DNS won't provide DoT, I guess an additional config key would be required to be able to downgrade the settings, something like AdvertisedDNSOverTLS=opportunistic.

Describe alternatives you've considered

An alternative could be to be able to enforce the order in which DNS servers are used.

man resolved.conf states the following about DNS= :

DNS requests are sent to one of the listed DNS servers in parallel

If I were able to set a DNSRespectOrder=true my DHCP DNS would be used as a last resort:

Link 5 (wlan0)
    Current Scopes: DNS
         Protocols: +DefaultRoute -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=no/unsupported
       DNS Servers: 9.9.9.9#dns.quad9.net 192.168.1.3

But it would be a shame to have to disable parallel requests to be able to fallback to the advertised DNS, therefore I don't think this is a good solution.

The systemd version you checked that didn't have the feature you are asking for

254

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestresolve

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions