Skip to content

resolved needs to write out a 127.0.0.53 /etc/resolv.conf file that lists all collected search domains #7009

Closed

Description

@poettering

currently, there are two ways to set up your /etc/resolv.conf when using resolved. Either by symlinking it to /run/systemd/resolve/resolv.conf in which case all upstream DNS information (i.e. servers as well as DNS search lists) learnt by resolved is propagated to clients reading /etc/resolv.conf.

alternatively, /etc/resolv.conf can be linked to the static file /usr/lib/systemd/resolv.conf which lists only 127.0.0.53 as DNS server and no search lists at all.

Now, we generally suggest people to use the second method, but that breaks clients not using nss-resolve search list support. we should really write out a second, dynamic resolv.conf file, that lists upstream DNS search list domains, but not upstream DNS servers, but instead only 127.0.0.53. That's because if the DNS stub is used search list logic needs to be done client-side, resolved can't do it for the clients.

Activity

  1. added this to the v236 milestone on Oct 5, 2017
  2. perolausson commented on Oct 6, 2017

    @perolausson

    Ok. You forgot the third, which appears to pop up as well:

    /etc/resolv.conf -> /run/resolvconf/resolv.conf

    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    # 127.0.0.53 is the systemd-resolved stub resolver.
    # run "systemd-resolve --status" to see details about the actual nameservers.
    
    nameserver 127.0.0.53
    search lan
    

    I've added "search lan" by hand to try it out, since it is what you want you describe it that it should look like.

    Is there any way I can make sure that it stays this way? Do I need to hardcode it until systemd is fixed?

    Can I suggest that a configuration guide for this is updated? It is way to overcomplicated for anyone to understand how to tame systemd-resolved to do the right thing as it is.

    For me now, as mentioned with the other bugs, this doesn't work because the DNS server is stuck on not downgrading to UDP (systemd-232/ubu 17.04):

    Oct 06 01:04:23 janus systemd-resolved[13771]: Transaction 23560 for <zeus2 IN A> on scope llmnr on eno1/INET now complete with <attempts-max-reached> from none (unsigned).
    Oct 06 01:04:23 janus systemd-resolved[13771]: Freeing transaction 23560.
    Oct 06 01:04:32 janus systemd-resolved[13771]: Got DNS stub UDP query packet for id 17587
    Oct 06 01:04:32 janus systemd-resolved[13771]: Looking up RR for zeus2.lan IN A.
    Oct 06 01:04:32 janus systemd-resolved[13771]: NXDOMAIN cache hit for zeus2.lan IN A
    Oct 06 01:04:32 janus systemd-resolved[13771]: Transaction 62101 for <zeus2.lan IN A> on scope dns on */* now complete with <rcode-failure> from cache (unsigned).
    
    
  3. xnox commented on Oct 6, 2017

    @xnox
    Contributor

    @poettering i've wrote something like that for Ubuntu already and was meaning to propose it. Do you want me to send merge proposal with my code that does that?

  4. added a commit that references this issue on Oct 24, 2017
    e6b2d94
  5. wheelerlaw commented on Jun 7, 2018

    @wheelerlaw

    @perolausson Is that third case documented anywhere? That's my resolver is setup on my Ubuntu 18.04 machine, but I can't find a trace of evidence of that in the documentation for either resolvconf or resolved; (the latter of which only documents the two cases as described @poettering).

  6. xnox commented on Jun 14, 2018

    @xnox
    Contributor

    @wheelerlaw http://manpages.ubuntu.com/manpages/bionic/en/man8/systemd-resolved.8.html the /ETC/RESOLV.CONF section documenting 4 supported modes, with the stub-resolv.conf documented as the first and recommended one. Matches bionic behaviour, and same man-page is present here on disk.

    resolvconf is no longer installed by default, on fresh installs, and you are free to remove it after upgrading to bionic.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions