Skip to content

[resolved] routing domains in resolved.conf / per-link settings inhibit single-word domain completion #9475

Closed

Description

@msoltyspl

EDIT: Additional info: putting any routing domain anywhere inhibits name completion. It was initially tested while using ~., but it turns out any routing domains preempt single name completion (though it's still possible to get them completed afterwards, if ~. is also present on the link).

Systemd version: 238.133
Distro: Archlinux

If we setup resolved.conf in e.g.

DNS=1.1.1.1
Domains=~.

And pair it with basic per-link settings with single search domain, e.g.

      Current Scopes: DNS LLMNR/IPv4 mDNS/IPv4
         DNS Servers: 192.168.0.30
          DNS Domain: touk.pl

Then attemtping to resolve single-word names (which are correct after appending the domain name) instantly fails with 'Name or service not known':

Jun 29 16:25:00 hakai systemd-resolved[20811]: Looking up RR for xs19 IN A.
Jun 29 16:25:00 hakai systemd-resolved[20811]: Looking up RR for xs19 IN AAAA.
Jun 29 16:25:00 hakai systemd-resolved[20811]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=13 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Jun 29 16:25:00 hakai systemd-resolved[20811]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=14 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Jun 29 16:25:00 hakai systemd-resolved[20811]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1995 path=n/a interface=n/a member=n/a cookie=11 reply_cookie=14 signature=s error-name=n/a error-message=n/a
Jun 29 16:25:00 hakai systemd-resolved[20811]: Sent message type=error sender=n/a destination=:1.2000 path=n/a interface=n/a member=n/a cookie=15 reply_cookie=2 signature=s error-name=org.freedesktop.resolve1.NoNameServers error-message=No appropriate name servers or networks for name found
Jun 29 16:25:00 hakai systemd-resolved[20811]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=16 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Jun 29 16:25:00 hakai systemd-resolved[20811]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1995 path=n/a interface=n/a member=n/a cookie=10 reply_cookie=13 signature=n/a error-name=n/a error-message=n/a

Interestingly, if we add ~. to per-link settings as well (next to already present search domain), then the resolution (from the example above, with touk.pl correctly appended to xs19) works fine. This applies to all per-link/global settings that have both ~. and search domains present. Also - contrary to #9472 - in this case global nameserver will not be queried for xs19.touk.pl

Essentially, to summarize - it seems that putting ~. inhibits any attempts to complete single-word domains using search domain and dns servers from other links / global settings - unless those also have ~. present.

Activity

  1. changed the title [-][resolved] .~ in resolved.conf inhibits single-word domain completion[/-] [+][resolved] .~ in resolved.conf / per-link settings inhibits single-word domain completion[/+] on Jul 2, 2018
  2. janlarres commented on Jul 11, 2018

    @janlarres

    Can confirm with version 239 – I was scratching my head for hours why single-label names were not resolved for my VPN, even though the search domains were set correctly. Adding ~. to the link domains finally made it work.

  3. msoltyspl commented on Jul 23, 2018

    @msoltyspl
    ContributorAuthor

    Is this actually considered a bug, or just a side-effect of how ~. functions ? ~. has essentially two effects - 1) dns queries matching any named search/routing domain will also go to entries having ~. (~. matches everything) and 2) dns queries not matching any of the named search/routing will go only to entries having ~. (~. sets priority). Single-word domain name formally falls into the second case, pre-empting so to speak any attempts to create fqdn from available search domains.

    It kind of feels like a bug (completion of single-words should probably have priority, as single-word domains make little sense - and being forced to add ~. as a workaround also has side effect of sending other queries where they shouldn't be). At the same time the bug has no chance to happen If we are asking about fqdn (e.g. having ~example.net, asking for foo.example.net), as completion doesn't happen then.

  4. DmitriK commented on Aug 6, 2018

    @DmitriK

    This issue causes problems for my use case at work. I would like to use DNS over TLS and DNSSEC for all normal queries, but use the intranet's resolver for an private domain, which does not support DNSSEC or DoT. I'm able to get this to work by specifying Domains=~. and enabling DNSSEC and DoT in resolved.conf, and then adding the private domain and disabling DNSSEC and DoT in the networkd .network file. However, this issue prevents single domain names from working. Unfortunately, removing the global Domains=~. results in the internal DNS server being used for queries, so I lose all the security that I'm trying to use.

  5. msoltyspl commented on Aug 8, 2018

    @msoltyspl
    ContributorAuthor

    One extra thing i noticed today is that presence of any routing domain other than .~ inhibits attempts at name completion as well.. E.g.

              DNS Domain: touk.pl
                          ~bar.example.com
    

    If we try to resolve a single name, this setup will not attempt to complete it with touk.pl.

    Changing ~bar.example.com to bar.example.com will lead to successful resolution of e.g. xs21.touk.pl

  6. changed the title [-][resolved] .~ in resolved.conf / per-link settings inhibits single-word domain completion[/-] [+][resolved] routing domains in resolved.conf / per-link settings inhibit single-word domain completion[/+] on Aug 13, 2018
  7. keszybz commented on Oct 21, 2020

    @keszybz
    Member

    This should be fixed by a97a3b2. I have a similar setup and the query for a single label name gets resolved correctly. If this still doesn't work, please show full resolvectl dns, resolvectl domain, and logs.

  8. msoltyspl commented on Oct 25, 2020

    @msoltyspl
    ContributorAuthor

    Yea, it's been working fine for me as well (and for a while, so probably since the commit you mentioned).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions