Workaround systemd resolved not working (127.0.0.53)

Systemd comes with its own implementation: systemd-resolved. Ubuntu included systemd-resolved in version 16.10 and it’s now present in latest 18.04. These cause resolv.conf use 127.0.0.53 and in many case make system cannot resolve name.

I found some tricks to slove this issue.

  1. Edit /etc/systemd/resolved.conf replace DNS_IPx with your DNS’s IP
    [Resolve]
    DNS=DNS_IP1 DNS_IP2 DNS_IP3
    FallbackDNS=DNS_IP4 DNS_IP5 DNS_IP6
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #Cache=yes
    #DNSStubListener=yes

    Example

    [Resolve]
    DNS=1.1.1.2 8.8.8.8
    FallbackDNS=1.0.0.2 8.8.8.4
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #Cache=yes
    #DNSStubListener=yes
  2. Make link resolv.confIf you want to use upstream DNS
    ln -rsf /run/systemd/resolve/resolv.conf /etc/resolv.conf
    

    Or you want to use DNS systemd proxied

    ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    
  3. Restart systemd-resolved
    systemctl restart systemd-resolved
    
โซเชียล

2 Replies to “Workaround systemd resolved not working (127.0.0.53)”

Leave a Reply

%d bloggers like this: